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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to