[RFC] Using more than one access method to memory locations
Dave Korn
dk@artimi.com
Fri Nov 26 20:03:00 GMT 2004
> -----Original Message-----
> From: gcc-owner On Behalf Of Svein E. Seldal
> Sent: 26 November 2004 19:38
> Would it be generally possible to make gcc issue two
> different INSNs when the
> compiler is accessing memory from two different memory sections?
>
> My idea is that it would be nice if the compiler can access a
> given memory
> segment with one kind of instruction, and access another
> memory segment using
> another instruction to access it.
>
> The major problem arises when using pointers, because which
> section a symbol
> belongs to may not be available at compiletime. A possible
> workaround for
> this would be to implement some kind of __attribute__ on pointers and
> variables. Then the compiler can know which INSN to use to
> access the data.
>
> Does this sound at all feasable?
Certainly. You could model it on the various ports that have to do
longcalls.
http://www.google.com/search?hl=en&q=longcall+site%3Agcc.gnu.org
It'll be fairly involved: you'll have to modify *all* the movXX patterns
in your target (and indeed any others that may generate memory-accessing
instructions, and don't forget to take care of prolog and epilog code as
well) to take account of this factor and generate both versions of memory
access that you need, but it should be a more-or-less straightforward job
for all that.
cheers,
DaveK
--
Can't think of a witty .sigline today....
More information about the Gcc
mailing list