<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:gonzalobg88@gmail.com" title="Gonzalo BG <gonzalobg88@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - sse4.1 all/any reductions on <4 x i32> inconsistent and possibly suboptimal"
href="https://bugs.llvm.org/show_bug.cgi?id=38788">bug 38788</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - sse4.1 all/any reductions on <4 x i32> inconsistent and possibly suboptimal"
href="https://bugs.llvm.org/show_bug.cgi?id=38788#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - sse4.1 all/any reductions on <4 x i32> inconsistent and possibly suboptimal"
href="https://bugs.llvm.org/show_bug.cgi?id=38788">bug 38788</a>
from <span class="vcard"><a class="email" href="mailto:gonzalobg88@gmail.com" title="Gonzalo BG <gonzalobg88@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span></b>
<pre>@Craig The following example also fails (<a href="https://gcc.godbolt.org/z/tSZ6n6">https://gcc.godbolt.org/z/tSZ6n6</a>)
define i1 @all_sse41(<4 x i32>) {
%2 = bitcast <4 x i32> %0 to <2 x i64>
%3 = tail call i32 @llvm.x86.sse41.ptestc(<2 x i64> %2, <2 x i64> <i64 -1,
i64 -1>) #2
%4 = icmp eq i32 %3, 1
ret i1 %4
}
define i1 @cmp(<4 x i32>, <4 x i32>) {
%3 = icmp eq <4 x i32> %0, %1
%4 = sext <4 x i1> %3 to <4 x i32>
%5 = tail call i1 @all_sse41(<4 x i32> %4)
ret i1 %5
}
after opt -O3 -mattr=+sse4.2 produces:
cmp: # @cmp
pcmpeqd %xmm1, %xmm0
pcmpeqd %xmm1, %xmm1
ptest %xmm1, %xmm0
setb %al
retq
Note that here all_sse41 receives an input for which its result will be
equivalent to movemask because the vector has been sign extended, so it doesn't
matter if one looks at all bits or just the sign bit.</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>