1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefixes=X64,SSE
3 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=avx | FileCheck %s --check-prefixes=X64,AVX,AVX1
4 ; RUN: llc < %s -mtriple=x86_64-linux -mattr=avx2 | FileCheck %s --check-prefixes=X64,AVX,AVX2
5 ; RUN: llc < %s -mtriple=i686 -mattr=cmov | FileCheck %s --check-prefix=X86
7 declare i8 @llvm.umax.i8(i8, i8)
8 declare i16 @llvm.umax.i16(i16, i16)
9 declare i24 @llvm.umax.i24(i24, i24)
10 declare i32 @llvm.umax.i32(i32, i32)
11 declare i64 @llvm.umax.i64(i64, i64)
12 declare i128 @llvm.umax.i128(i128, i128)
14 declare <1 x i32> @llvm.umax.v1i32(<1 x i32>, <1 x i32>)
15 declare <2 x i32> @llvm.umax.v2i32(<2 x i32>, <2 x i32>)
16 declare <3 x i32> @llvm.umax.v3i32(<3 x i32>, <3 x i32>)
17 declare <4 x i32> @llvm.umax.v4i32(<4 x i32>, <4 x i32>)
18 declare <8 x i32> @llvm.umax.v8i32(<8 x i32>, <8 x i32>)
20 declare <8 x i16> @llvm.umax.v8i16(<8 x i16>, <8 x i16>)
21 declare <16 x i8> @llvm.umax.v16i8(<16 x i8>, <16 x i8>)
23 define i8 @test_i8(i8 %a, i8 %b) nounwind {
26 ; X64-NEXT: movl %esi, %eax
27 ; X64-NEXT: cmpb %al, %dil
28 ; X64-NEXT: cmoval %edi, %eax
29 ; X64-NEXT: # kill: def $al killed $al killed $eax
34 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
35 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
36 ; X86-NEXT: cmpb %al, %cl
37 ; X86-NEXT: cmoval %ecx, %eax
38 ; X86-NEXT: # kill: def $al killed $al killed $eax
40 %r = call i8 @llvm.umax.i8(i8 %a, i8 %b)
44 define i16 @test_i16(i16 %a, i16 %b) nounwind {
45 ; X64-LABEL: test_i16:
47 ; X64-NEXT: movl %esi, %eax
48 ; X64-NEXT: cmpw %ax, %di
49 ; X64-NEXT: cmoval %edi, %eax
50 ; X64-NEXT: # kill: def $ax killed $ax killed $eax
53 ; X86-LABEL: test_i16:
55 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
56 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
57 ; X86-NEXT: cmpw %ax, %cx
58 ; X86-NEXT: cmoval %ecx, %eax
59 ; X86-NEXT: # kill: def $ax killed $ax killed $eax
61 %r = call i16 @llvm.umax.i16(i16 %a, i16 %b)
65 define i24 @test_i24(i24 %a, i24 %b) nounwind {
66 ; X64-LABEL: test_i24:
68 ; X64-NEXT: movl %edi, %eax
69 ; X64-NEXT: andl $16777215, %esi # imm = 0xFFFFFF
70 ; X64-NEXT: andl $16777215, %eax # imm = 0xFFFFFF
71 ; X64-NEXT: cmpl %esi, %eax
72 ; X64-NEXT: cmovbel %esi, %eax
75 ; X86-LABEL: test_i24:
77 ; X86-NEXT: movl $16777215, %eax # imm = 0xFFFFFF
78 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
79 ; X86-NEXT: andl %eax, %ecx
80 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
81 ; X86-NEXT: cmpl %ecx, %eax
82 ; X86-NEXT: cmovbel %ecx, %eax
84 %r = call i24 @llvm.umax.i24(i24 %a, i24 %b)
88 define i32 @test_i32(i32 %a, i32 %b) nounwind {
89 ; X64-LABEL: test_i32:
91 ; X64-NEXT: movl %esi, %eax
92 ; X64-NEXT: cmpl %esi, %edi
93 ; X64-NEXT: cmoval %edi, %eax
96 ; X86-LABEL: test_i32:
98 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
99 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
100 ; X86-NEXT: cmpl %eax, %ecx
101 ; X86-NEXT: cmoval %ecx, %eax
103 %r = call i32 @llvm.umax.i32(i32 %a, i32 %b)
107 define i64 @test_i64(i64 %a, i64 %b) nounwind {
108 ; X64-LABEL: test_i64:
110 ; X64-NEXT: movq %rsi, %rax
111 ; X64-NEXT: cmpq %rsi, %rdi
112 ; X64-NEXT: cmovaq %rdi, %rax
115 ; X86-LABEL: test_i64:
117 ; X86-NEXT: pushl %edi
118 ; X86-NEXT: pushl %esi
119 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
120 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
121 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
122 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
123 ; X86-NEXT: cmpl %eax, %ecx
124 ; X86-NEXT: movl %eax, %edi
125 ; X86-NEXT: cmoval %ecx, %edi
126 ; X86-NEXT: cmpl %edx, %esi
127 ; X86-NEXT: cmoval %ecx, %eax
128 ; X86-NEXT: cmovel %edi, %eax
129 ; X86-NEXT: cmoval %esi, %edx
130 ; X86-NEXT: popl %esi
131 ; X86-NEXT: popl %edi
133 %r = call i64 @llvm.umax.i64(i64 %a, i64 %b)
137 define i128 @test_i128(i128 %a, i128 %b) nounwind {
138 ; X64-LABEL: test_i128:
140 ; X64-NEXT: cmpq %rdx, %rdi
141 ; X64-NEXT: movq %rdx, %rax
142 ; X64-NEXT: cmovaq %rdi, %rax
143 ; X64-NEXT: cmpq %rcx, %rsi
144 ; X64-NEXT: cmovaq %rdi, %rdx
145 ; X64-NEXT: cmovneq %rdx, %rax
146 ; X64-NEXT: cmovaq %rsi, %rcx
147 ; X64-NEXT: movq %rcx, %rdx
150 ; X86-LABEL: test_i128:
152 ; X86-NEXT: pushl %ebp
153 ; X86-NEXT: pushl %ebx
154 ; X86-NEXT: pushl %edi
155 ; X86-NEXT: pushl %esi
156 ; X86-NEXT: pushl %eax
157 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
158 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
159 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
160 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
161 ; X86-NEXT: cmpl %ecx, %esi
162 ; X86-NEXT: movl %ecx, %eax
163 ; X86-NEXT: cmoval %esi, %eax
164 ; X86-NEXT: cmpl %edx, %edi
165 ; X86-NEXT: movl %ecx, %ebp
166 ; X86-NEXT: cmoval %esi, %ebp
167 ; X86-NEXT: cmovel %eax, %ebp
168 ; X86-NEXT: movl %edx, %eax
169 ; X86-NEXT: cmoval %edi, %eax
170 ; X86-NEXT: movl %eax, (%esp) # 4-byte Spill
171 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
172 ; X86-NEXT: cmpl {{[0-9]+}}(%esp), %esi
173 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
174 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
175 ; X86-NEXT: movl %eax, %edi
176 ; X86-NEXT: sbbl %ebx, %edi
177 ; X86-NEXT: cmovbl {{[0-9]+}}(%esp), %edx
178 ; X86-NEXT: cmovbl {{[0-9]+}}(%esp), %ecx
179 ; X86-NEXT: movl %ebx, %edi
180 ; X86-NEXT: xorl %eax, %edi
181 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
182 ; X86-NEXT: xorl %esi, %ebx
183 ; X86-NEXT: orl %edi, %ebx
184 ; X86-NEXT: cmovel %ebp, %ecx
185 ; X86-NEXT: cmovel (%esp), %edx # 4-byte Folded Reload
186 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
187 ; X86-NEXT: cmpl %esi, %ebx
188 ; X86-NEXT: movl %esi, %edi
189 ; X86-NEXT: cmoval %ebx, %edi
190 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
191 ; X86-NEXT: cmpl %eax, %ebp
192 ; X86-NEXT: cmoval %ebx, %esi
193 ; X86-NEXT: cmovel %edi, %esi
194 ; X86-NEXT: cmoval %ebp, %eax
195 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
196 ; X86-NEXT: movl %eax, 12(%edi)
197 ; X86-NEXT: movl %esi, 8(%edi)
198 ; X86-NEXT: movl %edx, 4(%edi)
199 ; X86-NEXT: movl %ecx, (%edi)
200 ; X86-NEXT: movl %edi, %eax
201 ; X86-NEXT: addl $4, %esp
202 ; X86-NEXT: popl %esi
203 ; X86-NEXT: popl %edi
204 ; X86-NEXT: popl %ebx
205 ; X86-NEXT: popl %ebp
207 %r = call i128 @llvm.umax.i128(i128 %a, i128 %b)
211 define <1 x i32> @test_v1i32(<1 x i32> %a, <1 x i32> %b) nounwind {
212 ; X64-LABEL: test_v1i32:
214 ; X64-NEXT: movl %esi, %eax
215 ; X64-NEXT: cmpl %esi, %edi
216 ; X64-NEXT: cmoval %edi, %eax
219 ; X86-LABEL: test_v1i32:
221 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
222 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
223 ; X86-NEXT: cmpl %eax, %ecx
224 ; X86-NEXT: cmoval %ecx, %eax
226 %r = call <1 x i32> @llvm.umax.v1i32(<1 x i32> %a, <1 x i32> %b)
230 define <2 x i32> @test_v2i32(<2 x i32> %a, <2 x i32> %b) nounwind {
231 ; SSE-LABEL: test_v2i32:
233 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
234 ; SSE-NEXT: movdqa %xmm1, %xmm3
235 ; SSE-NEXT: pxor %xmm2, %xmm3
236 ; SSE-NEXT: pxor %xmm0, %xmm2
237 ; SSE-NEXT: pcmpgtd %xmm3, %xmm2
238 ; SSE-NEXT: pand %xmm2, %xmm0
239 ; SSE-NEXT: pandn %xmm1, %xmm2
240 ; SSE-NEXT: por %xmm2, %xmm0
243 ; AVX-LABEL: test_v2i32:
245 ; AVX-NEXT: vpmaxud %xmm1, %xmm0, %xmm0
248 ; X86-LABEL: test_v2i32:
250 ; X86-NEXT: pushl %esi
251 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
252 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
253 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
254 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
255 ; X86-NEXT: cmpl %eax, %esi
256 ; X86-NEXT: cmoval %esi, %eax
257 ; X86-NEXT: cmpl %edx, %ecx
258 ; X86-NEXT: cmoval %ecx, %edx
259 ; X86-NEXT: popl %esi
261 %r = call <2 x i32> @llvm.umax.v2i32(<2 x i32> %a, <2 x i32> %b)
265 define <3 x i32> @test_v3i32(<3 x i32> %a, <3 x i32> %b) nounwind {
266 ; SSE-LABEL: test_v3i32:
268 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
269 ; SSE-NEXT: movdqa %xmm1, %xmm3
270 ; SSE-NEXT: pxor %xmm2, %xmm3
271 ; SSE-NEXT: pxor %xmm0, %xmm2
272 ; SSE-NEXT: pcmpgtd %xmm3, %xmm2
273 ; SSE-NEXT: pand %xmm2, %xmm0
274 ; SSE-NEXT: pandn %xmm1, %xmm2
275 ; SSE-NEXT: por %xmm2, %xmm0
278 ; AVX-LABEL: test_v3i32:
280 ; AVX-NEXT: vpmaxud %xmm1, %xmm0, %xmm0
283 ; X86-LABEL: test_v3i32:
285 ; X86-NEXT: pushl %ebx
286 ; X86-NEXT: pushl %edi
287 ; X86-NEXT: pushl %esi
288 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
289 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
290 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
291 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
292 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
293 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
294 ; X86-NEXT: cmpl %eax, %ebx
295 ; X86-NEXT: cmoval %ebx, %eax
296 ; X86-NEXT: cmpl %edx, %edi
297 ; X86-NEXT: cmoval %edi, %edx
298 ; X86-NEXT: cmpl %ecx, %esi
299 ; X86-NEXT: cmoval %esi, %ecx
300 ; X86-NEXT: popl %esi
301 ; X86-NEXT: popl %edi
302 ; X86-NEXT: popl %ebx
304 %r = call <3 x i32> @llvm.umax.v3i32(<3 x i32> %a, <3 x i32> %b)
308 define <4 x i32> @test_v4i32(<4 x i32> %a, <4 x i32> %b) nounwind {
309 ; SSE-LABEL: test_v4i32:
311 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648,2147483648,2147483648]
312 ; SSE-NEXT: movdqa %xmm1, %xmm3
313 ; SSE-NEXT: pxor %xmm2, %xmm3
314 ; SSE-NEXT: pxor %xmm0, %xmm2
315 ; SSE-NEXT: pcmpgtd %xmm3, %xmm2
316 ; SSE-NEXT: pand %xmm2, %xmm0
317 ; SSE-NEXT: pandn %xmm1, %xmm2
318 ; SSE-NEXT: por %xmm2, %xmm0
321 ; AVX-LABEL: test_v4i32:
323 ; AVX-NEXT: vpmaxud %xmm1, %xmm0, %xmm0
326 ; X86-LABEL: test_v4i32:
328 ; X86-NEXT: pushl %edi
329 ; X86-NEXT: pushl %esi
330 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
331 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
332 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
333 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
334 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
335 ; X86-NEXT: cmpl %edi, %eax
336 ; X86-NEXT: cmoval %eax, %edi
337 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
338 ; X86-NEXT: cmpl %esi, %eax
339 ; X86-NEXT: cmoval %eax, %esi
340 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
341 ; X86-NEXT: cmpl %edx, %eax
342 ; X86-NEXT: cmoval %eax, %edx
343 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
344 ; X86-NEXT: cmpl %ecx, %eax
345 ; X86-NEXT: cmoval %eax, %ecx
346 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
347 ; X86-NEXT: movl %ecx, 12(%eax)
348 ; X86-NEXT: movl %edx, 8(%eax)
349 ; X86-NEXT: movl %esi, 4(%eax)
350 ; X86-NEXT: movl %edi, (%eax)
351 ; X86-NEXT: popl %esi
352 ; X86-NEXT: popl %edi
354 %r = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %a, <4 x i32> %b)
358 define <8 x i32> @test_v8i32(<8 x i32> %a, <8 x i32> %b) nounwind {
359 ; SSE-LABEL: test_v8i32:
361 ; SSE-NEXT: movdqa {{.*#+}} xmm4 = [2147483648,2147483648,2147483648,2147483648]
362 ; SSE-NEXT: movdqa %xmm2, %xmm5
363 ; SSE-NEXT: pxor %xmm4, %xmm5
364 ; SSE-NEXT: movdqa %xmm0, %xmm6
365 ; SSE-NEXT: pxor %xmm4, %xmm6
366 ; SSE-NEXT: pcmpgtd %xmm5, %xmm6
367 ; SSE-NEXT: pand %xmm6, %xmm0
368 ; SSE-NEXT: pandn %xmm2, %xmm6
369 ; SSE-NEXT: por %xmm6, %xmm0
370 ; SSE-NEXT: movdqa %xmm3, %xmm2
371 ; SSE-NEXT: pxor %xmm4, %xmm2
372 ; SSE-NEXT: pxor %xmm1, %xmm4
373 ; SSE-NEXT: pcmpgtd %xmm2, %xmm4
374 ; SSE-NEXT: pand %xmm4, %xmm1
375 ; SSE-NEXT: pandn %xmm3, %xmm4
376 ; SSE-NEXT: por %xmm4, %xmm1
379 ; AVX1-LABEL: test_v8i32:
381 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
382 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
383 ; AVX1-NEXT: vpmaxud %xmm2, %xmm3, %xmm2
384 ; AVX1-NEXT: vpmaxud %xmm1, %xmm0, %xmm0
385 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
388 ; AVX2-LABEL: test_v8i32:
390 ; AVX2-NEXT: vpmaxud %ymm1, %ymm0, %ymm0
393 ; X86-LABEL: test_v8i32:
395 ; X86-NEXT: pushl %ebp
396 ; X86-NEXT: pushl %ebx
397 ; X86-NEXT: pushl %edi
398 ; X86-NEXT: pushl %esi
399 ; X86-NEXT: subl $8, %esp
400 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
401 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
402 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
403 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
404 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
405 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
406 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
407 ; X86-NEXT: cmpl %ebp, %eax
408 ; X86-NEXT: cmoval %eax, %ebp
409 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
410 ; X86-NEXT: cmpl %ebx, %eax
411 ; X86-NEXT: cmoval %eax, %ebx
412 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
413 ; X86-NEXT: cmpl %edi, %eax
414 ; X86-NEXT: cmoval %eax, %edi
415 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
416 ; X86-NEXT: cmpl %esi, %eax
417 ; X86-NEXT: cmoval %eax, %esi
418 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
419 ; X86-NEXT: cmpl %edx, %eax
420 ; X86-NEXT: cmoval %eax, %edx
421 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
422 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
423 ; X86-NEXT: cmpl %ecx, %eax
424 ; X86-NEXT: cmoval %eax, %ecx
425 ; X86-NEXT: movl %ecx, (%esp) # 4-byte Spill
426 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
427 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
428 ; X86-NEXT: cmpl %ecx, %eax
429 ; X86-NEXT: cmoval %eax, %ecx
430 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
431 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
432 ; X86-NEXT: cmpl %eax, %edx
433 ; X86-NEXT: cmoval %edx, %eax
434 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
435 ; X86-NEXT: movl %eax, 28(%edx)
436 ; X86-NEXT: movl %ecx, 24(%edx)
437 ; X86-NEXT: movl (%esp), %eax # 4-byte Reload
438 ; X86-NEXT: movl %eax, 20(%edx)
439 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
440 ; X86-NEXT: movl %eax, 16(%edx)
441 ; X86-NEXT: movl %esi, 12(%edx)
442 ; X86-NEXT: movl %edi, 8(%edx)
443 ; X86-NEXT: movl %ebx, 4(%edx)
444 ; X86-NEXT: movl %ebp, (%edx)
445 ; X86-NEXT: movl %edx, %eax
446 ; X86-NEXT: addl $8, %esp
447 ; X86-NEXT: popl %esi
448 ; X86-NEXT: popl %edi
449 ; X86-NEXT: popl %ebx
450 ; X86-NEXT: popl %ebp
452 %r = call <8 x i32> @llvm.umax.v8i32(<8 x i32> %a, <8 x i32> %b)
456 define <8 x i16> @test_v8i16(<8 x i16> %a, <8 x i16> %b) nounwind {
457 ; SSE-LABEL: test_v8i16:
459 ; SSE-NEXT: psubusw %xmm0, %xmm1
460 ; SSE-NEXT: paddw %xmm1, %xmm0
463 ; AVX-LABEL: test_v8i16:
465 ; AVX-NEXT: vpmaxuw %xmm1, %xmm0, %xmm0
468 ; X86-LABEL: test_v8i16:
470 ; X86-NEXT: pushl %ebp
471 ; X86-NEXT: pushl %ebx
472 ; X86-NEXT: pushl %edi
473 ; X86-NEXT: pushl %esi
474 ; X86-NEXT: subl $8, %esp
475 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
476 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
477 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
478 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edi
479 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
480 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebp
481 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
482 ; X86-NEXT: cmpw %bp, %ax
483 ; X86-NEXT: cmoval %eax, %ebp
484 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
485 ; X86-NEXT: cmpw %bx, %ax
486 ; X86-NEXT: cmoval %eax, %ebx
487 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
488 ; X86-NEXT: cmpw %di, %ax
489 ; X86-NEXT: cmoval %eax, %edi
490 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
491 ; X86-NEXT: cmpw %si, %ax
492 ; X86-NEXT: cmoval %eax, %esi
493 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
494 ; X86-NEXT: cmpw %dx, %ax
495 ; X86-NEXT: cmoval %eax, %edx
496 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
497 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
498 ; X86-NEXT: cmpw %cx, %ax
499 ; X86-NEXT: cmoval %eax, %ecx
500 ; X86-NEXT: movl %ecx, (%esp) # 4-byte Spill
501 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
502 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
503 ; X86-NEXT: cmpw %dx, %ax
504 ; X86-NEXT: cmoval %eax, %edx
505 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
506 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
507 ; X86-NEXT: cmpw %ax, %cx
508 ; X86-NEXT: cmoval %ecx, %eax
509 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
510 ; X86-NEXT: movw %ax, 14(%ecx)
511 ; X86-NEXT: movw %dx, 12(%ecx)
512 ; X86-NEXT: movl (%esp), %eax # 4-byte Reload
513 ; X86-NEXT: movw %ax, 10(%ecx)
514 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
515 ; X86-NEXT: movw %ax, 8(%ecx)
516 ; X86-NEXT: movw %si, 6(%ecx)
517 ; X86-NEXT: movw %di, 4(%ecx)
518 ; X86-NEXT: movw %bx, 2(%ecx)
519 ; X86-NEXT: movw %bp, (%ecx)
520 ; X86-NEXT: movl %ecx, %eax
521 ; X86-NEXT: addl $8, %esp
522 ; X86-NEXT: popl %esi
523 ; X86-NEXT: popl %edi
524 ; X86-NEXT: popl %ebx
525 ; X86-NEXT: popl %ebp
527 %r = call <8 x i16> @llvm.umax.v8i16(<8 x i16> %a, <8 x i16> %b)
531 define <16 x i8> @test_v16i8(<16 x i8> %a, <16 x i8> %b) nounwind {
532 ; SSE-LABEL: test_v16i8:
534 ; SSE-NEXT: pmaxub %xmm1, %xmm0
537 ; AVX-LABEL: test_v16i8:
539 ; AVX-NEXT: vpmaxub %xmm1, %xmm0, %xmm0
542 ; X86-LABEL: test_v16i8:
544 ; X86-NEXT: pushl %ebp
545 ; X86-NEXT: pushl %ebx
546 ; X86-NEXT: pushl %edi
547 ; X86-NEXT: pushl %esi
548 ; X86-NEXT: subl $40, %esp
549 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
550 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
551 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
552 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
553 ; X86-NEXT: cmpb %bl, %al
554 ; X86-NEXT: cmoval %eax, %ebx
555 ; X86-NEXT: movl %ebx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
556 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
557 ; X86-NEXT: cmpb %dl, %al
558 ; X86-NEXT: cmoval %eax, %edx
559 ; X86-NEXT: movl %edx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
560 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
561 ; X86-NEXT: cmpb %cl, %al
562 ; X86-NEXT: cmoval %eax, %ecx
563 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
564 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
565 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
566 ; X86-NEXT: cmpb %cl, %al
567 ; X86-NEXT: cmoval %eax, %ecx
568 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
569 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
570 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
571 ; X86-NEXT: cmpb %cl, %al
572 ; X86-NEXT: cmoval %eax, %ecx
573 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
574 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
575 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
576 ; X86-NEXT: cmpb %cl, %al
577 ; X86-NEXT: cmoval %eax, %ecx
578 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
579 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
580 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
581 ; X86-NEXT: cmpb %cl, %al
582 ; X86-NEXT: cmoval %eax, %ecx
583 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
584 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
585 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
586 ; X86-NEXT: cmpb %cl, %al
587 ; X86-NEXT: cmoval %eax, %ecx
588 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
589 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
590 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
591 ; X86-NEXT: cmpb %cl, %al
592 ; X86-NEXT: cmoval %eax, %ecx
593 ; X86-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
594 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
595 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
596 ; X86-NEXT: cmpb %cl, %al
597 ; X86-NEXT: cmoval %eax, %ecx
598 ; X86-NEXT: movl %ecx, (%esp) # 4-byte Spill
599 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
600 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
601 ; X86-NEXT: cmpb %cl, %al
602 ; X86-NEXT: cmoval %eax, %ecx
603 ; X86-NEXT: movl %ecx, %ebp
604 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
605 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
606 ; X86-NEXT: cmpb %cl, %al
607 ; X86-NEXT: cmoval %eax, %ecx
608 ; X86-NEXT: movl %ecx, %edi
609 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
610 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
611 ; X86-NEXT: cmpb %cl, %al
612 ; X86-NEXT: cmoval %eax, %ecx
613 ; X86-NEXT: movl %ecx, %esi
614 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
615 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
616 ; X86-NEXT: cmpb %bl, %al
617 ; X86-NEXT: cmoval %eax, %ebx
618 ; X86-NEXT: movl {{[0-9]+}}(%esp), %edx
619 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
620 ; X86-NEXT: cmpb %dl, %al
621 ; X86-NEXT: cmoval %eax, %edx
622 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
623 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
624 ; X86-NEXT: cmpb %cl, %al
625 ; X86-NEXT: cmoval %eax, %ecx
626 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
627 ; X86-NEXT: movb %cl, 15(%eax)
628 ; X86-NEXT: movb %dl, 14(%eax)
629 ; X86-NEXT: movb %bl, 13(%eax)
630 ; X86-NEXT: movl %esi, %ecx
631 ; X86-NEXT: movb %cl, 12(%eax)
632 ; X86-NEXT: movl %edi, %ecx
633 ; X86-NEXT: movb %cl, 11(%eax)
634 ; X86-NEXT: movl %ebp, %ecx
635 ; X86-NEXT: movb %cl, 10(%eax)
636 ; X86-NEXT: movl (%esp), %ecx # 4-byte Reload
637 ; X86-NEXT: movb %cl, 9(%eax)
638 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
639 ; X86-NEXT: movb %cl, 8(%eax)
640 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
641 ; X86-NEXT: movb %cl, 7(%eax)
642 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
643 ; X86-NEXT: movb %cl, 6(%eax)
644 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
645 ; X86-NEXT: movb %cl, 5(%eax)
646 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
647 ; X86-NEXT: movb %cl, 4(%eax)
648 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
649 ; X86-NEXT: movb %cl, 3(%eax)
650 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
651 ; X86-NEXT: movb %cl, 2(%eax)
652 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
653 ; X86-NEXT: movb %cl, 1(%eax)
654 ; X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %ecx # 4-byte Reload
655 ; X86-NEXT: movb %cl, (%eax)
656 ; X86-NEXT: addl $40, %esp
657 ; X86-NEXT: popl %esi
658 ; X86-NEXT: popl %edi
659 ; X86-NEXT: popl %ebx
660 ; X86-NEXT: popl %ebp
662 %r = call <16 x i8> @llvm.umax.v16i8(<16 x i8> %a, <16 x i8> %b)