This is the mail archive of the gcc-bugs@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]

[Bug target/19009] New: Loading of FP constants into FP reg via SSE reg


This is something I noticed in the build of povray-3.50c, with '-march=pentium4
-mfpmath=387'. Loading of 0.0 into the FP register is quite strange:

 8051efb:    66 0f ef c9              pxor   %xmm1,%xmm1        <- clear SSE reg
 8051eff:    f2 0f 11 4c 24 38        movsd  %xmm1,0x38(%esp,1) <- move it to stack
 8051f05:    89 de                    mov    %ebx,%esi
 8051f07:    31 c9                    xor    %ecx,%ecx
 8051f09:    dd 03                    fldl   (%ebx)
 8051f0b:    d8 cd                    fmul   %st(5),%st
 8051f0d:    dd 43 08                 fldl   0x8(%ebx)
 8051f10:    d8 cd                    fmul   %st(5),%st
 8051f12:    de c1                    faddp  %st,%st(1)
 8051f14:    dd 43 10                 fldl   0x10(%ebx)
 8051f17:    d8 cc                    fmul   %st(4),%st
 8051f19:    de c1                    faddp  %st,%st(1)
 8051f1b:    d8 c2                    fadd   %st(2),%st
 8051f1d:    f2 0f 11 0c 24           movsd  %xmm1,(%esp,1) <- move it to stack
 8051f22:    dd 04 24                 fldl   (%esp,1)      <- load it to FP reg
                        
...
 8051f39:    dd 44 24 38              fldl   0x38(%esp,1)  <- load it to FP reg
 8051f3d:    df f1                    fcomip %st(1),%st
...

This could be implemented by fldz...

Another example of constant loading via XMM reg:

 ...
 805552b:    f2 0f 10 05 e0 63 16     movsd  0x81663e0,%xmm0    <- load consant
 8055532:    08
 8055533:    f2 0f 11 44 24 20        movsd  %xmm0,0x20(%esp,1) <- move to stack
 8055539:    dd 44 24 20              fldl   0x20(%esp,1)
 805553d:    df f1                    fcomip %st(1),%st
 ...

-- 
           Summary: Loading of FP constants into FP reg via SSE reg
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uros at kss-loka dot si
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: pentium4-pc-linux-gnu
  GCC host triplet: pentium4-pc-linux-gnu
GCC target triplet: pentium4-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19009


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