public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* sparc64 emit_group_load/store change
@ 1998-01-16  1:51 Richard Henderson
  0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 1998-01-16  1:51 UTC (permalink / raw)
  To: egcs

Sparc v9 has a somewhat complicated mechanism for passing small
structures.  It lays the structure out as if in memory, then
"promotes" bits of it into registers based on the basic type of
the value that winds up at an address.

In particular, structures smaller than a word are passed left-
justified in a 64-bit register. 

Aside from the in-register positioning, there are two cases that 
cause problems with the existing disjoint structure code:

  struct foo bar (struct foo *f) { return *f; }

when f is near a vma boundary and

  struct c8 { char c[8]; };
  struct c8 baz (struct c8 *c) { return *c; }

when c is not word aligned.

My solution to this was to rewrite emit_group_load/store to give
it some more information and to use the bitfield extraction/insertion
routines.  This solves the problem of loading unaligned words as
well as not reading too much. 

Once the register is loaded, I use BITS_BIG_ENDIAN to determine
if we should be left-justifying the register.  This may not be
the best predicate to be using...

ANYWAY... One of the reasons I'm bringing this up is that in the
old emit_group_load there were comments about AIX and Irix 6.
What I want to know -- particularly for AIX -- is if anything 
breaks.  I have rememberences that we never did do Irix6 structure
passing as per the ABI, so I'd like to know if it does now.

So here's the patch.  Your pardon, but it is hand-edited to bring
it down to just the relevant bits for this topic.


r~

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-01-16  1:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-16  1:51 sparc64 emit_group_load/store change Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).