This is the mail archive of the 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: [BENCHMARK]-mfpmath=sse should disable x387 intrinsics

Jakub Jelinek wrote:

Yeah, for static functions it should probably also pass say float and

double arguments in SSE registers as well, not on the stack, not just
vector arguments.

There is a lot of i387 code generated for parameter passing. Compiling whetstone benchmark with:
gcc -O2 -march=pentium4 -mfpmath=sse -S whetss.c, a lot of these constructs is created:

   addss    -180(%ebp), %xmm0
   movss    %xmm0, -220(%ebp)
   flds    -220(%ebp)
   fstpl    (%esp)
   call    cos
   fstpl    -232(%ebp)

So, even if -mfpmath=sse is specified SF->DF conversions go through x87. There are plenty of fld/fst instructions, even when -mno-80387 is specified.

The test.c source from PR8126 ( shows similar problem. When compiled with '-O2 -march=pentium4 -mfpmath=sse', following code is produced after the loop:

       jne     .L7
       movl    $.LC3, (%esp)
*        movss   %xmm0, -40(%ebp)
       movss   %xmm1, -56(%ebp)
       movss   %xmm2, -72(%ebp)
       call    puts
*        movss   -40(%ebp), %xmm0
*        movss   %xmm0, -76(%ebp)
*        flds    -76(%ebp)
*        fstpl   20(%esp)
       movss   -56(%ebp), %xmm1
       movss   %xmm1, -76(%ebp)
       flds    -76(%ebp)
       fstpl   12(%esp)
       movss   -72(%ebp), %xmm2
       movss   %xmm2, -76(%ebp)
       flds    -76(%ebp)
       fstpl   4(%esp)
       movl    $.LC4, (%esp)
       call    printf
       xorl    %eax, %eax

* marks the path of a SF value until it is printed with printf().


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