<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] Rematerializable lower 'allones' subvector masks"
   href="https://bugs.llvm.org/show_bug.cgi?id=42653">42653</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86][AVX] Rematerializable lower 'allones' subvector masks
          </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>Windows NT
          </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>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://gcc.godbolt.org/z/ESwT78">https://gcc.godbolt.org/z/ESwT78</a>

We should be able to rematerialize masks where the lower subvector half is -1
and the upper 0 by using a smaller destination and the implicit zeroing of the
upper bits:

#include <x86intrin.h>

__m128i low128_128() {
    // GOOD
    return _mm_setr_epi32(-1,-1,-1,-1);
}
__m256i low256_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm256_setr_epi32(-1,-1,-1,-1,0,0,0,0);
}
__m512i low512_128() {
    // BAD: vpcmpeqd %xmm0, %xmm0, %xmm0
    return _mm512_setr_epi32(-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0);
}
__m512i low512_256() {
    // BAD: vpcmpeqd %ymm0, %ymm0, %ymm0
    return _mm512_setr_epi32(-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0);
}</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>