<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 - Compiler no longer producing hsub instruction after upstream commit be69e66b1cd8"
   href="https://bugs.llvm.org/show_bug.cgi?id=48823">48823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compiler no longer producing hsub instruction after upstream commit be69e66b1cd8
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</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>