<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 --- - [x86, SSE] legalization for SSE1 target doesn't allow cmpps/cmppd"
href="https://llvm.org/bugs/show_bug.cgi?id=28044">28044</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[x86, SSE] legalization for SSE1 target doesn't allow cmpps/cmppd
</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>spatel+llvm@rotateright.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>Forking this off of <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [x86, SSE] recognize min/max FP patterns"
href="show_bug.cgi?id=28001">bug 28001</a>:
define <4 x float> @test_mm_cmpeq_ps(<4 x float> %a0, <4 x float> %a1) nounwind
{
%cmp = fcmp oeq <4 x float> %a0, %a1
%sext = sext <4 x i1> %cmp to <4 x i32>
%res = bitcast <4 x i32> %sext to <4 x float>
ret <4 x float> %res
}
This should be 'cmpeqps', but DAG type legalization doesn't like the <4 x i32>
type for an SSE1 target, so:
$ ./llc -o - cmpeq.ll -mattr=sse,-sse2
...
movaps %xmm1, %xmm2
shufps $231, %xmm2, %xmm2 ## xmm2 = xmm2[3,1,2,3]
movaps %xmm0, %xmm3
shufps $231, %xmm3, %xmm3 ## xmm3 = xmm3[3,1,2,3]
ucomiss %xmm2, %xmm3
setnp %al
sete %cl
andb %al, %cl
movzbl %cl, %eax
shll $31, %eax
sarl $31, %eax
movl %eax, -8(%rsp)
movaps %xmm1, %xmm2
shufps $229, %xmm2, %xmm2 ## xmm2 = xmm2[1,1,2,3]
movaps %xmm0, %xmm3
shufps $229, %xmm3, %xmm3 ## xmm3 = xmm3[1,1,2,3]
ucomiss %xmm2, %xmm3
setnp %al
sete %cl
andb %al, %cl
movzbl %cl, %eax
shll $31, %eax
sarl $31, %eax
movl %eax, -12(%rsp)
ucomiss %xmm1, %xmm0
setnp %al
sete %cl
andb %al, %cl
movzbl %cl, %eax
shll $31, %eax
sarl $31, %eax
movl %eax, -16(%rsp)
shufps $230, %xmm1, %xmm1 ## xmm1 = xmm1[2,1,2,3]
shufps $230, %xmm0, %xmm0 ## xmm0 = xmm0[2,1,2,3]
ucomiss %xmm1, %xmm0
setnp %al
sete %cl
andb %al, %cl
movzbl %cl, %eax
shll $31, %eax
sarl $31, %eax
movl %eax, -4(%rsp)
movss -8(%rsp), %xmm0 ## xmm0 = mem[0],zero,zero,zero
movss -12(%rsp), %xmm1 ## xmm1 = mem[0],zero,zero,zero
unpcklps %xmm0, %xmm1 ## xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movss -16(%rsp), %xmm0 ## xmm0 = mem[0],zero,zero,zero
movss -4(%rsp), %xmm2 ## xmm2 = mem[0],zero,zero,zero
unpcklps %xmm2, %xmm0 ## xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
unpcklps %xmm1, %xmm0 ## xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
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>