<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 - [AVX] partly-implemented 256-bit ISA leads to codegen problems"
   href="https://bugs.llvm.org/show_bug.cgi?id=32790">32790</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AVX] partly-implemented 256-bit ISA leads to codegen problems
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>define <8 x i32> @legality_problems(<8 x i32> %a, <8 x i32> %b, <8 x i32> %c,
<8 x i32> %d) {
  %add = add <8 x i32> %a, %b
  %and = and <8 x i32> %add, %c
  %sub = sub <8 x i32> %and, %d
  ret <8 x i32> %sub
}

We'd be better off sticking to 128-bit ops here:

$ ./llc -o - v256.ll -mattr=avx
        vextractf128    $1, %ymm1, %xmm4
        vextractf128    $1, %ymm0, %xmm5
        vpaddd  %xmm4, %xmm5, %xmm4
        vpaddd  %xmm1, %xmm0, %xmm0
        vinsertf128     $1, %xmm4, %ymm0, %ymm0
        vandps  %ymm2, %ymm0, %ymm0
        vextractf128    $1, %ymm0, %xmm1
        vextractf128    $1, %ymm3, %xmm2
        vpsubd  %xmm2, %xmm1, %xmm1
        vpsubd  %xmm3, %xmm0, %xmm0
        vinsertf128     $1, %xmm1, %ymm0, %ymm0
        retq</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>