[llvm-bugs] [Bug 31455] [X86][SSE] Slow sqrt libcall branch due to dependency on sqrtsd result

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 27 13:51:58 PST 2017


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

Sanjay Patel <spatel+llvm at rotateright.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Sanjay Patel <spatel+llvm at rotateright.com> ---
After:
https://reviews.llvm.org/rL319094

We should see something like this on x86-64:

_sqrt_add:               
        xorps   %xmm2, %xmm2  
        ucomisd %xmm2, %xmm0  # test the arg
        jb      LBB0_2

        sqrtsd  %xmm0, %xmm0  # not negative, so we're good
        addsd   %xmm1, %xmm0
        retq
LBB0_2: 
        pushq   %rax          # defer to libm to set errno
        movsd   %xmm1, (%rsp)    
        callq   _sqrt
        movsd   (%rsp), %xmm1  
        addq    $8, %rsp
        addsd   %xmm1, %xmm0
        retq

-- 
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/20171127/820792eb/attachment.html>


More information about the llvm-bugs mailing list