<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - roundf lowering under fast math"
   href="https://bugs.llvm.org/show_bug.cgi?id=42195">42195</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>roundf lowering under fast math
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.bolvansky@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>-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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>