<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 - [AVX-512] Missed opportunity to select kunpckbw"
href="https://bugs.llvm.org/show_bug.cgi?id=32547">32547</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[AVX-512] Missed opportunity to select kunpckbw
</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>zvi.rackover@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>define void @foo2(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x float>
%d, float* %p) {
entry:
%0 = tail call i8 @llvm.x86.avx512.mask.cmp.ps.256(<8 x float> %a, <8 x
float> %b, i32 1, i8 -1)
%1 = tail call i8 @llvm.x86.avx512.mask.cmp.ps.256(<8 x float> %c, <8 x
float> %d, i32 1, i8 -1)
%conv.i = zext i8 %0 to i16
%conv.i18 = zext i8 %1 to i16
%shl = shl nuw i16 %conv.i, 8
%or = or i16 %shl, %conv.i18
%2 = bitcast float* %p to <16 x float>*
%3 = bitcast i16 %or to <16 x i1>
tail call void @llvm.masked.store.v16f32.p0v16f32(<16 x float>
zeroinitializer, <16 x float>* %2, i32 64, <16 x i1> %3) #4
ret void
}
declare void @llvm.masked.store.v16f32.p0v16f32(<16 x float>, <16 x float>*,
i32, <16 x i1>)
llc -mcpu=skx gives:
vcmpltps %ymm1, %ymm0, %k0
vcmpltps %ymm3, %ymm2, %k1
kmovb %k0, %eax
kmovb %k1, %ecx
shll $8, %eax
orl %ecx, %eax
kmovw %eax, %k1
vxorps %zmm0, %zmm0, %zmm0
vmovaps %zmm0, (%rdi) {%k1}
vzeroupper
retq
A better codegen would be:
vcmpltps %ymm1, %ymm0, %k0
vcmpltps %ymm3, %ymm2, %k1
kunpckbw %k1, %k0, %k2
vxorps %zmm0, %zmm0, %zmm0
vmovups %zmm0, (%rdi){%k2}
vzeroupper
ret</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>