[coldfire-gnu-discuss] Small data sections

Nathan Sidwell nathan at codesourcery.com
Tue Jun 26 12:04:36 UTC 2007


David Brown wrote:
> Just a passing thought...
> 
> Some gcc targets support the concept of "small data section".  This is 
> particularly important for 32-bit RISC cpus (like the PPC), were an 
> addressing mode of the form "Rx + 16bit" can fit in one instruction, 
> while an absolute 32-bit address takes a lot of messing around to get 
> the address into a register and then doing the real load or store.  On a 
> ColdFire, which has absolute long addressing modes, it is not nearly as 
> important.

thanks for your suggestion.

As you probably realize, small data sections are a psABI design feature.  We 
would be stepping outside of the m68k ABI by adding that to ColdFire.  ABIs that 
have small data sections generally have a lot of registers -- mips and ppc have 
32 integer registers, for instance.  m68k has 8 address registers (arm has 16 
registers, and I don't think the ARM EABI has small data references).

Whether small data is a win on ColdFire is probably application-specific.  We 
may get better mileage by teaching the compiler more about instruction costs and 
using section anchors.  (The m68k port is one of the oldest gcc ports, and its 
age shows in certain places.)

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan at codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the coldfire-gnu-discuss mailing list