<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 - Use vpermps instead of vpermilps"
   href="https://bugs.llvm.org/show_bug.cgi?id=47066">47066</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Use vpermps instead of vpermilps
          </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>Linux
          </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>david.bolvansky@gmail.com
          </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>#define N 16
float f1[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
float f2[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));

void foo ()
{
  int j;
  for (j=0; j<N; j++)
    f1[j] += f2[N-j];
}


Clang -O3 -mavx512f:

foo():                                # @foo()
        vpermilps       zmm0, zmmword ptr [rip + f2+4], 27 # zmm0 =
mem[3,2,1,0,7,6,5,4,11,10,9,8,15,14,13,12]
        vshuff64x2      zmm0, zmm0, zmm0, 27    # zmm0 = zmm0[6,7,4,5,2,3,0,1]
        vaddps  zmm0, zmm0, zmmword ptr [rip + f1]
        vmovaps zmmword ptr [rip + f1], zmm0
        vzeroupper
        ret

ICC -O3 -mavx512f:

foo():
        vmovups   zmm16, ZMMWORD PTR .L_2il0floatpacket.0[rip]  #9.14
        vpermps   zmm17, zmm16, ZMMWORD PTR 4+f2[rip]           #9.14
        vaddps    zmm18, zmm17, ZMMWORD PTR f1[rip]             #9.5
        vmovups   ZMMWORD PTR f1[rip], zmm18                    #9.5
        vzeroupper                                              #10.1

<a href="https://godbolt.org/z/7bToc7">https://godbolt.org/z/7bToc7</a>

Interestingly, if I changed float to double, Clang matches ICC:
<a href="https://godbolt.org/z/h13beq">https://godbolt.org/z/h13beq</a></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>