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: GCC viciously beaten by ICC in trig test!

Roger Sayle <> writes:

  > without it, the same "-O2 -ffast-math -fomit-frame-pointer" options'
  > output is identical to the output from Intel v7.0 (and presumably later).
  > foo:    fldl    4(%esp)
  >         fsin
  >         fmul    %st(0), %st
  >         ret

Intel 8.0 (that was used in the original test) generates something
very different:

# parameter 1: 8 + %ebx
..B1.1:                         # Preds ..B1.0
        pushl     %ebx                                          #5.1
        movl      %esp, %ebx                                    #5.1
        andl      $-8, %esp                                     #5.1
        subl      $8, %esp                                      #5.1
        movsd     8(%ebx), %xmm0                                #7.15
        call      __libm_sse2_sincos                            #7.15
                                # LOE ebp esi edi xmm0 xmm1
..B1.4:                         # Preds ..B1.1
        mulsd     %xmm1, %xmm1                                  #10.25
        mulsd     %xmm0, %xmm0                                  #10.15
        addsd     %xmm1, %xmm0                                  #10.25
        movsd     %xmm0, (%esp)                                 #10.25
        fldl      (%esp)                                        #10.25
        movl      %ebx, %esp                                    #10.25
        popl      %ebx                                          #10.25
        ret                                                     #10.25

 __libm_sse2_sincos seems to be an iterative SSE function. 

I guess the mystery is solved now. 

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