1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=yonah -mtriple=i386-apple-darwin | FileCheck %s
5 define <4 x i32> @test1(<4 x i32> %A, <4 x i32> %B) nounwind {
8 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm0
11 %C = icmp sgt <4 x i32> %A, %B
12 %D = sext <4 x i1> %C to <4 x i32>
16 define <4 x i32> @test2(<4 x i32> %A, <4 x i32> %B) nounwind {
19 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm1
20 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
21 ; CHECK-NEXT: pxor %xmm1, %xmm0
23 %C = icmp sge <4 x i32> %A, %B
24 %D = sext <4 x i1> %C to <4 x i32>
28 define <4 x i32> @test3(<4 x i32> %A, <4 x i32> %B) nounwind {
31 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm1
32 ; CHECK-NEXT: movdqa %xmm1, %xmm0
34 %C = icmp slt <4 x i32> %A, %B
35 %D = sext <4 x i1> %C to <4 x i32>
39 define <4 x i32> @test4(<4 x i32> %A, <4 x i32> %B) nounwind {
42 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
43 ; CHECK-NEXT: pxor %xmm2, %xmm1
44 ; CHECK-NEXT: pxor %xmm2, %xmm0
45 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm0
47 %C = icmp ugt <4 x i32> %A, %B
48 %D = sext <4 x i1> %C to <4 x i32>
52 define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) nounwind {
55 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
56 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
57 ; CHECK-NEXT: pand %xmm1, %xmm0
59 %C = icmp eq <2 x i64> %A, %B
60 %D = sext <2 x i1> %C to <2 x i64>
64 define <2 x i64> @test6(<2 x i64> %A, <2 x i64> %B) nounwind {
67 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
68 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,0,3,2]
69 ; CHECK-NEXT: pand %xmm1, %xmm0
70 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm1
71 ; CHECK-NEXT: pxor %xmm1, %xmm0
73 %C = icmp ne <2 x i64> %A, %B
74 %D = sext <2 x i1> %C to <2 x i64>
78 define <2 x i64> @test7(<2 x i64> %A, <2 x i64> %B) nounwind {
81 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0]
82 ; CHECK-NEXT: pxor %xmm2, %xmm1
83 ; CHECK-NEXT: pxor %xmm2, %xmm0
84 ; CHECK-NEXT: movdqa %xmm0, %xmm2
85 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm2
86 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
87 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
88 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
89 ; CHECK-NEXT: pand %xmm3, %xmm1
90 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3]
91 ; CHECK-NEXT: por %xmm1, %xmm0
93 %C = icmp sgt <2 x i64> %A, %B
94 %D = sext <2 x i1> %C to <2 x i64>
98 define <2 x i64> @test8(<2 x i64> %A, <2 x i64> %B) nounwind {
101 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0]
102 ; CHECK-NEXT: pxor %xmm2, %xmm0
103 ; CHECK-NEXT: pxor %xmm2, %xmm1
104 ; CHECK-NEXT: movdqa %xmm1, %xmm2
105 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm2
106 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
107 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm1
108 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
109 ; CHECK-NEXT: pand %xmm3, %xmm1
110 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3]
111 ; CHECK-NEXT: por %xmm1, %xmm0
113 %C = icmp slt <2 x i64> %A, %B
114 %D = sext <2 x i1> %C to <2 x i64>
118 define <2 x i64> @test9(<2 x i64> %A, <2 x i64> %B) nounwind {
119 ; CHECK-LABEL: test9:
121 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0]
122 ; CHECK-NEXT: pxor %xmm2, %xmm0
123 ; CHECK-NEXT: pxor %xmm2, %xmm1
124 ; CHECK-NEXT: movdqa %xmm1, %xmm2
125 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm2
126 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
127 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm1
128 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,3,3]
129 ; CHECK-NEXT: pand %xmm3, %xmm0
130 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
131 ; CHECK-NEXT: por %xmm0, %xmm1
132 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
133 ; CHECK-NEXT: pxor %xmm1, %xmm0
135 %C = icmp sge <2 x i64> %A, %B
136 %D = sext <2 x i1> %C to <2 x i64>
140 define <2 x i64> @test10(<2 x i64> %A, <2 x i64> %B) nounwind {
141 ; CHECK-LABEL: test10:
143 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,0,2147483648,0]
144 ; CHECK-NEXT: pxor %xmm2, %xmm1
145 ; CHECK-NEXT: pxor %xmm2, %xmm0
146 ; CHECK-NEXT: movdqa %xmm0, %xmm2
147 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm2
148 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
149 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
150 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
151 ; CHECK-NEXT: pand %xmm3, %xmm0
152 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
153 ; CHECK-NEXT: por %xmm0, %xmm1
154 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
155 ; CHECK-NEXT: pxor %xmm1, %xmm0
157 %C = icmp sle <2 x i64> %A, %B
158 %D = sext <2 x i1> %C to <2 x i64>
162 define <2 x i64> @test11(<2 x i64> %A, <2 x i64> %B) nounwind {
163 ; CHECK-LABEL: test11:
165 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
166 ; CHECK-NEXT: pxor %xmm2, %xmm1
167 ; CHECK-NEXT: pxor %xmm2, %xmm0
168 ; CHECK-NEXT: movdqa %xmm0, %xmm2
169 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm2
170 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
171 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
172 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,3,3]
173 ; CHECK-NEXT: pand %xmm3, %xmm1
174 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3]
175 ; CHECK-NEXT: por %xmm1, %xmm0
177 %C = icmp ugt <2 x i64> %A, %B
178 %D = sext <2 x i1> %C to <2 x i64>
182 define <2 x i64> @test12(<2 x i64> %A, <2 x i64> %B) nounwind {
183 ; CHECK-LABEL: test12:
185 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
186 ; CHECK-NEXT: pxor %xmm2, %xmm0
187 ; CHECK-NEXT: pxor %xmm2, %xmm1
188 ; CHECK-NEXT: movdqa %xmm1, %xmm2
189 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm2
190 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
191 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm1
192 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
193 ; CHECK-NEXT: pand %xmm3, %xmm1
194 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,1,3,3]
195 ; CHECK-NEXT: por %xmm1, %xmm0
197 %C = icmp ult <2 x i64> %A, %B
198 %D = sext <2 x i1> %C to <2 x i64>
202 define <2 x i64> @test13(<2 x i64> %A, <2 x i64> %B) nounwind {
203 ; CHECK-LABEL: test13:
205 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
206 ; CHECK-NEXT: pxor %xmm2, %xmm0
207 ; CHECK-NEXT: pxor %xmm2, %xmm1
208 ; CHECK-NEXT: movdqa %xmm1, %xmm2
209 ; CHECK-NEXT: pcmpgtd %xmm0, %xmm2
210 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
211 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm1
212 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,3,3]
213 ; CHECK-NEXT: pand %xmm3, %xmm0
214 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
215 ; CHECK-NEXT: por %xmm0, %xmm1
216 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
217 ; CHECK-NEXT: pxor %xmm1, %xmm0
219 %C = icmp uge <2 x i64> %A, %B
220 %D = sext <2 x i1> %C to <2 x i64>
224 define <2 x i64> @test14(<2 x i64> %A, <2 x i64> %B) nounwind {
225 ; CHECK-LABEL: test14:
227 ; CHECK-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
228 ; CHECK-NEXT: pxor %xmm2, %xmm1
229 ; CHECK-NEXT: pxor %xmm2, %xmm0
230 ; CHECK-NEXT: movdqa %xmm0, %xmm2
231 ; CHECK-NEXT: pcmpgtd %xmm1, %xmm2
232 ; CHECK-NEXT: pshufd {{.*#+}} xmm3 = xmm2[0,0,2,2]
233 ; CHECK-NEXT: pcmpeqd %xmm1, %xmm0
234 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
235 ; CHECK-NEXT: pand %xmm3, %xmm0
236 ; CHECK-NEXT: pshufd {{.*#+}} xmm1 = xmm2[1,1,3,3]
237 ; CHECK-NEXT: por %xmm0, %xmm1
238 ; CHECK-NEXT: pcmpeqd %xmm0, %xmm0
239 ; CHECK-NEXT: pxor %xmm1, %xmm0
241 %C = icmp ule <2 x i64> %A, %B
242 %D = sext <2 x i1> %C to <2 x i64>