<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] Regression in subvector scatter due to splitting ymm loads"
   href="https://bugs.llvm.org/show_bug.cgi?id=42305">42305</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86][AVX] Regression in subvector scatter due to splitting ymm loads
          </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>andrea.dibiagio@gmail.com, craig.topper@gmail.com, greg.bedwell@sony.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://godbolt.org/z/8Cjr7X">https://godbolt.org/z/8Cjr7X</a>

#include <x86intrin.h>

void scatter_subvectors( int count, const float* src, const int* idx, float*
dst )
{
  for( int i = 0; i != count; ++i )
  {
        __m256 j01 = _mm256_loadu_ps((const float*)(src + 0));
        __m256 j23 = _mm256_loadu_ps((const float*)(src + 8));
        src += 16;

        _mm_storeu_ps(dst + idx[0],  _mm256_extractf128_ps(j01, 0));
        _mm_storeu_ps(dst + idx[1],  _mm256_extractf128_ps(j01, 1));
        _mm_storeu_ps(dst + idx[2],  _mm256_extractf128_ps(j23, 0));
        _mm_storeu_ps(dst + idx[3],  _mm256_extractf128_ps(j23, 1));
        idx += 4;
  }
}

We're seeing a regression as the ymm loads are each being split into 2 xmm
loads because we extract+store the subvectors independently. But because
vextractf128 can store directly we're increasing instruction count completely
unnecessarily.</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>