This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: function parms in regs, patch 3 of 3


On Fri, May 02, 2003 at 01:24:40PM -0400, Jim Wilson wrote:
> There is also a simpler related problem.  Some ABIs use big-endian
> left-justified/little-endian right-justified for arguments smaller than
> a word.  The reason is that a simple word-sized word-aligned store can
> then be used to put the argument in memory, and it will end up in the
> same place in both the big and little endian cases.  Likewise, a simple
> word-sized word-aligned load can be used to load the argument into a
> register.  Unfortunately, gcc doesn't understand this convention, and
> ends up doing bit-field operations to move the argument between regs and
> memory.  This often results in a series of shifts, masks, and byte-sized
> loads/stores.  I think it is a little embarrassing that we do this. 
> This does require that we have a word sized word aligned area to
> load/store from/into, but that will often be the case.  Stack slots are
> always word sized and aligned for instance.

Yes, I noticed.  Actually, it was this that led me to delve into this
code and start tidying a few things.  I'd solved the powerpc64 ABI
problem originally using PARALLELs, and then found that in certain
cases (< word size struct) we could generate better code by not using
a PARALLEL for incoming args.  Not exactly elegant though, so I started
to poke into why a PARALLEL was necessary in the first place.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]