[llvm-bugs] [Bug 48823] New: Compiler no longer producing hsub instruction after upstream commit be69e66b1cd8

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 20 12:07:17 PST 2021


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

            Bug ID: 48823
           Summary: Compiler no longer producing hsub instruction after
                    upstream commit be69e66b1cd8
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

After commit be69e66b1cd8, one of our internal tests is no longer generating a
horizontal subtraction instruction for the following code:

__attribute__((noinline))
__m128 sub_ps_004(__m128 a, __m128 b) {
  __m128 r = (__m128){ a[0] - a[1], a[2] - a[3], b[0] - b[1], b[2] - b[3] };
  return __builtin_shufflevector(r, a, 0, -1, -1, 3);
}

When compiling with a compiler targeting the PS4 (x86_64-scei-ps4), the
comipler previously generated this code for the function:

(clang -S -O2 --target=x86_64-scei-ps4)

vhsubps %xmm1, %xmm0, %xmm0

However after the change above, the compiler now generates the following code:

vshufps $229, %xmm1, %xmm0, %xmm2       # xmm2 = xmm0[1,1],xmm1[2,3]
vshufps $164, %xmm1, %xmm0, %xmm0       # xmm0 = xmm0[0,1],xmm1[2,2]
vsubps  %xmm2, %xmm0, %xmm0

-- 
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/20210120/9ad6cd3c/attachment.html>


More information about the llvm-bugs mailing list