PowerPC64 alignment of double in structs

Steve Munroe sjmunroe at us.ibm.com
Fri Sep 19 00:30:56 EST 2003


On Wed, 2003-09-17 at 23:50, Alan Modra wrote:
> On Wed, Sep 17, 2003 at 11:26:14PM +0200, Benjamin Herrenschmidt wrote:
> > On Wed, 2003-09-17 at 18:11, Alan Modra wrote:
> > > http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01003.html is a proposal
> > > for fixing struct layout rules on powerpc64-linux-gcc to comply with
> > > the PowerPC64 Linux ABI.  The ABI specifies 4 byte alignment for
> > > doubles, which is a little surprising for someone without an AIX
> > > background, and isn't ideal for speed.  An alternative would be to
> > > change the ABI and gcc (and presumably xlc) to natural alignment.
> >
> > For what it's worth on ABI matters, my opinion is too enforce strict
> > alignement (same goes for Altivec). I'd go further saying that not
> > enforcing alignement by default is completely insane.
>
> The insanity is due to trying to be compatible with AIX, to aid
> migration of apps from AIX to Linux.  The trouble is, we now have
> problems migrating apps from other flavours of Linux to PowerPC64
> Linux.
>
> An example:  I went looking for places in glibc that might break if
> we changed alignment of doubles.  I didn't find anything that would
> cause a problem if we changed.  ...

I hate to be a nag but we need to be concerned about all the core
libraries, not just those included by glibc.

> ...  However, I did find one
> place that's broken currently, and needs natural alignment of doubles
> to work..  In malloc/obstack.c:
> ...
> Oops, obstacks only aligned to 4 bytes.

Actually to support VMX we will need obstacks quadword (16 byte) aligned
...

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list