This is the mail archive of the
mailing list for the GCC project.
Re: [4.5 patches] Named address space support
On Mon, Nov 17, 2008 at 06:06:03PM -0500, DJ Delorie wrote:
> Would this patch set allow for address spaces with different sized
> Specifically, the r8c has 16 bit pointers, but a 20 bit address space.
> RAM is all in the 16 bit space, but .rodata could be put in flash, if
> only gcc could address it. GCC seems intent on copying addresses to
> registers and letting the optimizers put them back, which doesn't
> always do the right thing.
> It would be nice if we could internally tag .rodata and have gcc emit
> the right kinds of addressing modes for it.
Yes, the support is already there. In fact the SPU has 32-bit pointers, and
the host pointers are either 32-bit or 64-bit (based on the -mea32/-mea64
switches that were added). Obviously you have to watch out for taking the
address of things in .rodata.
I've also thought about using the address space encoding to mark accesses to
stack local variables that we know are full quad word aligned, to eliminate the
code that inserts the scalar value into the quad word (SPU only has 128-bit
loads and stores). At the RTL level, there is a 8 bit value that tracks the
named address space and should be copied whenever pointers are created.
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA