<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:llvm-dev@redking.me.uk" title="Simon Pilgrim <llvm-dev@redking.me.uk>"> <span class="fn">Simon Pilgrim</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - [x86] psubus matching failure with undef elements"
href="https://bugs.llvm.org/show_bug.cgi?id=40083">bug 40083</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;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Fixed By Commit(s)</td>
<td>
</td>
<td>r352328,r352330
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>FIXED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - [x86] psubus matching failure with undef elements"
href="https://bugs.llvm.org/show_bug.cgi?id=40083#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - [x86] psubus matching failure with undef elements"
href="https://bugs.llvm.org/show_bug.cgi?id=40083">bug 40083</a>
from <span class="vcard"><a class="email" href="mailto:llvm-dev@redking.me.uk" title="Simon Pilgrim <llvm-dev@redking.me.uk>"> <span class="fn">Simon Pilgrim</span></a>
</span></b>
<pre>Fixed in rL352328 (combineAddToSUBUS) and rL352330 (combineSelect)
Note: The C++ example now emits:
unsigned long long test_sub_2(__m128i x) {
__m128i c = _mm_set1_epi8(70);
return _mm_subs_epu8(x, c)[0];
}
define i64 @test_sub_2(<2 x i64>) {
%2 = bitcast <2 x i64> %0 to <16 x i8>
%3 = tail call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> %2, <16 x i8> <i8 70,
i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8
70, i8 70, i8 70, i8 70>) #4
%4 = bitcast <16 x i8> %3 to <2 x i64>
%5 = extractelement <2 x i64> %4, i32 0
ret i64 %5
}
And the test case had typos which had to be fixed:
define i64 @test31(<2 x i64> %x) {
%t0 = bitcast <2 x i64> %x to <16 x i8>
%cmp = icmp ugt <16 x i8> %t0, <i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8
70, i8 70, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8
undef, i8 undef>
%bop = add <16 x i8> %t0, <i8 -71, i8 -71, i8 -71, i8 -71, i8 -71, i8 -71, i8
-71, i8 -71, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8
undef, i8 undef>
%sel = select <16 x i1> %cmp, <16 x i8> %bop, <16 x i8> zeroinitializer
%bc = bitcast <16 x i8> %sel to <2 x i64>
%ext = extractelement <2 x i64> %bc, i32 0
ret i64 %ext
}</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>