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?


> 
> -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).

Perhaps it was intended for numerical applications, but it is
implemented by increasing maximal alignment that affect long long too.

main()
{
	 struct a{int a;
		 long long b;
		 };
	 printf("%i\n",sizeof (struct a));
}
hubicka@kampanus:/aux/hubicka$ gcc t.c
hubicka@kampanus:/aux/hubicka$ ./a.out
12
hubicka@kampanus:/aux/hubicka$ gcc t.c -malign-double
hubicka@kampanus:/aux/hubicka$ ./a.out
16
hubicka@kampanus:/aux/hubicka$ 

I think H. J. hit it with this auto alignment branch and I would say
that decreasing DImode alignment there to avoid long long triggering the
prologue is good thing to do.

Honza
> 
> Richard.


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