<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] Add selective commutation support for insertps"
   href="https://bugs.llvm.org/show_bug.cgi?id=40340">40340</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86] Add selective commutation support for insertps
          </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://godbolt.org/z/bhohSK">https://godbolt.org/z/bhohSK</a>

#include <x86intrin.h>

__m128 ii(__m128 x, __m128 *y) {
    return _mm_insert_ps(*y, x, (1<<6) | (1<<4) | 5);
}

define <4 x float> @_Z2iiDv4_fPS_(<4 x float>, <4 x float>* nocapture readonly)
{
  %3 = load <4 x float>, <4 x float>* %1, align 16
  %4 = tail call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %3, <4 x
float> %0, i8 85)
  ret <4 x float> %4
}
declare <4 x float> @llvm.x86.sse41.insertps(<4 x float>, <4 x float>, i8) #1


_Z2iiDv4_fPS_: # @_Z2iiDv4_fPS_
  vmovaps (%rdi), %xmm1
  vinsertps $85, %xmm0, %xmm1, %xmm0 # xmm0 = zero,xmm0[1],zero,xmm1[3]
  retq

When we have 1 "inline" element from each source and zeros everywhere else we
should be able to commute the immediate to allow the memory fold.</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>