1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
3 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -x86-experimental-vector-widening-legalization | FileCheck %s --check-prefix=X64_WIDEN
5 ; RUN: llc < %s -mtriple=i386-unknown-unknown -mattr=+sse2 -x86-experimental-vector-widening-legalization | FileCheck %s --check-prefix=X86_WIDEN
7 define void @test_udiv7_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
8 ; X64-LABEL: test_udiv7_v2i32:
10 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
11 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,0,1]
12 ; X64-NEXT: movd %xmm1, %eax
13 ; X64-NEXT: imulq $613566757, %rax, %rcx # imm = 0x24924925
14 ; X64-NEXT: shrq $32, %rcx
15 ; X64-NEXT: subl %ecx, %eax
17 ; X64-NEXT: addl %ecx, %eax
18 ; X64-NEXT: shrl $2, %eax
19 ; X64-NEXT: movd %xmm0, %ecx
20 ; X64-NEXT: imulq $613566757, %rcx, %rdx # imm = 0x24924925
21 ; X64-NEXT: shrq $32, %rdx
22 ; X64-NEXT: subl %edx, %ecx
24 ; X64-NEXT: addl %edx, %ecx
25 ; X64-NEXT: shrl $2, %ecx
26 ; X64-NEXT: movd %ecx, %xmm0
27 ; X64-NEXT: movd %eax, %xmm1
28 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
29 ; X64-NEXT: movq %xmm0, (%rsi)
32 ; X86-LABEL: test_udiv7_v2i32:
34 ; X86-NEXT: pushl %ebx
35 ; X86-NEXT: pushl %edi
36 ; X86-NEXT: pushl %esi
37 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
38 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
39 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
40 ; X86-NEXT: movd %xmm0, %ecx
41 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
42 ; X86-NEXT: movd %xmm0, %esi
43 ; X86-NEXT: movl $613566757, %ebx # imm = 0x24924925
44 ; X86-NEXT: movl %esi, %eax
46 ; X86-NEXT: subl %edx, %esi
48 ; X86-NEXT: addl %edx, %esi
49 ; X86-NEXT: shrl $2, %esi
50 ; X86-NEXT: movl %ecx, %eax
52 ; X86-NEXT: subl %edx, %ecx
54 ; X86-NEXT: addl %edx, %ecx
55 ; X86-NEXT: shrl $2, %ecx
56 ; X86-NEXT: movd %ecx, %xmm0
57 ; X86-NEXT: movd %esi, %xmm1
58 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
59 ; X86-NEXT: movq %xmm0, (%edi)
65 ; X64_WIDEN-LABEL: test_udiv7_v2i32:
67 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
68 ; X64_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [613566757,613566757,613566757,613566757]
69 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm2
70 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm2
71 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
72 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
73 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm3
74 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3]
75 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
76 ; X64_WIDEN-NEXT: psubd %xmm2, %xmm0
77 ; X64_WIDEN-NEXT: psrld $1, %xmm0
78 ; X64_WIDEN-NEXT: paddd %xmm2, %xmm0
79 ; X64_WIDEN-NEXT: psrld $2, %xmm0
80 ; X64_WIDEN-NEXT: movq %xmm0, (%rsi)
81 ; X64_WIDEN-NEXT: retq
83 ; X86_WIDEN-LABEL: test_udiv7_v2i32:
85 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
86 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
87 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
88 ; X86_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [613566757,613566757,613566757,613566757]
89 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm2
90 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm2
91 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
92 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm3
93 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm3 = xmm3[1,1],xmm0[2,3]
94 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm3
95 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3]
96 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
97 ; X86_WIDEN-NEXT: psubd %xmm2, %xmm0
98 ; X86_WIDEN-NEXT: psrld $1, %xmm0
99 ; X86_WIDEN-NEXT: paddd %xmm2, %xmm0
100 ; X86_WIDEN-NEXT: psrld $2, %xmm0
101 ; X86_WIDEN-NEXT: movq %xmm0, (%eax)
102 ; X86_WIDEN-NEXT: retl
103 %a = load <2 x i32>, <2 x i32>* %x
104 %b = udiv <2 x i32> %a, <i32 7, i32 7>
105 store <2 x i32> %b, <2 x i32>* %y
109 define void @test_urem7_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
110 ; X64-LABEL: test_urem7_v2i32:
112 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
113 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,0,1]
114 ; X64-NEXT: movd %xmm1, %ecx
115 ; X64-NEXT: imulq $613566757, %rcx, %rdx # imm = 0x24924925
116 ; X64-NEXT: shrq $32, %rdx
117 ; X64-NEXT: movl %ecx, %eax
118 ; X64-NEXT: subl %edx, %eax
119 ; X64-NEXT: shrl %eax
120 ; X64-NEXT: addl %edx, %eax
121 ; X64-NEXT: shrl $2, %eax
122 ; X64-NEXT: leal (,%rax,8), %edx
123 ; X64-NEXT: subl %edx, %eax
124 ; X64-NEXT: addl %ecx, %eax
125 ; X64-NEXT: movd %xmm0, %ecx
126 ; X64-NEXT: imulq $613566757, %rcx, %rdx # imm = 0x24924925
127 ; X64-NEXT: shrq $32, %rdx
128 ; X64-NEXT: movl %ecx, %edi
129 ; X64-NEXT: subl %edx, %edi
130 ; X64-NEXT: shrl %edi
131 ; X64-NEXT: addl %edx, %edi
132 ; X64-NEXT: shrl $2, %edi
133 ; X64-NEXT: leal (,%rdi,8), %edx
134 ; X64-NEXT: subl %edx, %edi
135 ; X64-NEXT: addl %ecx, %edi
136 ; X64-NEXT: movd %edi, %xmm0
137 ; X64-NEXT: movd %eax, %xmm1
138 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
139 ; X64-NEXT: movq %xmm0, (%rsi)
142 ; X86-LABEL: test_urem7_v2i32:
144 ; X86-NEXT: pushl %ebp
145 ; X86-NEXT: pushl %ebx
146 ; X86-NEXT: pushl %edi
147 ; X86-NEXT: pushl %esi
148 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
149 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
150 ; X86-NEXT: movd %xmm0, %ecx
151 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
152 ; X86-NEXT: movd %xmm0, %esi
153 ; X86-NEXT: movl $613566757, %edi # imm = 0x24924925
154 ; X86-NEXT: movl %esi, %eax
155 ; X86-NEXT: mull %edi
156 ; X86-NEXT: movl %esi, %ebx
157 ; X86-NEXT: subl %edx, %ebx
158 ; X86-NEXT: shrl %ebx
159 ; X86-NEXT: addl %edx, %ebx
160 ; X86-NEXT: shrl $2, %ebx
161 ; X86-NEXT: leal (,%ebx,8), %eax
162 ; X86-NEXT: subl %eax, %ebx
163 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
164 ; X86-NEXT: addl %esi, %ebx
165 ; X86-NEXT: movl %ecx, %eax
166 ; X86-NEXT: mull %edi
167 ; X86-NEXT: movl %ecx, %eax
168 ; X86-NEXT: subl %edx, %eax
169 ; X86-NEXT: shrl %eax
170 ; X86-NEXT: addl %edx, %eax
171 ; X86-NEXT: shrl $2, %eax
172 ; X86-NEXT: leal (,%eax,8), %edx
173 ; X86-NEXT: subl %edx, %eax
174 ; X86-NEXT: addl %ecx, %eax
175 ; X86-NEXT: movd %eax, %xmm0
176 ; X86-NEXT: movd %ebx, %xmm1
177 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
178 ; X86-NEXT: movq %xmm0, (%ebp)
179 ; X86-NEXT: popl %esi
180 ; X86-NEXT: popl %edi
181 ; X86-NEXT: popl %ebx
182 ; X86-NEXT: popl %ebp
185 ; X64_WIDEN-LABEL: test_urem7_v2i32:
186 ; X64_WIDEN: # %bb.0:
187 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
188 ; X64_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [613566757,613566757,613566757,613566757]
189 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm2
190 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm2
191 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
192 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
193 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm3
194 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3]
195 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
196 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm1
197 ; X64_WIDEN-NEXT: psubd %xmm2, %xmm1
198 ; X64_WIDEN-NEXT: psrld $1, %xmm1
199 ; X64_WIDEN-NEXT: paddd %xmm2, %xmm1
200 ; X64_WIDEN-NEXT: psrld $2, %xmm1
201 ; X64_WIDEN-NEXT: movdqa %xmm1, %xmm2
202 ; X64_WIDEN-NEXT: pslld $3, %xmm2
203 ; X64_WIDEN-NEXT: psubd %xmm2, %xmm1
204 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm1
205 ; X64_WIDEN-NEXT: movq %xmm1, (%rsi)
206 ; X64_WIDEN-NEXT: retq
208 ; X86_WIDEN-LABEL: test_urem7_v2i32:
209 ; X86_WIDEN: # %bb.0:
210 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
211 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
212 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
213 ; X86_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [613566757,613566757,613566757,613566757]
214 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm2
215 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm2
216 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
217 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm3
218 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm3 = xmm3[1,1],xmm0[2,3]
219 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm3
220 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,3,2,3]
221 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
222 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm1
223 ; X86_WIDEN-NEXT: psubd %xmm2, %xmm1
224 ; X86_WIDEN-NEXT: psrld $1, %xmm1
225 ; X86_WIDEN-NEXT: paddd %xmm2, %xmm1
226 ; X86_WIDEN-NEXT: psrld $2, %xmm1
227 ; X86_WIDEN-NEXT: movdqa %xmm1, %xmm2
228 ; X86_WIDEN-NEXT: pslld $3, %xmm2
229 ; X86_WIDEN-NEXT: psubd %xmm2, %xmm1
230 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm1
231 ; X86_WIDEN-NEXT: movq %xmm1, (%eax)
232 ; X86_WIDEN-NEXT: retl
233 %a = load <2 x i32>, <2 x i32>* %x
234 %b = urem <2 x i32> %a, <i32 7, i32 7>
235 store <2 x i32> %b, <2 x i32>* %y
239 define void @test_sdiv7_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
240 ; X64-LABEL: test_sdiv7_v2i32:
242 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
243 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,0,1]
244 ; X64-NEXT: movd %xmm1, %eax
246 ; X64-NEXT: imulq $-1840700269, %rax, %rcx # imm = 0x92492493
247 ; X64-NEXT: shrq $32, %rcx
248 ; X64-NEXT: addl %ecx, %eax
249 ; X64-NEXT: movl %eax, %ecx
250 ; X64-NEXT: shrl $31, %ecx
251 ; X64-NEXT: sarl $2, %eax
252 ; X64-NEXT: addl %ecx, %eax
253 ; X64-NEXT: movd %xmm0, %ecx
254 ; X64-NEXT: movslq %ecx, %rcx
255 ; X64-NEXT: imulq $-1840700269, %rcx, %rdx # imm = 0x92492493
256 ; X64-NEXT: shrq $32, %rdx
257 ; X64-NEXT: addl %edx, %ecx
258 ; X64-NEXT: movl %ecx, %edx
259 ; X64-NEXT: shrl $31, %edx
260 ; X64-NEXT: sarl $2, %ecx
261 ; X64-NEXT: addl %edx, %ecx
262 ; X64-NEXT: movd %ecx, %xmm0
263 ; X64-NEXT: movd %eax, %xmm1
264 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
265 ; X64-NEXT: movq %xmm0, (%rsi)
268 ; X86-LABEL: test_sdiv7_v2i32:
270 ; X86-NEXT: pushl %ebp
271 ; X86-NEXT: pushl %ebx
272 ; X86-NEXT: pushl %edi
273 ; X86-NEXT: pushl %esi
274 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
275 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
276 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
277 ; X86-NEXT: movd %xmm0, %ecx
278 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
279 ; X86-NEXT: movd %xmm0, %esi
280 ; X86-NEXT: movl $-1840700269, %ebp # imm = 0x92492493
281 ; X86-NEXT: movl %esi, %eax
282 ; X86-NEXT: imull %ebp
283 ; X86-NEXT: movl %edx, %edi
284 ; X86-NEXT: addl %esi, %edi
285 ; X86-NEXT: movl %edi, %eax
286 ; X86-NEXT: shrl $31, %eax
287 ; X86-NEXT: sarl $2, %edi
288 ; X86-NEXT: addl %eax, %edi
289 ; X86-NEXT: movl %ecx, %eax
290 ; X86-NEXT: imull %ebp
291 ; X86-NEXT: addl %ecx, %edx
292 ; X86-NEXT: movl %edx, %eax
293 ; X86-NEXT: shrl $31, %eax
294 ; X86-NEXT: sarl $2, %edx
295 ; X86-NEXT: addl %eax, %edx
296 ; X86-NEXT: movd %edx, %xmm0
297 ; X86-NEXT: movd %edi, %xmm1
298 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
299 ; X86-NEXT: movq %xmm0, (%ebx)
300 ; X86-NEXT: popl %esi
301 ; X86-NEXT: popl %edi
302 ; X86-NEXT: popl %ebx
303 ; X86-NEXT: popl %ebp
306 ; X64_WIDEN-LABEL: test_sdiv7_v2i32:
307 ; X64_WIDEN: # %bb.0:
308 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
309 ; X64_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [2454267027,2454267027,2454267027,2454267027]
310 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm2
311 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm2
312 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
313 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
314 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm3
315 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
316 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
317 ; X64_WIDEN-NEXT: pxor %xmm3, %xmm3
318 ; X64_WIDEN-NEXT: pcmpgtd %xmm0, %xmm3
319 ; X64_WIDEN-NEXT: pand %xmm1, %xmm3
320 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm3
321 ; X64_WIDEN-NEXT: psubd %xmm3, %xmm2
322 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm2
323 ; X64_WIDEN-NEXT: movdqa %xmm2, %xmm0
324 ; X64_WIDEN-NEXT: psrld $31, %xmm0
325 ; X64_WIDEN-NEXT: psrad $2, %xmm2
326 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm2
327 ; X64_WIDEN-NEXT: movq %xmm2, (%rsi)
328 ; X64_WIDEN-NEXT: retq
330 ; X86_WIDEN-LABEL: test_sdiv7_v2i32:
331 ; X86_WIDEN: # %bb.0:
332 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
333 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
334 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
335 ; X86_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [2454267027,2454267027,2454267027,2454267027]
336 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm2
337 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm2
338 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
339 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm3
340 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm3 = xmm3[1,1],xmm0[2,3]
341 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm3
342 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
343 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
344 ; X86_WIDEN-NEXT: pxor %xmm3, %xmm3
345 ; X86_WIDEN-NEXT: pcmpgtd %xmm0, %xmm3
346 ; X86_WIDEN-NEXT: pand %xmm1, %xmm3
347 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm3
348 ; X86_WIDEN-NEXT: psubd %xmm3, %xmm2
349 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm2
350 ; X86_WIDEN-NEXT: movdqa %xmm2, %xmm0
351 ; X86_WIDEN-NEXT: psrld $31, %xmm0
352 ; X86_WIDEN-NEXT: psrad $2, %xmm2
353 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm2
354 ; X86_WIDEN-NEXT: movq %xmm2, (%eax)
355 ; X86_WIDEN-NEXT: retl
356 %a = load <2 x i32>, <2 x i32>* %x
357 %b = sdiv <2 x i32> %a, <i32 7, i32 7>
358 store <2 x i32> %b, <2 x i32>* %y
362 define void @test_srem7_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
363 ; X64-LABEL: test_srem7_v2i32:
365 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
366 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,0,1]
367 ; X64-NEXT: movd %xmm1, %eax
368 ; X64-NEXT: movslq %eax, %rcx
369 ; X64-NEXT: imulq $-1840700269, %rcx, %rax # imm = 0x92492493
370 ; X64-NEXT: shrq $32, %rax
371 ; X64-NEXT: addl %ecx, %eax
372 ; X64-NEXT: movl %eax, %edx
373 ; X64-NEXT: shrl $31, %edx
374 ; X64-NEXT: sarl $2, %eax
375 ; X64-NEXT: addl %edx, %eax
376 ; X64-NEXT: leal (,%rax,8), %edx
377 ; X64-NEXT: subl %edx, %eax
378 ; X64-NEXT: addl %ecx, %eax
379 ; X64-NEXT: movd %xmm0, %ecx
380 ; X64-NEXT: movslq %ecx, %rcx
381 ; X64-NEXT: imulq $-1840700269, %rcx, %rdx # imm = 0x92492493
382 ; X64-NEXT: shrq $32, %rdx
383 ; X64-NEXT: addl %ecx, %edx
384 ; X64-NEXT: movl %edx, %edi
385 ; X64-NEXT: shrl $31, %edi
386 ; X64-NEXT: sarl $2, %edx
387 ; X64-NEXT: addl %edi, %edx
388 ; X64-NEXT: leal (,%rdx,8), %edi
389 ; X64-NEXT: subl %edi, %edx
390 ; X64-NEXT: addl %ecx, %edx
391 ; X64-NEXT: movd %edx, %xmm0
392 ; X64-NEXT: movd %eax, %xmm1
393 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
394 ; X64-NEXT: movq %xmm0, (%rsi)
397 ; X86-LABEL: test_srem7_v2i32:
399 ; X86-NEXT: pushl %ebp
400 ; X86-NEXT: pushl %ebx
401 ; X86-NEXT: pushl %edi
402 ; X86-NEXT: pushl %esi
403 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
404 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
405 ; X86-NEXT: movd %xmm0, %ecx
406 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
407 ; X86-NEXT: movd %xmm0, %esi
408 ; X86-NEXT: movl $-1840700269, %ebx # imm = 0x92492493
409 ; X86-NEXT: movl %esi, %eax
410 ; X86-NEXT: imull %ebx
411 ; X86-NEXT: movl %edx, %edi
412 ; X86-NEXT: addl %esi, %edi
413 ; X86-NEXT: movl %edi, %eax
414 ; X86-NEXT: shrl $31, %eax
415 ; X86-NEXT: sarl $2, %edi
416 ; X86-NEXT: addl %eax, %edi
417 ; X86-NEXT: leal (,%edi,8), %eax
418 ; X86-NEXT: subl %eax, %edi
419 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
420 ; X86-NEXT: addl %esi, %edi
421 ; X86-NEXT: movl %ecx, %eax
422 ; X86-NEXT: imull %ebx
423 ; X86-NEXT: addl %ecx, %edx
424 ; X86-NEXT: movl %edx, %eax
425 ; X86-NEXT: shrl $31, %eax
426 ; X86-NEXT: sarl $2, %edx
427 ; X86-NEXT: addl %eax, %edx
428 ; X86-NEXT: leal (,%edx,8), %eax
429 ; X86-NEXT: subl %eax, %edx
430 ; X86-NEXT: addl %ecx, %edx
431 ; X86-NEXT: movd %edx, %xmm0
432 ; X86-NEXT: movd %edi, %xmm1
433 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
434 ; X86-NEXT: movq %xmm0, (%ebp)
435 ; X86-NEXT: popl %esi
436 ; X86-NEXT: popl %edi
437 ; X86-NEXT: popl %ebx
438 ; X86-NEXT: popl %ebp
441 ; X64_WIDEN-LABEL: test_srem7_v2i32:
442 ; X64_WIDEN: # %bb.0:
443 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
444 ; X64_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [2454267027,2454267027,2454267027,2454267027]
445 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm2
446 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm2
447 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
448 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm0[1,1,3,3]
449 ; X64_WIDEN-NEXT: pmuludq %xmm1, %xmm3
450 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
451 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
452 ; X64_WIDEN-NEXT: pxor %xmm3, %xmm3
453 ; X64_WIDEN-NEXT: pcmpgtd %xmm0, %xmm3
454 ; X64_WIDEN-NEXT: pand %xmm1, %xmm3
455 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm3
456 ; X64_WIDEN-NEXT: psubd %xmm3, %xmm2
457 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm2
458 ; X64_WIDEN-NEXT: movdqa %xmm2, %xmm1
459 ; X64_WIDEN-NEXT: psrld $31, %xmm1
460 ; X64_WIDEN-NEXT: psrad $2, %xmm2
461 ; X64_WIDEN-NEXT: paddd %xmm1, %xmm2
462 ; X64_WIDEN-NEXT: movdqa %xmm2, %xmm1
463 ; X64_WIDEN-NEXT: pslld $3, %xmm1
464 ; X64_WIDEN-NEXT: psubd %xmm1, %xmm2
465 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm2
466 ; X64_WIDEN-NEXT: movq %xmm2, (%rsi)
467 ; X64_WIDEN-NEXT: retq
469 ; X86_WIDEN-LABEL: test_srem7_v2i32:
470 ; X86_WIDEN: # %bb.0:
471 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
472 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
473 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
474 ; X86_WIDEN-NEXT: movdqa {{.*#+}} xmm1 = [2454267027,2454267027,2454267027,2454267027]
475 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm2
476 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm2
477 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
478 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm3
479 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm3 = xmm3[1,1],xmm0[2,3]
480 ; X86_WIDEN-NEXT: pmuludq %xmm1, %xmm3
481 ; X86_WIDEN-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
482 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
483 ; X86_WIDEN-NEXT: pxor %xmm3, %xmm3
484 ; X86_WIDEN-NEXT: pcmpgtd %xmm0, %xmm3
485 ; X86_WIDEN-NEXT: pand %xmm1, %xmm3
486 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm3
487 ; X86_WIDEN-NEXT: psubd %xmm3, %xmm2
488 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm2
489 ; X86_WIDEN-NEXT: movdqa %xmm2, %xmm1
490 ; X86_WIDEN-NEXT: psrld $31, %xmm1
491 ; X86_WIDEN-NEXT: psrad $2, %xmm2
492 ; X86_WIDEN-NEXT: paddd %xmm1, %xmm2
493 ; X86_WIDEN-NEXT: movdqa %xmm2, %xmm1
494 ; X86_WIDEN-NEXT: pslld $3, %xmm1
495 ; X86_WIDEN-NEXT: psubd %xmm1, %xmm2
496 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm2
497 ; X86_WIDEN-NEXT: movq %xmm2, (%eax)
498 ; X86_WIDEN-NEXT: retl
499 %a = load <2 x i32>, <2 x i32>* %x
500 %b = srem <2 x i32> %a, <i32 7, i32 7>
501 store <2 x i32> %b, <2 x i32>* %y
505 define void @test_udiv_pow2_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
506 ; X64-LABEL: test_udiv_pow2_v2i32:
508 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
509 ; X64-NEXT: pxor %xmm1, %xmm1
510 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
511 ; X64-NEXT: psrlq $3, %xmm0
512 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
513 ; X64-NEXT: movq %xmm0, (%rsi)
516 ; X86-LABEL: test_udiv_pow2_v2i32:
518 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
519 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
520 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
521 ; X86-NEXT: pxor %xmm1, %xmm1
522 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
523 ; X86-NEXT: psrlq $3, %xmm0
524 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
525 ; X86-NEXT: movq %xmm0, (%eax)
528 ; X64_WIDEN-LABEL: test_udiv_pow2_v2i32:
529 ; X64_WIDEN: # %bb.0:
530 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
531 ; X64_WIDEN-NEXT: psrld $3, %xmm0
532 ; X64_WIDEN-NEXT: movq %xmm0, (%rsi)
533 ; X64_WIDEN-NEXT: retq
535 ; X86_WIDEN-LABEL: test_udiv_pow2_v2i32:
536 ; X86_WIDEN: # %bb.0:
537 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
538 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
539 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
540 ; X86_WIDEN-NEXT: psrld $3, %xmm0
541 ; X86_WIDEN-NEXT: movq %xmm0, (%eax)
542 ; X86_WIDEN-NEXT: retl
543 %a = load <2 x i32>, <2 x i32>* %x
544 %b = udiv <2 x i32> %a, <i32 8, i32 8>
545 store <2 x i32> %b, <2 x i32>* %y
549 define void @test_urem_pow2_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
550 ; X64-LABEL: test_urem_pow2_v2i32:
552 ; X64-NEXT: movl (%rdi), %eax
553 ; X64-NEXT: movl 4(%rdi), %ecx
554 ; X64-NEXT: movq %rcx, %xmm0
555 ; X64-NEXT: movq %rax, %xmm1
556 ; X64-NEXT: punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm0[0]
557 ; X64-NEXT: pand {{.*}}(%rip), %xmm1
558 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
559 ; X64-NEXT: movq %xmm0, (%rsi)
562 ; X86-LABEL: test_urem_pow2_v2i32:
564 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
565 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
566 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
567 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1,1,3]
568 ; X86-NEXT: andps {{\.LCPI.*}}, %xmm0
569 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
570 ; X86-NEXT: movq %xmm0, (%eax)
573 ; X64_WIDEN-LABEL: test_urem_pow2_v2i32:
574 ; X64_WIDEN: # %bb.0:
575 ; X64_WIDEN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
576 ; X64_WIDEN-NEXT: andps {{.*}}(%rip), %xmm0
577 ; X64_WIDEN-NEXT: movlps %xmm0, (%rsi)
578 ; X64_WIDEN-NEXT: retq
580 ; X86_WIDEN-LABEL: test_urem_pow2_v2i32:
581 ; X86_WIDEN: # %bb.0:
582 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
583 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
584 ; X86_WIDEN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
585 ; X86_WIDEN-NEXT: andps {{\.LCPI.*}}, %xmm0
586 ; X86_WIDEN-NEXT: movlps %xmm0, (%eax)
587 ; X86_WIDEN-NEXT: retl
588 %a = load <2 x i32>, <2 x i32>* %x
589 %b = urem <2 x i32> %a, <i32 8, i32 8>
590 store <2 x i32> %b, <2 x i32>* %y
594 define void @test_sdiv_pow2_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
595 ; X64-LABEL: test_sdiv_pow2_v2i32:
597 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
598 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,2,1]
599 ; X64-NEXT: psrad $31, %xmm1
600 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
601 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[0,1,1,3]
602 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
603 ; X64-NEXT: psrlq $31, %xmm0
604 ; X64-NEXT: pand {{.*}}(%rip), %xmm0
605 ; X64-NEXT: psrlq $29, %xmm0
606 ; X64-NEXT: paddq %xmm2, %xmm0
607 ; X64-NEXT: psllq $32, %xmm0
608 ; X64-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,2,3]
609 ; X64-NEXT: psrad $31, %xmm0
610 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3]
611 ; X64-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
612 ; X64-NEXT: psrlq $3, %xmm1
613 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
614 ; X64-NEXT: movq %xmm0, (%rsi)
617 ; X86-LABEL: test_sdiv_pow2_v2i32:
619 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
620 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
621 ; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
622 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
623 ; X86-NEXT: psrad $31, %xmm0
624 ; X86-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,2,3]
625 ; X86-NEXT: movdqa %xmm1, %xmm0
626 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
627 ; X86-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1,1,3]
628 ; X86-NEXT: movdqa {{.*#+}} xmm2 = [31,0,31,0]
629 ; X86-NEXT: movdqa {{.*#+}} xmm3 = [0,2147483648,0,2147483648]
630 ; X86-NEXT: movdqa %xmm3, %xmm4
631 ; X86-NEXT: psrlq %xmm2, %xmm4
632 ; X86-NEXT: movl $31, %ecx
633 ; X86-NEXT: movd %ecx, %xmm5
634 ; X86-NEXT: psrlq %xmm5, %xmm3
635 ; X86-NEXT: movsd {{.*#+}} xmm3 = xmm4[0],xmm3[1]
636 ; X86-NEXT: movdqa %xmm0, %xmm4
637 ; X86-NEXT: psrlq %xmm2, %xmm4
638 ; X86-NEXT: psrlq %xmm5, %xmm0
639 ; X86-NEXT: movsd {{.*#+}} xmm0 = xmm4[0],xmm0[1]
640 ; X86-NEXT: xorpd %xmm3, %xmm0
641 ; X86-NEXT: psubq %xmm3, %xmm0
642 ; X86-NEXT: pand {{\.LCPI.*}}, %xmm0
643 ; X86-NEXT: psrlq $29, %xmm0
644 ; X86-NEXT: paddq %xmm1, %xmm0
645 ; X86-NEXT: psllq $32, %xmm0
646 ; X86-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,3,2,3]
647 ; X86-NEXT: psrad $31, %xmm0
648 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3]
649 ; X86-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
650 ; X86-NEXT: psrlq $3, %xmm1
651 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
652 ; X86-NEXT: movq %xmm0, (%eax)
655 ; X64_WIDEN-LABEL: test_sdiv_pow2_v2i32:
656 ; X64_WIDEN: # %bb.0:
657 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
658 ; X64_WIDEN-NEXT: movdqa %xmm0, %xmm1
659 ; X64_WIDEN-NEXT: psrad $31, %xmm1
660 ; X64_WIDEN-NEXT: psrld $29, %xmm1
661 ; X64_WIDEN-NEXT: paddd %xmm0, %xmm1
662 ; X64_WIDEN-NEXT: psrad $3, %xmm1
663 ; X64_WIDEN-NEXT: movq %xmm1, (%rsi)
664 ; X64_WIDEN-NEXT: retq
666 ; X86_WIDEN-LABEL: test_sdiv_pow2_v2i32:
667 ; X86_WIDEN: # %bb.0:
668 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
669 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
670 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
671 ; X86_WIDEN-NEXT: movdqa %xmm0, %xmm1
672 ; X86_WIDEN-NEXT: psrad $31, %xmm1
673 ; X86_WIDEN-NEXT: psrld $29, %xmm1
674 ; X86_WIDEN-NEXT: paddd %xmm0, %xmm1
675 ; X86_WIDEN-NEXT: psrad $3, %xmm1
676 ; X86_WIDEN-NEXT: movq %xmm1, (%eax)
677 ; X86_WIDEN-NEXT: retl
678 %a = load <2 x i32>, <2 x i32>* %x
679 %b = sdiv <2 x i32> %a, <i32 8, i32 8>
680 store <2 x i32> %b, <2 x i32>* %y
684 define void @test_srem_pow2_v2i32(<2 x i32>* %x, <2 x i32>* %y) nounwind {
685 ; X64-LABEL: test_srem_pow2_v2i32:
687 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
688 ; X64-NEXT: pxor %xmm1, %xmm1
689 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
690 ; X64-NEXT: psrlq $3, %xmm0
691 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
692 ; X64-NEXT: movq %xmm0, (%rsi)
695 ; X86-LABEL: test_srem_pow2_v2i32:
697 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
698 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
699 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
700 ; X86-NEXT: pxor %xmm1, %xmm1
701 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
702 ; X86-NEXT: psrlq $3, %xmm0
703 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,2,2,3]
704 ; X86-NEXT: movq %xmm0, (%eax)
707 ; X64_WIDEN-LABEL: test_srem_pow2_v2i32:
708 ; X64_WIDEN: # %bb.0:
709 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
710 ; X64_WIDEN-NEXT: psrld $3, %xmm0
711 ; X64_WIDEN-NEXT: movq %xmm0, (%rsi)
712 ; X64_WIDEN-NEXT: retq
714 ; X86_WIDEN-LABEL: test_srem_pow2_v2i32:
715 ; X86_WIDEN: # %bb.0:
716 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
717 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
718 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
719 ; X86_WIDEN-NEXT: psrld $3, %xmm0
720 ; X86_WIDEN-NEXT: movq %xmm0, (%eax)
721 ; X86_WIDEN-NEXT: retl
722 %a = load <2 x i32>, <2 x i32>* %x
723 %b = udiv <2 x i32> %a, <i32 8, i32 8>
724 store <2 x i32> %b, <2 x i32>* %y
728 define void @test_udiv_v2i32(<2 x i32>* %x, <2 x i32>* %y, <2 x i32>* %z) nounwind {
729 ; X64-LABEL: test_udiv_v2i32:
731 ; X64-NEXT: movq %rdx, %rcx
732 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
733 ; X64-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
734 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,0,1]
735 ; X64-NEXT: movd %xmm2, %eax
736 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,0,1]
737 ; X64-NEXT: movd %xmm2, %esi
738 ; X64-NEXT: xorl %edx, %edx
739 ; X64-NEXT: divl %esi
740 ; X64-NEXT: movl %eax, %esi
741 ; X64-NEXT: movd %xmm0, %eax
742 ; X64-NEXT: movd %xmm1, %edi
743 ; X64-NEXT: xorl %edx, %edx
744 ; X64-NEXT: divl %edi
745 ; X64-NEXT: movd %eax, %xmm0
746 ; X64-NEXT: movd %esi, %xmm1
747 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
748 ; X64-NEXT: movq %xmm0, (%rcx)
751 ; X86-LABEL: test_udiv_v2i32:
753 ; X86-NEXT: pushl %ebx
754 ; X86-NEXT: pushl %edi
755 ; X86-NEXT: pushl %esi
756 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
757 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
758 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
759 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
760 ; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
761 ; X86-NEXT: movd %xmm0, %ecx
762 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
763 ; X86-NEXT: movd %xmm0, %eax
764 ; X86-NEXT: movd %xmm1, %ebx
765 ; X86-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,0,1]
766 ; X86-NEXT: movd %xmm1, %esi
767 ; X86-NEXT: xorl %edx, %edx
768 ; X86-NEXT: divl %esi
769 ; X86-NEXT: movl %eax, %esi
770 ; X86-NEXT: movl %ecx, %eax
771 ; X86-NEXT: xorl %edx, %edx
772 ; X86-NEXT: divl %ebx
773 ; X86-NEXT: movd %eax, %xmm0
774 ; X86-NEXT: movd %esi, %xmm1
775 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
776 ; X86-NEXT: movq %xmm0, (%edi)
777 ; X86-NEXT: popl %esi
778 ; X86-NEXT: popl %edi
779 ; X86-NEXT: popl %ebx
782 ; X64_WIDEN-LABEL: test_udiv_v2i32:
783 ; X64_WIDEN: # %bb.0:
784 ; X64_WIDEN-NEXT: movq %rdx, %rcx
785 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
786 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
787 ; X64_WIDEN-NEXT: movd %xmm0, %eax
788 ; X64_WIDEN-NEXT: movd %xmm1, %esi
789 ; X64_WIDEN-NEXT: xorl %edx, %edx
790 ; X64_WIDEN-NEXT: divl %esi
791 ; X64_WIDEN-NEXT: movd %eax, %xmm2
792 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
793 ; X64_WIDEN-NEXT: movd %xmm0, %eax
794 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
795 ; X64_WIDEN-NEXT: movd %xmm0, %esi
796 ; X64_WIDEN-NEXT: xorl %edx, %edx
797 ; X64_WIDEN-NEXT: divl %esi
798 ; X64_WIDEN-NEXT: movd %eax, %xmm0
799 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
800 ; X64_WIDEN-NEXT: movq %xmm2, (%rcx)
801 ; X64_WIDEN-NEXT: retq
803 ; X86_WIDEN-LABEL: test_udiv_v2i32:
804 ; X86_WIDEN: # %bb.0:
805 ; X86_WIDEN-NEXT: pushl %esi
806 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
807 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
808 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %edx
809 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
810 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
811 ; X86_WIDEN-NEXT: movd %xmm0, %eax
812 ; X86_WIDEN-NEXT: movd %xmm1, %esi
813 ; X86_WIDEN-NEXT: xorl %edx, %edx
814 ; X86_WIDEN-NEXT: divl %esi
815 ; X86_WIDEN-NEXT: movd %eax, %xmm2
816 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,2,3]
817 ; X86_WIDEN-NEXT: movd %xmm0, %eax
818 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm0[2,3]
819 ; X86_WIDEN-NEXT: movd %xmm1, %esi
820 ; X86_WIDEN-NEXT: xorl %edx, %edx
821 ; X86_WIDEN-NEXT: divl %esi
822 ; X86_WIDEN-NEXT: movd %eax, %xmm0
823 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
824 ; X86_WIDEN-NEXT: movq %xmm2, (%ecx)
825 ; X86_WIDEN-NEXT: popl %esi
826 ; X86_WIDEN-NEXT: retl
827 %a = load <2 x i32>, <2 x i32>* %x
828 %b = load <2 x i32>, <2 x i32>* %y
829 %c = udiv <2 x i32> %a, %b
830 store <2 x i32> %c, <2 x i32>* %z
834 define void @test_urem_v2i32(<2 x i32>* %x, <2 x i32>* %y, <2 x i32>* %z) nounwind {
835 ; X64-LABEL: test_urem_v2i32:
837 ; X64-NEXT: movq %rdx, %rcx
838 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
839 ; X64-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
840 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,0,1]
841 ; X64-NEXT: movd %xmm2, %eax
842 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,0,1]
843 ; X64-NEXT: movd %xmm2, %esi
844 ; X64-NEXT: xorl %edx, %edx
845 ; X64-NEXT: divl %esi
846 ; X64-NEXT: movl %edx, %esi
847 ; X64-NEXT: movd %xmm0, %eax
848 ; X64-NEXT: movd %xmm1, %edi
849 ; X64-NEXT: xorl %edx, %edx
850 ; X64-NEXT: divl %edi
851 ; X64-NEXT: movd %edx, %xmm0
852 ; X64-NEXT: movd %esi, %xmm1
853 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
854 ; X64-NEXT: movq %xmm0, (%rcx)
857 ; X86-LABEL: test_urem_v2i32:
859 ; X86-NEXT: pushl %ebx
860 ; X86-NEXT: pushl %edi
861 ; X86-NEXT: pushl %esi
862 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
863 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
864 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
865 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
866 ; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
867 ; X86-NEXT: movd %xmm0, %ecx
868 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
869 ; X86-NEXT: movd %xmm0, %eax
870 ; X86-NEXT: movd %xmm1, %ebx
871 ; X86-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,0,1]
872 ; X86-NEXT: movd %xmm1, %esi
873 ; X86-NEXT: xorl %edx, %edx
874 ; X86-NEXT: divl %esi
875 ; X86-NEXT: movl %edx, %esi
876 ; X86-NEXT: movl %ecx, %eax
877 ; X86-NEXT: xorl %edx, %edx
878 ; X86-NEXT: divl %ebx
879 ; X86-NEXT: movd %edx, %xmm0
880 ; X86-NEXT: movd %esi, %xmm1
881 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
882 ; X86-NEXT: movq %xmm0, (%edi)
883 ; X86-NEXT: popl %esi
884 ; X86-NEXT: popl %edi
885 ; X86-NEXT: popl %ebx
888 ; X64_WIDEN-LABEL: test_urem_v2i32:
889 ; X64_WIDEN: # %bb.0:
890 ; X64_WIDEN-NEXT: movq %rdx, %rcx
891 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
892 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
893 ; X64_WIDEN-NEXT: movd %xmm0, %eax
894 ; X64_WIDEN-NEXT: movd %xmm1, %esi
895 ; X64_WIDEN-NEXT: xorl %edx, %edx
896 ; X64_WIDEN-NEXT: divl %esi
897 ; X64_WIDEN-NEXT: movd %edx, %xmm2
898 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
899 ; X64_WIDEN-NEXT: movd %xmm0, %eax
900 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
901 ; X64_WIDEN-NEXT: movd %xmm0, %esi
902 ; X64_WIDEN-NEXT: xorl %edx, %edx
903 ; X64_WIDEN-NEXT: divl %esi
904 ; X64_WIDEN-NEXT: movd %edx, %xmm0
905 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
906 ; X64_WIDEN-NEXT: movq %xmm2, (%rcx)
907 ; X64_WIDEN-NEXT: retq
909 ; X86_WIDEN-LABEL: test_urem_v2i32:
910 ; X86_WIDEN: # %bb.0:
911 ; X86_WIDEN-NEXT: pushl %esi
912 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
913 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
914 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %edx
915 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
916 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
917 ; X86_WIDEN-NEXT: movd %xmm0, %eax
918 ; X86_WIDEN-NEXT: movd %xmm1, %esi
919 ; X86_WIDEN-NEXT: xorl %edx, %edx
920 ; X86_WIDEN-NEXT: divl %esi
921 ; X86_WIDEN-NEXT: movd %edx, %xmm2
922 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,2,3]
923 ; X86_WIDEN-NEXT: movd %xmm0, %eax
924 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm0[2,3]
925 ; X86_WIDEN-NEXT: movd %xmm1, %esi
926 ; X86_WIDEN-NEXT: xorl %edx, %edx
927 ; X86_WIDEN-NEXT: divl %esi
928 ; X86_WIDEN-NEXT: movd %edx, %xmm0
929 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
930 ; X86_WIDEN-NEXT: movq %xmm2, (%ecx)
931 ; X86_WIDEN-NEXT: popl %esi
932 ; X86_WIDEN-NEXT: retl
933 %a = load <2 x i32>, <2 x i32>* %x
934 %b = load <2 x i32>, <2 x i32>* %y
935 %c = urem <2 x i32> %a, %b
936 store <2 x i32> %c, <2 x i32>* %z
940 define void @test_sdiv_v2i32(<2 x i32>* %x, <2 x i32>* %y, <2 x i32>* %z) nounwind {
941 ; X64-LABEL: test_sdiv_v2i32:
943 ; X64-NEXT: movq %rdx, %rcx
944 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
945 ; X64-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
946 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,0,1]
947 ; X64-NEXT: movd %xmm2, %eax
948 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,0,1]
949 ; X64-NEXT: movd %xmm2, %esi
951 ; X64-NEXT: idivl %esi
952 ; X64-NEXT: movl %eax, %esi
953 ; X64-NEXT: movd %xmm0, %eax
954 ; X64-NEXT: movd %xmm1, %edi
956 ; X64-NEXT: idivl %edi
957 ; X64-NEXT: movd %eax, %xmm0
958 ; X64-NEXT: movd %esi, %xmm1
959 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
960 ; X64-NEXT: movq %xmm0, (%rcx)
963 ; X86-LABEL: test_sdiv_v2i32:
965 ; X86-NEXT: pushl %ebx
966 ; X86-NEXT: pushl %edi
967 ; X86-NEXT: pushl %esi
968 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
969 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
970 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
971 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
972 ; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
973 ; X86-NEXT: movd %xmm0, %ecx
974 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
975 ; X86-NEXT: movd %xmm0, %eax
976 ; X86-NEXT: movd %xmm1, %ebx
977 ; X86-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,0,1]
978 ; X86-NEXT: movd %xmm1, %esi
980 ; X86-NEXT: idivl %esi
981 ; X86-NEXT: movl %eax, %esi
982 ; X86-NEXT: movl %ecx, %eax
984 ; X86-NEXT: idivl %ebx
985 ; X86-NEXT: movd %eax, %xmm0
986 ; X86-NEXT: movd %esi, %xmm1
987 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
988 ; X86-NEXT: movq %xmm0, (%edi)
989 ; X86-NEXT: popl %esi
990 ; X86-NEXT: popl %edi
991 ; X86-NEXT: popl %ebx
994 ; X64_WIDEN-LABEL: test_sdiv_v2i32:
995 ; X64_WIDEN: # %bb.0:
996 ; X64_WIDEN-NEXT: movq %rdx, %rcx
997 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
998 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
999 ; X64_WIDEN-NEXT: movd %xmm0, %eax
1000 ; X64_WIDEN-NEXT: movd %xmm1, %esi
1001 ; X64_WIDEN-NEXT: cltd
1002 ; X64_WIDEN-NEXT: idivl %esi
1003 ; X64_WIDEN-NEXT: movd %eax, %xmm2
1004 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
1005 ; X64_WIDEN-NEXT: movd %xmm0, %eax
1006 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
1007 ; X64_WIDEN-NEXT: movd %xmm0, %esi
1008 ; X64_WIDEN-NEXT: cltd
1009 ; X64_WIDEN-NEXT: idivl %esi
1010 ; X64_WIDEN-NEXT: movd %eax, %xmm0
1011 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
1012 ; X64_WIDEN-NEXT: movq %xmm2, (%rcx)
1013 ; X64_WIDEN-NEXT: retq
1015 ; X86_WIDEN-LABEL: test_sdiv_v2i32:
1016 ; X86_WIDEN: # %bb.0:
1017 ; X86_WIDEN-NEXT: pushl %ebx
1018 ; X86_WIDEN-NEXT: pushl %edi
1019 ; X86_WIDEN-NEXT: pushl %esi
1020 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %esi
1021 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
1022 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
1023 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
1024 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
1025 ; X86_WIDEN-NEXT: movd %xmm0, %ecx
1026 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,2,3]
1027 ; X86_WIDEN-NEXT: movd %xmm0, %eax
1028 ; X86_WIDEN-NEXT: movd %xmm1, %edi
1029 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm0[2,3]
1030 ; X86_WIDEN-NEXT: movd %xmm1, %ebx
1031 ; X86_WIDEN-NEXT: cltd
1032 ; X86_WIDEN-NEXT: idivl %ebx
1033 ; X86_WIDEN-NEXT: movd %eax, %xmm0
1034 ; X86_WIDEN-NEXT: movl %ecx, %eax
1035 ; X86_WIDEN-NEXT: cltd
1036 ; X86_WIDEN-NEXT: idivl %edi
1037 ; X86_WIDEN-NEXT: movd %eax, %xmm1
1038 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1039 ; X86_WIDEN-NEXT: movq %xmm1, (%esi)
1040 ; X86_WIDEN-NEXT: popl %esi
1041 ; X86_WIDEN-NEXT: popl %edi
1042 ; X86_WIDEN-NEXT: popl %ebx
1043 ; X86_WIDEN-NEXT: retl
1044 %a = load <2 x i32>, <2 x i32>* %x
1045 %b = load <2 x i32>, <2 x i32>* %y
1046 %c = sdiv <2 x i32> %a, %b
1047 store <2 x i32> %c, <2 x i32>* %z
1051 define void @test_srem_v2i32(<2 x i32>* %x, <2 x i32>* %y, <2 x i32>* %z) nounwind {
1052 ; X64-LABEL: test_srem_v2i32:
1054 ; X64-NEXT: movq %rdx, %rcx
1055 ; X64-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
1056 ; X64-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
1057 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,3,0,1]
1058 ; X64-NEXT: movd %xmm2, %eax
1059 ; X64-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,3,0,1]
1060 ; X64-NEXT: movd %xmm2, %esi
1062 ; X64-NEXT: idivl %esi
1063 ; X64-NEXT: movl %eax, %esi
1064 ; X64-NEXT: movd %xmm0, %eax
1065 ; X64-NEXT: movd %xmm1, %edi
1067 ; X64-NEXT: idivl %edi
1068 ; X64-NEXT: movd %eax, %xmm0
1069 ; X64-NEXT: movd %esi, %xmm1
1070 ; X64-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1071 ; X64-NEXT: movq %xmm0, (%rcx)
1074 ; X86-LABEL: test_srem_v2i32:
1076 ; X86-NEXT: pushl %ebx
1077 ; X86-NEXT: pushl %edi
1078 ; X86-NEXT: pushl %esi
1079 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
1080 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
1081 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
1082 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
1083 ; X86-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
1084 ; X86-NEXT: movd %xmm0, %ecx
1085 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,0,1]
1086 ; X86-NEXT: movd %xmm0, %eax
1087 ; X86-NEXT: movd %xmm1, %ebx
1088 ; X86-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,0,1]
1089 ; X86-NEXT: movd %xmm1, %esi
1091 ; X86-NEXT: idivl %esi
1092 ; X86-NEXT: movl %eax, %esi
1093 ; X86-NEXT: movl %ecx, %eax
1095 ; X86-NEXT: idivl %ebx
1096 ; X86-NEXT: movd %eax, %xmm0
1097 ; X86-NEXT: movd %esi, %xmm1
1098 ; X86-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1099 ; X86-NEXT: movq %xmm0, (%edi)
1100 ; X86-NEXT: popl %esi
1101 ; X86-NEXT: popl %edi
1102 ; X86-NEXT: popl %ebx
1105 ; X64_WIDEN-LABEL: test_srem_v2i32:
1106 ; X64_WIDEN: # %bb.0:
1107 ; X64_WIDEN-NEXT: movq %rdx, %rcx
1108 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
1109 ; X64_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
1110 ; X64_WIDEN-NEXT: movd %xmm0, %eax
1111 ; X64_WIDEN-NEXT: movd %xmm1, %esi
1112 ; X64_WIDEN-NEXT: cltd
1113 ; X64_WIDEN-NEXT: idivl %esi
1114 ; X64_WIDEN-NEXT: movd %eax, %xmm2
1115 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
1116 ; X64_WIDEN-NEXT: movd %xmm0, %eax
1117 ; X64_WIDEN-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,2,3]
1118 ; X64_WIDEN-NEXT: movd %xmm0, %esi
1119 ; X64_WIDEN-NEXT: cltd
1120 ; X64_WIDEN-NEXT: idivl %esi
1121 ; X64_WIDEN-NEXT: movd %eax, %xmm0
1122 ; X64_WIDEN-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
1123 ; X64_WIDEN-NEXT: movq %xmm2, (%rcx)
1124 ; X64_WIDEN-NEXT: retq
1126 ; X86_WIDEN-LABEL: test_srem_v2i32:
1127 ; X86_WIDEN: # %bb.0:
1128 ; X86_WIDEN-NEXT: pushl %ebx
1129 ; X86_WIDEN-NEXT: pushl %edi
1130 ; X86_WIDEN-NEXT: pushl %esi
1131 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %esi
1132 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %eax
1133 ; X86_WIDEN-NEXT: movl {{[0-9]+}}(%esp), %ecx
1134 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
1135 ; X86_WIDEN-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
1136 ; X86_WIDEN-NEXT: movd %xmm0, %ecx
1137 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1,2,3]
1138 ; X86_WIDEN-NEXT: movd %xmm0, %eax
1139 ; X86_WIDEN-NEXT: movd %xmm1, %edi
1140 ; X86_WIDEN-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm0[2,3]
1141 ; X86_WIDEN-NEXT: movd %xmm1, %ebx
1142 ; X86_WIDEN-NEXT: cltd
1143 ; X86_WIDEN-NEXT: idivl %ebx
1144 ; X86_WIDEN-NEXT: movd %eax, %xmm0
1145 ; X86_WIDEN-NEXT: movl %ecx, %eax
1146 ; X86_WIDEN-NEXT: cltd
1147 ; X86_WIDEN-NEXT: idivl %edi
1148 ; X86_WIDEN-NEXT: movd %eax, %xmm1
1149 ; X86_WIDEN-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1150 ; X86_WIDEN-NEXT: movq %xmm1, (%esi)
1151 ; X86_WIDEN-NEXT: popl %esi
1152 ; X86_WIDEN-NEXT: popl %edi
1153 ; X86_WIDEN-NEXT: popl %ebx
1154 ; X86_WIDEN-NEXT: retl
1155 %a = load <2 x i32>, <2 x i32>* %x
1156 %b = load <2 x i32>, <2 x i32>* %y
1157 %c = sdiv <2 x i32> %a, %b
1158 store <2 x i32> %c, <2 x i32>* %z