<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - [AVX512F] Suboptimal code generated for a _mm_mask_store_sd expansion"
   href="https://llvm.org/bugs/show_bug.cgi?id=30563">30563</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AVX512F] Suboptimal code generated for a _mm_mask_store_sd expansion
          </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>normal
          </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>zvi.rackover@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We currently do not support the AVX512F _mm_mask_store_sd
[<a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_sd">https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_store_sd</a>]
intrinics, but a reasonable expansion of this intrinsics to LLVM IR may be:

define void @_mm_mask_store_sd(double* nocapture %__W, i8 zeroext %__U, <2 x
double> %__A) local_unnamed_addr {
 entry:
   %tobool.i = trunc i8 %__U to i1
   %mask = insertelement <2 x i1> <i1 undef, i1 false>, i1 %tobool.i, i32 0
   %V = bitcast double * %__W to <2 x double>*
   call void @llvm.masked.store.v2f64.p0v2f64(<2 x double> %__A, <2 x double>*
%V, i32 16, <2 x i1> %mask)
   ret void
 }
 declare void @llvm.masked.store.v2f64.p0v2f64(<2 x double>, <2 x double>*,
i32, <2 x i1>)

which should be lowered to:
==========================================
        kmovw     %esi, %k1
        vmovsd    %xmm0, (%rdi){%k1}
==========================================

'llc -mcpu=knl' generates:
==========================================
        vmovq   %rsi, %xmm1
        vpsllq  $63, %xmm1, %xmm1
        vpsrad  $31, %xmm1, %xmm1
        vpshufd $245, %xmm1, %xmm1      # xmm1 = xmm1[1,1,3,3]
        vmaskmovpd      %xmm0, %xmm1, (%rdi)
        retq
==========================================

'llc -mcpu=skylake-avx512' generates:
==========================================
        andl    $1, %esi
        kmovw   %esi, %k0
        kxorw   %k0, %k0, %k1
        kshiftrw        $1, %k1, %k1
        kshiftlw        $1, %k1, %k1
        korw    %k0, %k1, %k1
        vmovapd %xmm0, (%rdi) {%k1}
        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>