64-bit on ia-32

Andrew Pinski pinskia@physics.uc.edu
Wed Aug 13 00:58:00 GMT 2003


On Tuesday, Aug 12, 2003, at 18:30 US/Eastern, Johan Rydberg wrote:

>
> Hi.
>
> For a program I'm writing, I must use 64-bit datatypes on a IA-32
> host.  Since performance is everything for this application, I'm
> looking at the code that GCC generates; and I have found something
> that I think could be done better.  Take the following example:
>
> register unsigned long long v0 asm ("%esi");
>
> union u
>   {
>     unsigned int ww[2];
>     unsigned long long ll;
>   };
>
> extern int p1, p2;
> #define P1 ((int) &p1)
> #define P2 ((int) &p2)
>
> static void
> move1 (void)
> {
>   v0 = (((unsigned long long) P1 << 32) & 0xffffffff00000000ULL
>         | ((unsigned long long) P2) & 0xffffffffULL) ;
> }

For move1 I might be able to fix this to be about the same as move2 
(and maybe better)
but this work will not get done for another month or two.

One of the problems with move1 right now is that GCC does not know how 
to combine these two rtl
(since this is a list about development of GCC I assume you know how to 
read the rtl's):
(set (reg:DI 58) (sign_extend:DI (reg/f:SI 59)))
(set (reg:DI 60) (ashift:DI (reg:DI 58) (const_int 32 [0x20])))
into
(set (reg:DI 60) (ashift:DI (reg:SI 58) (const_int 32 [0x20])))

Another issue is something called libcalls which produces weaker than 
what it should (there are several bugs against them).
I would file a bug for move1 so we know what the problem exists and can 
get to it.

Thanks,
Andrew Pinski
pinskia@gcc.gnu.org
pinskia@physics.uc.edu



More information about the Gcc mailing list