[llvm-bugs] [Bug 45752] New: [X86] Failure to use sqrtsd destination operand to optimize out movsd

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 30 01:33:49 PDT 2020


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

            Bug ID: 45752
           Summary: [X86] Failure to use sqrtsd destination operand to
                    optimize out movsd
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: gabravier 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

typedef double v2df __attribute__((vector_size(16)));

v2df _mm_sqrt_sd(v2df a, v2df b)
{
    v2df c = __builtin_ia32_sqrtpd((v2df){b[0], b[1]});
    return (v2df){c[0], a[1]};
}

GCC -O3 outputs this :

_mm_sqrt_sd(double __vector(2), double __vector(2)):
  sqrtsd xmm0, xmm1
  ret

LLVM outputs this :

_mm_sqrt_sd(double __vector(2), double __vector(2)):
  sqrtpd xmm1, xmm1
  movsd xmm0, xmm1 # xmm0 = xmm1[0],xmm0[1]
  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/20200430/d6c244c0/attachment.html>


More information about the llvm-bugs mailing list