public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* rfa (x86):  387<=>sse moves
@ 2005-07-26  1:10 Dale Johannesen
  2005-07-26  7:51 ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: Dale Johannesen @ 2005-07-26  1:10 UTC (permalink / raw)
  To: GCC Development; +Cc: Dale Johannesen

With -march=pentium4 -mfpmath=sse -O2, we get an extra move for code 
like

     double d = atof(foo);
     int i = d;

         call    atof
         fstpl   -8(%ebp)
         movsd   -8(%ebp), %xmm0
         cvttsd2si       %xmm0, %eax

(This is Linux, Darwin is similar.)  I think the difficulty is that for

(set (reg/v:DF 58 [ d ]) (reg:DF 8 st)) 64 {*movdf_nointeger}

regclass decides SSE_REGS is a zero-cost choice for 58.  Which looks
wrong, as that requires a store and load from memory.  In fact, memory 
is
the cheapest overall choice for 58 (taking its use into account also), 
and
gcc will figure that out correctly if a more reasonable assessment is 
given
to SSE_REGS.  The immediate cause is the #Y's in the constraint:

                         "=f#Y,m  ,f#Y,*r  ,o  ,Y*x#f,Y*x#f,Y*x#f  ,m    
"

and there's probably a simple fix, but it eludes me.  Advice?  Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: rfa (x86): 387<=>sse moves
@ 2005-07-31 16:51 Uros Bizjak
  2005-08-01 18:52 ` Dale Johannesen
  0 siblings, 1 reply; 10+ messages in thread
From: Uros Bizjak @ 2005-07-31 16:51 UTC (permalink / raw)
  To: paolo.bonzini; +Cc: dalej, gcc

Hello!

> With -march=pentium4 -mfpmath=sse -O2, we get an extra move for code like
>
>    double d = atof(foo);
>    int i = d;
>
>
>        call    atof
>        fstpl   -8(%ebp)
>        movsd   -8(%ebp), %xmm0
>        cvttsd2si       %xmm0, %eax
>
>
> (This is Linux, Darwin is similar.) I think the difficulty is that for

This problem is similar to the problem, described in PR target/19398. 
There is another testcase and a small analysis in the PR that might help 
with this problem.

Uros.

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: rfa (x86): 387<=>sse moves
@ 2005-08-02 16:31 Linthicum, Tony
  0 siblings, 0 replies; 10+ messages in thread
From: Linthicum, Tony @ 2005-08-02 16:31 UTC (permalink / raw)
  To: Dale Johannesen, ubizjak; +Cc: paolo.bonzini, gcc

Hello All,

I applied the recent patches to the 7/23 snapshot, and am still seeing
some 387 to sse moves.  In particular, in SpecFP's 177.mesa (matrix.c),
I'm seeing fld1's feeding moves to sse registers.  

Compiled via: gcc -O3 -march=k8 -mfpmath=sse matrix.c

Thanks.

Tony


-----Original Message-----
From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf Of
Dale Johannesen
Sent: Monday, August 01, 2005 1:53 PM
To: ubizjak@gmail.com
Cc: paolo.bonzini@lu.unisi.ch; gcc@gcc.gnu.org
Subject: Re: rfa (x86): 387<=>sse moves


On Jul 31, 2005, at 9:51 AM, Uros Bizjak wrote:

> Hello!
>
>> With -march=pentium4 -mfpmath=sse -O2, we get an extra move for code 
>> like
>>
>>    double d = atof(foo);
>>    int i = d;
>>
>>
>>        call    atof
>>        fstpl   -8(%ebp)
>>        movsd   -8(%ebp), %xmm0
>>        cvttsd2si       %xmm0, %eax
>>
>>
>> (This is Linux, Darwin is similar.) I think the difficulty is that
for
>
> This problem is similar to the problem, described in PR target/19398. 
> There is another testcase and a small analysis in the PR that might 
> help with this problem.

Thanks, that does seem relevant.  The patches so far don't fix this 
case;
I've commented the PR explaining why.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-08-02 16:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-26  1:10 rfa (x86): 387<=>sse moves Dale Johannesen
2005-07-26  7:51 ` Paolo Bonzini
2005-07-26 22:34   ` Dale Johannesen
2005-07-27  6:11     ` Dale Johannesen
2005-07-27 21:19       ` Richard Henderson
2005-07-28  0:07         ` Dale Johannesen
2005-07-29 23:04         ` Dale Johannesen
2005-07-31 16:51 Uros Bizjak
2005-08-01 18:52 ` Dale Johannesen
2005-08-02 16:31 Linthicum, Tony

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