<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] Avoid XOR $0, %al in parity generation"
href="https://bugs.llvm.org/show_bug.cgi?id=41638">41638</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X86] Avoid XOR $0, %al in parity generation
</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>As mentioned in <a href="https://reviews.llvm.org/D61230">https://reviews.llvm.org/D61230</a>, the parity codegen in bool
vector xor reduction is generating "xor $0, $al" but it would be better to use
"test %al, %al" or "or %al, %al" or "and %al, %al" which gives a shorter
encoding since there would be no immediate.
define i1 @trunc_v2i64_v2i1(<2 x i64>) {
; SSE-LABEL: trunc_v2i64_v2i1:
; SSE: # %bb.0:
; SSE-NEXT: psllq $63, %xmm0
; SSE-NEXT: movmskpd %xmm0, %eax
; SSE-NEXT: xorb $0, %al
; SSE-NEXT: setnp %al
; SSE-NEXT: retq
;
; AVX-LABEL: trunc_v2i64_v2i1:
; AVX: # %bb.0:
; AVX-NEXT: vpsllq $63, %xmm0, %xmm0
; AVX-NEXT: vmovmskpd %xmm0, %eax
; AVX-NEXT: xorb $0, %al
; AVX-NEXT: setnp %al
; AVX-NEXT: retq
;
; AVX512BW-LABEL: trunc_v2i64_v2i1:
; AVX512BW: # %bb.0:
; AVX512BW-NEXT: vpsllq $63, %xmm0, %xmm0
; AVX512BW-NEXT: vptestmq %zmm0, %zmm0, %k0
; AVX512BW-NEXT: kmovd %k0, %eax
; AVX512BW-NEXT: andl $3, %eax
; AVX512BW-NEXT: xorb $0, %al
; AVX512BW-NEXT: setnp %al
; AVX512BW-NEXT: vzeroupper
; AVX512BW-NEXT: retq
;
; AVX512VL-LABEL: trunc_v2i64_v2i1:
; AVX512VL: # %bb.0:
; AVX512VL-NEXT: vpsllq $63, %xmm0, %xmm0
; AVX512VL-NEXT: vptestmq %xmm0, %xmm0, %k0
; AVX512VL-NEXT: kmovd %k0, %eax
; AVX512VL-NEXT: andl $3, %eax
; AVX512VL-NEXT: xorb $0, %al
; AVX512VL-NEXT: setnp %al
; AVX512VL-NEXT: retq
%a = trunc <2 x i64> %0 to <2 x i1>
%b = call i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1> %a)
ret i1 %b
}
declare i1 @llvm.experimental.vector.reduce.xor.v2i1(<2 x i1>)</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>