<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 - [X86][AVX] Failure to generate vaddsubps for pattern after 19b62b79"
   href="https://bugs.llvm.org/show_bug.cgi?id=45015">45015</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86][AVX] Failure to generate vaddsubps for pattern after 19b62b79
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Consider the following code:

#include <x86intrin.h>
__m128 haddsub0ps(__m128 a, __m128 b) {
  return (__m128){ a[0] - b[0], a[1] + b[1], a[2] - b[2], a[3] + b[3] };
}

Prior to commit 19b62b79db1bb154b40e8baba9a28ab8aa935b6b, when compiled with
optimizations and avx (-O2 -mavx), the compiler would generate the following
assembly:

vaddsubps       %xmm1, %xmm0, %xmm0

But now the compiler is instead generating the following assembly:

vsubss          %xmm1, %xmm0, %xmm2
vaddps          %xmm1, %xmm0, %xmm3
vblendps        $1, %xmm2, %xmm3, %xmm2 # xmm2 = xmm2[0],xmm3[1,2,3]
vsubps          %xmm1, %xmm0, %xmm0
vblendps        $3, %xmm2, %xmm0, %xmm0 # xmm0 = xmm2[0,1],xmm0[2,3]
vblendps        $8, %xmm3, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2],xmm3[3]</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>