[llvm-bugs] [Bug 42195] New: roundf lowering under fast math

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 8 06:32:26 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42195

            Bug ID: 42195
           Summary: roundf lowering under fast math
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

-Ofast -mfma -march=skylake
float rf(float B) {
   return  roundf(B);
}

Clang:
rf(float):
  jmp roundf

GCC generates:
rf(float):
        vmovaps xmm1, xmm0
        vandps  xmm0, xmm0, XMMWORD PTR .LC1[rip]
        vorps   xmm0, xmm0, XMMWORD PTR .LC0[rip]
        vaddss  xmm0, xmm0, xmm1
        vroundss        xmm0, xmm0, xmm0, 3
        ret


ICC:
rf(float):
        vxorps    xmm1, xmm1, xmm1                              #7.12
        vmovss    xmm3, xmm1, xmm0                              #7.12
        vandps    xmm4, xmm3, XMMWORD PTR .L_2il0floatpacket.0[rip] #7.12
        vcmpeqps  xmm2, xmm4, XMMWORD PTR .L_2il0floatpacket.1[rip] #7.12
        vroundps  xmm9, xmm4, 0                                 #7.12
        vxorps    xmm11, xmm3, xmm4                             #7.12
        vblendvps xmm5, xmm9, XMMWORD PTR .L_2il0floatpacket.2[rip], xmm2 #7.12
        vsubps    xmm6, xmm4, xmm5                              #7.12
        vcmpeqps  xmm7, xmm6, XMMWORD PTR .L_2il0floatpacket.3[rip] #7.12
        vandps    xmm8, xmm7, XMMWORD PTR .L_2il0floatpacket.4[rip] #7.12
        vaddps    xmm10, xmm8, xmm9                             #7.12
        vxorps    xmm0, xmm10, xmm11                            #7.12
        ret

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190608/22459780/attachment.html>


More information about the llvm-bugs mailing list