This is the mail archive of the gcc@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: Why is DImode aligned at 8 byte for i386?


On Feb 4, 2008 12:06 PM, Jan Hubicka <jh@suse.cz> wrote:
>
> > On Feb 4, 2008 4:11 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > > DImode is aligned at 8 byte in i386. Since 32bit doesn't have
> > > 64bit register, can we align DImode at 4byte instead of 8
> > > for i386? It shouldn't have any negative impact on performance.
> >
> > I don't think DImode is aligned at 8 bytes on i386, at least not as
> > far as struct layout is concerned.
>
> It is with -malign-double AFAIK.  The reasons for doing so predate me.
> I guess it was a speculation that since alignment on double appeared
> that in future same alignment on long long might too.

-malign-double is (was?) indeed a performance improvement for
numerical applications on 32bits.  But DImode is still not 8 bytes aligned
there (which makes a next-gen 32bit ABI for 64bit x86 difficult there,
if you want to retain DImode/DFmode 8 byte alignment and re-use the
kernel 32bit compatibility layer).

Richard.


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