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=ALL --check-prefix=SSE --check-prefix=SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=ALL --check-prefix=SSE --check-prefix=SSE42
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX1
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX2
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX512 --check-prefix=AVX512F
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX --check-prefix=AVX512 --check-prefix=AVX512BW
14 define <2 x i64> @max_gt_v2i64(<2 x i64> %a, <2 x i64> %b) {
15 ; SSE2-LABEL: max_gt_v2i64:
17 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648]
18 ; SSE2-NEXT: movdqa %xmm1, %xmm3
19 ; SSE2-NEXT: pxor %xmm2, %xmm3
20 ; SSE2-NEXT: pxor %xmm0, %xmm2
21 ; SSE2-NEXT: movdqa %xmm2, %xmm4
22 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
23 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
24 ; SSE2-NEXT: pcmpeqd %xmm3, %xmm2
25 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
26 ; SSE2-NEXT: pand %xmm5, %xmm2
27 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm4[1,1,3,3]
28 ; SSE2-NEXT: por %xmm2, %xmm3
29 ; SSE2-NEXT: pand %xmm3, %xmm0
30 ; SSE2-NEXT: pandn %xmm1, %xmm3
31 ; SSE2-NEXT: por %xmm3, %xmm0
34 ; SSE41-LABEL: max_gt_v2i64:
36 ; SSE41-NEXT: movdqa %xmm0, %xmm2
37 ; SSE41-NEXT: movdqa {{.*#+}} xmm0 = [2147483648,2147483648]
38 ; SSE41-NEXT: movdqa %xmm1, %xmm3
39 ; SSE41-NEXT: pxor %xmm0, %xmm3
40 ; SSE41-NEXT: pxor %xmm2, %xmm0
41 ; SSE41-NEXT: movdqa %xmm0, %xmm4
42 ; SSE41-NEXT: pcmpgtd %xmm3, %xmm4
43 ; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
44 ; SSE41-NEXT: pcmpeqd %xmm3, %xmm0
45 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
46 ; SSE41-NEXT: pand %xmm5, %xmm0
47 ; SSE41-NEXT: por %xmm4, %xmm0
48 ; SSE41-NEXT: blendvpd %xmm0, %xmm2, %xmm1
49 ; SSE41-NEXT: movapd %xmm1, %xmm0
52 ; SSE42-LABEL: max_gt_v2i64:
54 ; SSE42-NEXT: movdqa %xmm0, %xmm2
55 ; SSE42-NEXT: pcmpgtq %xmm1, %xmm0
56 ; SSE42-NEXT: blendvpd %xmm0, %xmm2, %xmm1
57 ; SSE42-NEXT: movapd %xmm1, %xmm0
60 ; AVX1-LABEL: max_gt_v2i64:
62 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm2
63 ; AVX1-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
66 ; AVX2-LABEL: max_gt_v2i64:
68 ; AVX2-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm2
69 ; AVX2-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
72 ; AVX512-LABEL: max_gt_v2i64:
74 ; AVX512-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
75 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
76 ; AVX512-NEXT: vpmaxsq %zmm1, %zmm0, %zmm0
77 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
78 ; AVX512-NEXT: vzeroupper
80 %1 = icmp sgt <2 x i64> %a, %b
81 %2 = select <2 x i1> %1, <2 x i64> %a, <2 x i64> %b
85 define <4 x i64> @max_gt_v4i64(<4 x i64> %a, <4 x i64> %b) {
86 ; SSE2-LABEL: max_gt_v4i64:
88 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [2147483648,2147483648]
89 ; SSE2-NEXT: movdqa %xmm2, %xmm5
90 ; SSE2-NEXT: pxor %xmm4, %xmm5
91 ; SSE2-NEXT: movdqa %xmm0, %xmm6
92 ; SSE2-NEXT: pxor %xmm4, %xmm6
93 ; SSE2-NEXT: movdqa %xmm6, %xmm7
94 ; SSE2-NEXT: pcmpgtd %xmm5, %xmm7
95 ; SSE2-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
96 ; SSE2-NEXT: pcmpeqd %xmm5, %xmm6
97 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm6[1,1,3,3]
98 ; SSE2-NEXT: pand %xmm8, %xmm5
99 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
100 ; SSE2-NEXT: por %xmm5, %xmm6
101 ; SSE2-NEXT: pand %xmm6, %xmm0
102 ; SSE2-NEXT: pandn %xmm2, %xmm6
103 ; SSE2-NEXT: por %xmm6, %xmm0
104 ; SSE2-NEXT: movdqa %xmm3, %xmm2
105 ; SSE2-NEXT: pxor %xmm4, %xmm2
106 ; SSE2-NEXT: pxor %xmm1, %xmm4
107 ; SSE2-NEXT: movdqa %xmm4, %xmm5
108 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm5
109 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm5[0,0,2,2]
110 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm4
111 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm4[1,1,3,3]
112 ; SSE2-NEXT: pand %xmm6, %xmm2
113 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm5[1,1,3,3]
114 ; SSE2-NEXT: por %xmm2, %xmm4
115 ; SSE2-NEXT: pand %xmm4, %xmm1
116 ; SSE2-NEXT: pandn %xmm3, %xmm4
117 ; SSE2-NEXT: por %xmm4, %xmm1
120 ; SSE41-LABEL: max_gt_v4i64:
122 ; SSE41-NEXT: movdqa %xmm0, %xmm4
123 ; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [2147483648,2147483648]
124 ; SSE41-NEXT: movdqa %xmm2, %xmm6
125 ; SSE41-NEXT: pxor %xmm5, %xmm6
126 ; SSE41-NEXT: movdqa %xmm0, %xmm7
127 ; SSE41-NEXT: pxor %xmm5, %xmm7
128 ; SSE41-NEXT: movdqa %xmm7, %xmm0
129 ; SSE41-NEXT: pcmpgtd %xmm6, %xmm0
130 ; SSE41-NEXT: pshufd {{.*#+}} xmm8 = xmm0[0,0,2,2]
131 ; SSE41-NEXT: pcmpeqd %xmm6, %xmm7
132 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
133 ; SSE41-NEXT: pand %xmm8, %xmm6
134 ; SSE41-NEXT: por %xmm6, %xmm0
135 ; SSE41-NEXT: blendvpd %xmm0, %xmm4, %xmm2
136 ; SSE41-NEXT: movdqa %xmm3, %xmm0
137 ; SSE41-NEXT: pxor %xmm5, %xmm0
138 ; SSE41-NEXT: pxor %xmm1, %xmm5
139 ; SSE41-NEXT: movdqa %xmm5, %xmm4
140 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm4
141 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm4[0,0,2,2]
142 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm5
143 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm5[1,1,3,3]
144 ; SSE41-NEXT: pand %xmm6, %xmm0
145 ; SSE41-NEXT: por %xmm4, %xmm0
146 ; SSE41-NEXT: blendvpd %xmm0, %xmm1, %xmm3
147 ; SSE41-NEXT: movapd %xmm2, %xmm0
148 ; SSE41-NEXT: movapd %xmm3, %xmm1
151 ; SSE42-LABEL: max_gt_v4i64:
153 ; SSE42-NEXT: movdqa %xmm0, %xmm4
154 ; SSE42-NEXT: pcmpgtq %xmm2, %xmm0
155 ; SSE42-NEXT: blendvpd %xmm0, %xmm4, %xmm2
156 ; SSE42-NEXT: movdqa %xmm1, %xmm0
157 ; SSE42-NEXT: pcmpgtq %xmm3, %xmm0
158 ; SSE42-NEXT: blendvpd %xmm0, %xmm1, %xmm3
159 ; SSE42-NEXT: movapd %xmm2, %xmm0
160 ; SSE42-NEXT: movapd %xmm3, %xmm1
163 ; AVX1-LABEL: max_gt_v4i64:
165 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
166 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
167 ; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
168 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm3
169 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
170 ; AVX1-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
173 ; AVX2-LABEL: max_gt_v4i64:
175 ; AVX2-NEXT: vpcmpgtq %ymm1, %ymm0, %ymm2
176 ; AVX2-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
179 ; AVX512-LABEL: max_gt_v4i64:
181 ; AVX512-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
182 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
183 ; AVX512-NEXT: vpmaxsq %zmm1, %zmm0, %zmm0
184 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
186 %1 = icmp sgt <4 x i64> %a, %b
187 %2 = select <4 x i1> %1, <4 x i64> %a, <4 x i64> %b
191 define <4 x i32> @max_gt_v4i32(<4 x i32> %a, <4 x i32> %b) {
192 ; SSE2-LABEL: max_gt_v4i32:
194 ; SSE2-NEXT: movdqa %xmm0, %xmm2
195 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
196 ; SSE2-NEXT: pand %xmm2, %xmm0
197 ; SSE2-NEXT: pandn %xmm1, %xmm2
198 ; SSE2-NEXT: por %xmm0, %xmm2
199 ; SSE2-NEXT: movdqa %xmm2, %xmm0
202 ; SSE41-LABEL: max_gt_v4i32:
204 ; SSE41-NEXT: pmaxsd %xmm1, %xmm0
207 ; SSE42-LABEL: max_gt_v4i32:
209 ; SSE42-NEXT: pmaxsd %xmm1, %xmm0
212 ; AVX-LABEL: max_gt_v4i32:
214 ; AVX-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0
216 %1 = icmp sgt <4 x i32> %a, %b
217 %2 = select <4 x i1> %1, <4 x i32> %a, <4 x i32> %b
221 define <8 x i32> @max_gt_v8i32(<8 x i32> %a, <8 x i32> %b) {
222 ; SSE2-LABEL: max_gt_v8i32:
224 ; SSE2-NEXT: movdqa %xmm0, %xmm4
225 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm4
226 ; SSE2-NEXT: pand %xmm4, %xmm0
227 ; SSE2-NEXT: pandn %xmm2, %xmm4
228 ; SSE2-NEXT: por %xmm0, %xmm4
229 ; SSE2-NEXT: movdqa %xmm1, %xmm2
230 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm2
231 ; SSE2-NEXT: pand %xmm2, %xmm1
232 ; SSE2-NEXT: pandn %xmm3, %xmm2
233 ; SSE2-NEXT: por %xmm1, %xmm2
234 ; SSE2-NEXT: movdqa %xmm4, %xmm0
235 ; SSE2-NEXT: movdqa %xmm2, %xmm1
238 ; SSE41-LABEL: max_gt_v8i32:
240 ; SSE41-NEXT: pmaxsd %xmm2, %xmm0
241 ; SSE41-NEXT: pmaxsd %xmm3, %xmm1
244 ; SSE42-LABEL: max_gt_v8i32:
246 ; SSE42-NEXT: pmaxsd %xmm2, %xmm0
247 ; SSE42-NEXT: pmaxsd %xmm3, %xmm1
250 ; AVX1-LABEL: max_gt_v8i32:
252 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
253 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
254 ; AVX1-NEXT: vpmaxsd %xmm2, %xmm3, %xmm2
255 ; AVX1-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0
256 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
259 ; AVX2-LABEL: max_gt_v8i32:
261 ; AVX2-NEXT: vpmaxsd %ymm1, %ymm0, %ymm0
264 ; AVX512-LABEL: max_gt_v8i32:
266 ; AVX512-NEXT: vpmaxsd %ymm1, %ymm0, %ymm0
268 %1 = icmp sgt <8 x i32> %a, %b
269 %2 = select <8 x i1> %1, <8 x i32> %a, <8 x i32> %b
273 define <8 x i16> @max_gt_v8i16(<8 x i16> %a, <8 x i16> %b) {
274 ; SSE-LABEL: max_gt_v8i16:
276 ; SSE-NEXT: pmaxsw %xmm1, %xmm0
279 ; AVX-LABEL: max_gt_v8i16:
281 ; AVX-NEXT: vpmaxsw %xmm1, %xmm0, %xmm0
283 %1 = icmp sgt <8 x i16> %a, %b
284 %2 = select <8 x i1> %1, <8 x i16> %a, <8 x i16> %b
288 define <16 x i16> @max_gt_v16i16(<16 x i16> %a, <16 x i16> %b) {
289 ; SSE-LABEL: max_gt_v16i16:
291 ; SSE-NEXT: pmaxsw %xmm2, %xmm0
292 ; SSE-NEXT: pmaxsw %xmm3, %xmm1
295 ; AVX1-LABEL: max_gt_v16i16:
297 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
298 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
299 ; AVX1-NEXT: vpmaxsw %xmm2, %xmm3, %xmm2
300 ; AVX1-NEXT: vpmaxsw %xmm1, %xmm0, %xmm0
301 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
304 ; AVX2-LABEL: max_gt_v16i16:
306 ; AVX2-NEXT: vpmaxsw %ymm1, %ymm0, %ymm0
309 ; AVX512-LABEL: max_gt_v16i16:
311 ; AVX512-NEXT: vpmaxsw %ymm1, %ymm0, %ymm0
313 %1 = icmp sgt <16 x i16> %a, %b
314 %2 = select <16 x i1> %1, <16 x i16> %a, <16 x i16> %b
318 define <16 x i8> @max_gt_v16i8(<16 x i8> %a, <16 x i8> %b) {
319 ; SSE2-LABEL: max_gt_v16i8:
321 ; SSE2-NEXT: movdqa %xmm0, %xmm2
322 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm2
323 ; SSE2-NEXT: pand %xmm2, %xmm0
324 ; SSE2-NEXT: pandn %xmm1, %xmm2
325 ; SSE2-NEXT: por %xmm0, %xmm2
326 ; SSE2-NEXT: movdqa %xmm2, %xmm0
329 ; SSE41-LABEL: max_gt_v16i8:
331 ; SSE41-NEXT: pmaxsb %xmm1, %xmm0
334 ; SSE42-LABEL: max_gt_v16i8:
336 ; SSE42-NEXT: pmaxsb %xmm1, %xmm0
339 ; AVX-LABEL: max_gt_v16i8:
341 ; AVX-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0
343 %1 = icmp sgt <16 x i8> %a, %b
344 %2 = select <16 x i1> %1, <16 x i8> %a, <16 x i8> %b
348 define <32 x i8> @max_gt_v32i8(<32 x i8> %a, <32 x i8> %b) {
349 ; SSE2-LABEL: max_gt_v32i8:
351 ; SSE2-NEXT: movdqa %xmm0, %xmm4
352 ; SSE2-NEXT: pcmpgtb %xmm2, %xmm4
353 ; SSE2-NEXT: pand %xmm4, %xmm0
354 ; SSE2-NEXT: pandn %xmm2, %xmm4
355 ; SSE2-NEXT: por %xmm0, %xmm4
356 ; SSE2-NEXT: movdqa %xmm1, %xmm2
357 ; SSE2-NEXT: pcmpgtb %xmm3, %xmm2
358 ; SSE2-NEXT: pand %xmm2, %xmm1
359 ; SSE2-NEXT: pandn %xmm3, %xmm2
360 ; SSE2-NEXT: por %xmm1, %xmm2
361 ; SSE2-NEXT: movdqa %xmm4, %xmm0
362 ; SSE2-NEXT: movdqa %xmm2, %xmm1
365 ; SSE41-LABEL: max_gt_v32i8:
367 ; SSE41-NEXT: pmaxsb %xmm2, %xmm0
368 ; SSE41-NEXT: pmaxsb %xmm3, %xmm1
371 ; SSE42-LABEL: max_gt_v32i8:
373 ; SSE42-NEXT: pmaxsb %xmm2, %xmm0
374 ; SSE42-NEXT: pmaxsb %xmm3, %xmm1
377 ; AVX1-LABEL: max_gt_v32i8:
379 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
380 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
381 ; AVX1-NEXT: vpmaxsb %xmm2, %xmm3, %xmm2
382 ; AVX1-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0
383 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
386 ; AVX2-LABEL: max_gt_v32i8:
388 ; AVX2-NEXT: vpmaxsb %ymm1, %ymm0, %ymm0
391 ; AVX512-LABEL: max_gt_v32i8:
393 ; AVX512-NEXT: vpmaxsb %ymm1, %ymm0, %ymm0
395 %1 = icmp sgt <32 x i8> %a, %b
396 %2 = select <32 x i1> %1, <32 x i8> %a, <32 x i8> %b
401 ; Signed Maximum (GE)
404 define <2 x i64> @max_ge_v2i64(<2 x i64> %a, <2 x i64> %b) {
405 ; SSE2-LABEL: max_ge_v2i64:
407 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648]
408 ; SSE2-NEXT: movdqa %xmm1, %xmm3
409 ; SSE2-NEXT: pxor %xmm2, %xmm3
410 ; SSE2-NEXT: pxor %xmm0, %xmm2
411 ; SSE2-NEXT: movdqa %xmm2, %xmm4
412 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
413 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
414 ; SSE2-NEXT: pcmpeqd %xmm3, %xmm2
415 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
416 ; SSE2-NEXT: pand %xmm5, %xmm2
417 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm4[1,1,3,3]
418 ; SSE2-NEXT: por %xmm2, %xmm3
419 ; SSE2-NEXT: pand %xmm3, %xmm0
420 ; SSE2-NEXT: pandn %xmm1, %xmm3
421 ; SSE2-NEXT: por %xmm3, %xmm0
424 ; SSE41-LABEL: max_ge_v2i64:
426 ; SSE41-NEXT: movdqa %xmm0, %xmm2
427 ; SSE41-NEXT: movdqa {{.*#+}} xmm0 = [2147483648,2147483648]
428 ; SSE41-NEXT: movdqa %xmm1, %xmm3
429 ; SSE41-NEXT: pxor %xmm0, %xmm3
430 ; SSE41-NEXT: pxor %xmm2, %xmm0
431 ; SSE41-NEXT: movdqa %xmm0, %xmm4
432 ; SSE41-NEXT: pcmpgtd %xmm3, %xmm4
433 ; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
434 ; SSE41-NEXT: pcmpeqd %xmm3, %xmm0
435 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
436 ; SSE41-NEXT: pand %xmm5, %xmm0
437 ; SSE41-NEXT: por %xmm4, %xmm0
438 ; SSE41-NEXT: blendvpd %xmm0, %xmm2, %xmm1
439 ; SSE41-NEXT: movapd %xmm1, %xmm0
442 ; SSE42-LABEL: max_ge_v2i64:
444 ; SSE42-NEXT: movdqa %xmm0, %xmm2
445 ; SSE42-NEXT: pcmpgtq %xmm1, %xmm0
446 ; SSE42-NEXT: blendvpd %xmm0, %xmm2, %xmm1
447 ; SSE42-NEXT: movapd %xmm1, %xmm0
450 ; AVX1-LABEL: max_ge_v2i64:
452 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm2
453 ; AVX1-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
456 ; AVX2-LABEL: max_ge_v2i64:
458 ; AVX2-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm2
459 ; AVX2-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
462 ; AVX512-LABEL: max_ge_v2i64:
464 ; AVX512-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
465 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
466 ; AVX512-NEXT: vpmaxsq %zmm1, %zmm0, %zmm0
467 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
468 ; AVX512-NEXT: vzeroupper
470 %1 = icmp sge <2 x i64> %a, %b
471 %2 = select <2 x i1> %1, <2 x i64> %a, <2 x i64> %b
475 define <4 x i64> @max_ge_v4i64(<4 x i64> %a, <4 x i64> %b) {
476 ; SSE2-LABEL: max_ge_v4i64:
478 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [2147483648,2147483648]
479 ; SSE2-NEXT: movdqa %xmm2, %xmm5
480 ; SSE2-NEXT: pxor %xmm4, %xmm5
481 ; SSE2-NEXT: movdqa %xmm0, %xmm6
482 ; SSE2-NEXT: pxor %xmm4, %xmm6
483 ; SSE2-NEXT: movdqa %xmm6, %xmm7
484 ; SSE2-NEXT: pcmpgtd %xmm5, %xmm7
485 ; SSE2-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
486 ; SSE2-NEXT: pcmpeqd %xmm5, %xmm6
487 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm6[1,1,3,3]
488 ; SSE2-NEXT: pand %xmm8, %xmm5
489 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
490 ; SSE2-NEXT: por %xmm5, %xmm6
491 ; SSE2-NEXT: pand %xmm6, %xmm0
492 ; SSE2-NEXT: pandn %xmm2, %xmm6
493 ; SSE2-NEXT: por %xmm6, %xmm0
494 ; SSE2-NEXT: movdqa %xmm3, %xmm2
495 ; SSE2-NEXT: pxor %xmm4, %xmm2
496 ; SSE2-NEXT: pxor %xmm1, %xmm4
497 ; SSE2-NEXT: movdqa %xmm4, %xmm5
498 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm5
499 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm5[0,0,2,2]
500 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm4
501 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm4[1,1,3,3]
502 ; SSE2-NEXT: pand %xmm6, %xmm2
503 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm5[1,1,3,3]
504 ; SSE2-NEXT: por %xmm2, %xmm4
505 ; SSE2-NEXT: pand %xmm4, %xmm1
506 ; SSE2-NEXT: pandn %xmm3, %xmm4
507 ; SSE2-NEXT: por %xmm4, %xmm1
510 ; SSE41-LABEL: max_ge_v4i64:
512 ; SSE41-NEXT: movdqa %xmm0, %xmm4
513 ; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [2147483648,2147483648]
514 ; SSE41-NEXT: movdqa %xmm2, %xmm6
515 ; SSE41-NEXT: pxor %xmm5, %xmm6
516 ; SSE41-NEXT: movdqa %xmm0, %xmm7
517 ; SSE41-NEXT: pxor %xmm5, %xmm7
518 ; SSE41-NEXT: movdqa %xmm7, %xmm0
519 ; SSE41-NEXT: pcmpgtd %xmm6, %xmm0
520 ; SSE41-NEXT: pshufd {{.*#+}} xmm8 = xmm0[0,0,2,2]
521 ; SSE41-NEXT: pcmpeqd %xmm6, %xmm7
522 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
523 ; SSE41-NEXT: pand %xmm8, %xmm6
524 ; SSE41-NEXT: por %xmm6, %xmm0
525 ; SSE41-NEXT: blendvpd %xmm0, %xmm4, %xmm2
526 ; SSE41-NEXT: movdqa %xmm3, %xmm0
527 ; SSE41-NEXT: pxor %xmm5, %xmm0
528 ; SSE41-NEXT: pxor %xmm1, %xmm5
529 ; SSE41-NEXT: movdqa %xmm5, %xmm4
530 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm4
531 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm4[0,0,2,2]
532 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm5
533 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm5[1,1,3,3]
534 ; SSE41-NEXT: pand %xmm6, %xmm0
535 ; SSE41-NEXT: por %xmm4, %xmm0
536 ; SSE41-NEXT: blendvpd %xmm0, %xmm1, %xmm3
537 ; SSE41-NEXT: movapd %xmm2, %xmm0
538 ; SSE41-NEXT: movapd %xmm3, %xmm1
541 ; SSE42-LABEL: max_ge_v4i64:
543 ; SSE42-NEXT: movdqa %xmm0, %xmm4
544 ; SSE42-NEXT: pcmpgtq %xmm2, %xmm0
545 ; SSE42-NEXT: blendvpd %xmm0, %xmm4, %xmm2
546 ; SSE42-NEXT: movdqa %xmm1, %xmm0
547 ; SSE42-NEXT: pcmpgtq %xmm3, %xmm0
548 ; SSE42-NEXT: blendvpd %xmm0, %xmm1, %xmm3
549 ; SSE42-NEXT: movapd %xmm2, %xmm0
550 ; SSE42-NEXT: movapd %xmm3, %xmm1
553 ; AVX1-LABEL: max_ge_v4i64:
555 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
556 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
557 ; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
558 ; AVX1-NEXT: vpcmpgtq %xmm1, %xmm0, %xmm3
559 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
560 ; AVX1-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
563 ; AVX2-LABEL: max_ge_v4i64:
565 ; AVX2-NEXT: vpcmpgtq %ymm1, %ymm0, %ymm2
566 ; AVX2-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
569 ; AVX512-LABEL: max_ge_v4i64:
571 ; AVX512-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
572 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
573 ; AVX512-NEXT: vpmaxsq %zmm1, %zmm0, %zmm0
574 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
576 %1 = icmp sge <4 x i64> %a, %b
577 %2 = select <4 x i1> %1, <4 x i64> %a, <4 x i64> %b
581 define <4 x i32> @max_ge_v4i32(<4 x i32> %a, <4 x i32> %b) {
582 ; SSE2-LABEL: max_ge_v4i32:
584 ; SSE2-NEXT: movdqa %xmm0, %xmm2
585 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
586 ; SSE2-NEXT: pand %xmm2, %xmm0
587 ; SSE2-NEXT: pandn %xmm1, %xmm2
588 ; SSE2-NEXT: por %xmm0, %xmm2
589 ; SSE2-NEXT: movdqa %xmm2, %xmm0
592 ; SSE41-LABEL: max_ge_v4i32:
594 ; SSE41-NEXT: pmaxsd %xmm1, %xmm0
597 ; SSE42-LABEL: max_ge_v4i32:
599 ; SSE42-NEXT: pmaxsd %xmm1, %xmm0
602 ; AVX-LABEL: max_ge_v4i32:
604 ; AVX-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0
606 %1 = icmp sge <4 x i32> %a, %b
607 %2 = select <4 x i1> %1, <4 x i32> %a, <4 x i32> %b
611 define <8 x i32> @max_ge_v8i32(<8 x i32> %a, <8 x i32> %b) {
612 ; SSE2-LABEL: max_ge_v8i32:
614 ; SSE2-NEXT: movdqa %xmm0, %xmm4
615 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm4
616 ; SSE2-NEXT: pand %xmm4, %xmm0
617 ; SSE2-NEXT: pandn %xmm2, %xmm4
618 ; SSE2-NEXT: por %xmm0, %xmm4
619 ; SSE2-NEXT: movdqa %xmm1, %xmm2
620 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm2
621 ; SSE2-NEXT: pand %xmm2, %xmm1
622 ; SSE2-NEXT: pandn %xmm3, %xmm2
623 ; SSE2-NEXT: por %xmm1, %xmm2
624 ; SSE2-NEXT: movdqa %xmm4, %xmm0
625 ; SSE2-NEXT: movdqa %xmm2, %xmm1
628 ; SSE41-LABEL: max_ge_v8i32:
630 ; SSE41-NEXT: pmaxsd %xmm2, %xmm0
631 ; SSE41-NEXT: pmaxsd %xmm3, %xmm1
634 ; SSE42-LABEL: max_ge_v8i32:
636 ; SSE42-NEXT: pmaxsd %xmm2, %xmm0
637 ; SSE42-NEXT: pmaxsd %xmm3, %xmm1
640 ; AVX1-LABEL: max_ge_v8i32:
642 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
643 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
644 ; AVX1-NEXT: vpmaxsd %xmm2, %xmm3, %xmm2
645 ; AVX1-NEXT: vpmaxsd %xmm1, %xmm0, %xmm0
646 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
649 ; AVX2-LABEL: max_ge_v8i32:
651 ; AVX2-NEXT: vpmaxsd %ymm1, %ymm0, %ymm0
654 ; AVX512-LABEL: max_ge_v8i32:
656 ; AVX512-NEXT: vpmaxsd %ymm1, %ymm0, %ymm0
658 %1 = icmp sge <8 x i32> %a, %b
659 %2 = select <8 x i1> %1, <8 x i32> %a, <8 x i32> %b
663 define <8 x i16> @max_ge_v8i16(<8 x i16> %a, <8 x i16> %b) {
664 ; SSE-LABEL: max_ge_v8i16:
666 ; SSE-NEXT: pmaxsw %xmm1, %xmm0
669 ; AVX-LABEL: max_ge_v8i16:
671 ; AVX-NEXT: vpmaxsw %xmm1, %xmm0, %xmm0
673 %1 = icmp sge <8 x i16> %a, %b
674 %2 = select <8 x i1> %1, <8 x i16> %a, <8 x i16> %b
678 define <16 x i16> @max_ge_v16i16(<16 x i16> %a, <16 x i16> %b) {
679 ; SSE-LABEL: max_ge_v16i16:
681 ; SSE-NEXT: pmaxsw %xmm2, %xmm0
682 ; SSE-NEXT: pmaxsw %xmm3, %xmm1
685 ; AVX1-LABEL: max_ge_v16i16:
687 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
688 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
689 ; AVX1-NEXT: vpmaxsw %xmm2, %xmm3, %xmm2
690 ; AVX1-NEXT: vpmaxsw %xmm1, %xmm0, %xmm0
691 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
694 ; AVX2-LABEL: max_ge_v16i16:
696 ; AVX2-NEXT: vpmaxsw %ymm1, %ymm0, %ymm0
699 ; AVX512-LABEL: max_ge_v16i16:
701 ; AVX512-NEXT: vpmaxsw %ymm1, %ymm0, %ymm0
703 %1 = icmp sge <16 x i16> %a, %b
704 %2 = select <16 x i1> %1, <16 x i16> %a, <16 x i16> %b
708 define <16 x i8> @max_ge_v16i8(<16 x i8> %a, <16 x i8> %b) {
709 ; SSE2-LABEL: max_ge_v16i8:
711 ; SSE2-NEXT: movdqa %xmm0, %xmm2
712 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm2
713 ; SSE2-NEXT: pand %xmm2, %xmm0
714 ; SSE2-NEXT: pandn %xmm1, %xmm2
715 ; SSE2-NEXT: por %xmm0, %xmm2
716 ; SSE2-NEXT: movdqa %xmm2, %xmm0
719 ; SSE41-LABEL: max_ge_v16i8:
721 ; SSE41-NEXT: pmaxsb %xmm1, %xmm0
724 ; SSE42-LABEL: max_ge_v16i8:
726 ; SSE42-NEXT: pmaxsb %xmm1, %xmm0
729 ; AVX-LABEL: max_ge_v16i8:
731 ; AVX-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0
733 %1 = icmp sge <16 x i8> %a, %b
734 %2 = select <16 x i1> %1, <16 x i8> %a, <16 x i8> %b
738 define <32 x i8> @max_ge_v32i8(<32 x i8> %a, <32 x i8> %b) {
739 ; SSE2-LABEL: max_ge_v32i8:
741 ; SSE2-NEXT: movdqa %xmm0, %xmm4
742 ; SSE2-NEXT: pcmpgtb %xmm2, %xmm4
743 ; SSE2-NEXT: pand %xmm4, %xmm0
744 ; SSE2-NEXT: pandn %xmm2, %xmm4
745 ; SSE2-NEXT: por %xmm0, %xmm4
746 ; SSE2-NEXT: movdqa %xmm1, %xmm2
747 ; SSE2-NEXT: pcmpgtb %xmm3, %xmm2
748 ; SSE2-NEXT: pand %xmm2, %xmm1
749 ; SSE2-NEXT: pandn %xmm3, %xmm2
750 ; SSE2-NEXT: por %xmm1, %xmm2
751 ; SSE2-NEXT: movdqa %xmm4, %xmm0
752 ; SSE2-NEXT: movdqa %xmm2, %xmm1
755 ; SSE41-LABEL: max_ge_v32i8:
757 ; SSE41-NEXT: pmaxsb %xmm2, %xmm0
758 ; SSE41-NEXT: pmaxsb %xmm3, %xmm1
761 ; SSE42-LABEL: max_ge_v32i8:
763 ; SSE42-NEXT: pmaxsb %xmm2, %xmm0
764 ; SSE42-NEXT: pmaxsb %xmm3, %xmm1
767 ; AVX1-LABEL: max_ge_v32i8:
769 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
770 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
771 ; AVX1-NEXT: vpmaxsb %xmm2, %xmm3, %xmm2
772 ; AVX1-NEXT: vpmaxsb %xmm1, %xmm0, %xmm0
773 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
776 ; AVX2-LABEL: max_ge_v32i8:
778 ; AVX2-NEXT: vpmaxsb %ymm1, %ymm0, %ymm0
781 ; AVX512-LABEL: max_ge_v32i8:
783 ; AVX512-NEXT: vpmaxsb %ymm1, %ymm0, %ymm0
785 %1 = icmp sge <32 x i8> %a, %b
786 %2 = select <32 x i1> %1, <32 x i8> %a, <32 x i8> %b
791 ; Signed Minimum (LT)
794 define <2 x i64> @min_lt_v2i64(<2 x i64> %a, <2 x i64> %b) {
795 ; SSE2-LABEL: min_lt_v2i64:
797 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648]
798 ; SSE2-NEXT: movdqa %xmm0, %xmm3
799 ; SSE2-NEXT: pxor %xmm2, %xmm3
800 ; SSE2-NEXT: pxor %xmm1, %xmm2
801 ; SSE2-NEXT: movdqa %xmm2, %xmm4
802 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
803 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
804 ; SSE2-NEXT: pcmpeqd %xmm3, %xmm2
805 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
806 ; SSE2-NEXT: pand %xmm5, %xmm2
807 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm4[1,1,3,3]
808 ; SSE2-NEXT: por %xmm2, %xmm3
809 ; SSE2-NEXT: pand %xmm3, %xmm0
810 ; SSE2-NEXT: pandn %xmm1, %xmm3
811 ; SSE2-NEXT: por %xmm3, %xmm0
814 ; SSE41-LABEL: min_lt_v2i64:
816 ; SSE41-NEXT: movdqa %xmm0, %xmm2
817 ; SSE41-NEXT: movdqa {{.*#+}} xmm0 = [2147483648,2147483648]
818 ; SSE41-NEXT: movdqa %xmm2, %xmm3
819 ; SSE41-NEXT: pxor %xmm0, %xmm3
820 ; SSE41-NEXT: pxor %xmm1, %xmm0
821 ; SSE41-NEXT: movdqa %xmm0, %xmm4
822 ; SSE41-NEXT: pcmpgtd %xmm3, %xmm4
823 ; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
824 ; SSE41-NEXT: pcmpeqd %xmm3, %xmm0
825 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
826 ; SSE41-NEXT: pand %xmm5, %xmm0
827 ; SSE41-NEXT: por %xmm4, %xmm0
828 ; SSE41-NEXT: blendvpd %xmm0, %xmm2, %xmm1
829 ; SSE41-NEXT: movapd %xmm1, %xmm0
832 ; SSE42-LABEL: min_lt_v2i64:
834 ; SSE42-NEXT: movdqa %xmm0, %xmm2
835 ; SSE42-NEXT: movdqa %xmm1, %xmm0
836 ; SSE42-NEXT: pcmpgtq %xmm2, %xmm0
837 ; SSE42-NEXT: blendvpd %xmm0, %xmm2, %xmm1
838 ; SSE42-NEXT: movapd %xmm1, %xmm0
841 ; AVX1-LABEL: min_lt_v2i64:
843 ; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm2
844 ; AVX1-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
847 ; AVX2-LABEL: min_lt_v2i64:
849 ; AVX2-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm2
850 ; AVX2-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
853 ; AVX512-LABEL: min_lt_v2i64:
855 ; AVX512-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
856 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
857 ; AVX512-NEXT: vpminsq %zmm1, %zmm0, %zmm0
858 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
859 ; AVX512-NEXT: vzeroupper
861 %1 = icmp slt <2 x i64> %a, %b
862 %2 = select <2 x i1> %1, <2 x i64> %a, <2 x i64> %b
866 define <4 x i64> @min_lt_v4i64(<4 x i64> %a, <4 x i64> %b) {
867 ; SSE2-LABEL: min_lt_v4i64:
869 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [2147483648,2147483648]
870 ; SSE2-NEXT: movdqa %xmm0, %xmm5
871 ; SSE2-NEXT: pxor %xmm4, %xmm5
872 ; SSE2-NEXT: movdqa %xmm2, %xmm6
873 ; SSE2-NEXT: pxor %xmm4, %xmm6
874 ; SSE2-NEXT: movdqa %xmm6, %xmm7
875 ; SSE2-NEXT: pcmpgtd %xmm5, %xmm7
876 ; SSE2-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
877 ; SSE2-NEXT: pcmpeqd %xmm5, %xmm6
878 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm6[1,1,3,3]
879 ; SSE2-NEXT: pand %xmm8, %xmm5
880 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
881 ; SSE2-NEXT: por %xmm5, %xmm6
882 ; SSE2-NEXT: pand %xmm6, %xmm0
883 ; SSE2-NEXT: pandn %xmm2, %xmm6
884 ; SSE2-NEXT: por %xmm6, %xmm0
885 ; SSE2-NEXT: movdqa %xmm1, %xmm2
886 ; SSE2-NEXT: pxor %xmm4, %xmm2
887 ; SSE2-NEXT: pxor %xmm3, %xmm4
888 ; SSE2-NEXT: movdqa %xmm4, %xmm5
889 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm5
890 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm5[0,0,2,2]
891 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm4
892 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm4[1,1,3,3]
893 ; SSE2-NEXT: pand %xmm6, %xmm2
894 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm5[1,1,3,3]
895 ; SSE2-NEXT: por %xmm2, %xmm4
896 ; SSE2-NEXT: pand %xmm4, %xmm1
897 ; SSE2-NEXT: pandn %xmm3, %xmm4
898 ; SSE2-NEXT: por %xmm4, %xmm1
901 ; SSE41-LABEL: min_lt_v4i64:
903 ; SSE41-NEXT: movdqa %xmm0, %xmm4
904 ; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [2147483648,2147483648]
905 ; SSE41-NEXT: pxor %xmm5, %xmm0
906 ; SSE41-NEXT: movdqa %xmm2, %xmm6
907 ; SSE41-NEXT: pxor %xmm5, %xmm6
908 ; SSE41-NEXT: movdqa %xmm6, %xmm7
909 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm7
910 ; SSE41-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
911 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm6
912 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm6[1,1,3,3]
913 ; SSE41-NEXT: pand %xmm8, %xmm0
914 ; SSE41-NEXT: por %xmm7, %xmm0
915 ; SSE41-NEXT: blendvpd %xmm0, %xmm4, %xmm2
916 ; SSE41-NEXT: movdqa %xmm1, %xmm0
917 ; SSE41-NEXT: pxor %xmm5, %xmm0
918 ; SSE41-NEXT: pxor %xmm3, %xmm5
919 ; SSE41-NEXT: movdqa %xmm5, %xmm4
920 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm4
921 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm4[0,0,2,2]
922 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm5
923 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm5[1,1,3,3]
924 ; SSE41-NEXT: pand %xmm6, %xmm0
925 ; SSE41-NEXT: por %xmm4, %xmm0
926 ; SSE41-NEXT: blendvpd %xmm0, %xmm1, %xmm3
927 ; SSE41-NEXT: movapd %xmm2, %xmm0
928 ; SSE41-NEXT: movapd %xmm3, %xmm1
931 ; SSE42-LABEL: min_lt_v4i64:
933 ; SSE42-NEXT: movdqa %xmm0, %xmm4
934 ; SSE42-NEXT: movdqa %xmm2, %xmm0
935 ; SSE42-NEXT: pcmpgtq %xmm4, %xmm0
936 ; SSE42-NEXT: blendvpd %xmm0, %xmm4, %xmm2
937 ; SSE42-NEXT: movdqa %xmm3, %xmm0
938 ; SSE42-NEXT: pcmpgtq %xmm1, %xmm0
939 ; SSE42-NEXT: blendvpd %xmm0, %xmm1, %xmm3
940 ; SSE42-NEXT: movapd %xmm2, %xmm0
941 ; SSE42-NEXT: movapd %xmm3, %xmm1
944 ; AVX1-LABEL: min_lt_v4i64:
946 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
947 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
948 ; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
949 ; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm3
950 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
951 ; AVX1-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
954 ; AVX2-LABEL: min_lt_v4i64:
956 ; AVX2-NEXT: vpcmpgtq %ymm0, %ymm1, %ymm2
957 ; AVX2-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
960 ; AVX512-LABEL: min_lt_v4i64:
962 ; AVX512-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
963 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
964 ; AVX512-NEXT: vpminsq %zmm1, %zmm0, %zmm0
965 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
967 %1 = icmp slt <4 x i64> %a, %b
968 %2 = select <4 x i1> %1, <4 x i64> %a, <4 x i64> %b
972 define <4 x i32> @min_lt_v4i32(<4 x i32> %a, <4 x i32> %b) {
973 ; SSE2-LABEL: min_lt_v4i32:
975 ; SSE2-NEXT: movdqa %xmm1, %xmm2
976 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm2
977 ; SSE2-NEXT: pand %xmm2, %xmm0
978 ; SSE2-NEXT: pandn %xmm1, %xmm2
979 ; SSE2-NEXT: por %xmm2, %xmm0
982 ; SSE41-LABEL: min_lt_v4i32:
984 ; SSE41-NEXT: pminsd %xmm1, %xmm0
987 ; SSE42-LABEL: min_lt_v4i32:
989 ; SSE42-NEXT: pminsd %xmm1, %xmm0
992 ; AVX-LABEL: min_lt_v4i32:
994 ; AVX-NEXT: vpminsd %xmm1, %xmm0, %xmm0
996 %1 = icmp slt <4 x i32> %a, %b
997 %2 = select <4 x i1> %1, <4 x i32> %a, <4 x i32> %b
1001 define <8 x i32> @min_lt_v8i32(<8 x i32> %a, <8 x i32> %b) {
1002 ; SSE2-LABEL: min_lt_v8i32:
1004 ; SSE2-NEXT: movdqa %xmm2, %xmm4
1005 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm4
1006 ; SSE2-NEXT: pand %xmm4, %xmm0
1007 ; SSE2-NEXT: pandn %xmm2, %xmm4
1008 ; SSE2-NEXT: por %xmm4, %xmm0
1009 ; SSE2-NEXT: movdqa %xmm3, %xmm2
1010 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1011 ; SSE2-NEXT: pand %xmm2, %xmm1
1012 ; SSE2-NEXT: pandn %xmm3, %xmm2
1013 ; SSE2-NEXT: por %xmm2, %xmm1
1016 ; SSE41-LABEL: min_lt_v8i32:
1018 ; SSE41-NEXT: pminsd %xmm2, %xmm0
1019 ; SSE41-NEXT: pminsd %xmm3, %xmm1
1022 ; SSE42-LABEL: min_lt_v8i32:
1024 ; SSE42-NEXT: pminsd %xmm2, %xmm0
1025 ; SSE42-NEXT: pminsd %xmm3, %xmm1
1028 ; AVX1-LABEL: min_lt_v8i32:
1030 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1031 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1032 ; AVX1-NEXT: vpminsd %xmm2, %xmm3, %xmm2
1033 ; AVX1-NEXT: vpminsd %xmm1, %xmm0, %xmm0
1034 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1037 ; AVX2-LABEL: min_lt_v8i32:
1039 ; AVX2-NEXT: vpminsd %ymm1, %ymm0, %ymm0
1042 ; AVX512-LABEL: min_lt_v8i32:
1044 ; AVX512-NEXT: vpminsd %ymm1, %ymm0, %ymm0
1046 %1 = icmp slt <8 x i32> %a, %b
1047 %2 = select <8 x i1> %1, <8 x i32> %a, <8 x i32> %b
1051 define <8 x i16> @min_lt_v8i16(<8 x i16> %a, <8 x i16> %b) {
1052 ; SSE-LABEL: min_lt_v8i16:
1054 ; SSE-NEXT: pminsw %xmm1, %xmm0
1057 ; AVX-LABEL: min_lt_v8i16:
1059 ; AVX-NEXT: vpminsw %xmm1, %xmm0, %xmm0
1061 %1 = icmp slt <8 x i16> %a, %b
1062 %2 = select <8 x i1> %1, <8 x i16> %a, <8 x i16> %b
1066 define <16 x i16> @min_lt_v16i16(<16 x i16> %a, <16 x i16> %b) {
1067 ; SSE-LABEL: min_lt_v16i16:
1069 ; SSE-NEXT: pminsw %xmm2, %xmm0
1070 ; SSE-NEXT: pminsw %xmm3, %xmm1
1073 ; AVX1-LABEL: min_lt_v16i16:
1075 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1076 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1077 ; AVX1-NEXT: vpminsw %xmm2, %xmm3, %xmm2
1078 ; AVX1-NEXT: vpminsw %xmm1, %xmm0, %xmm0
1079 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1082 ; AVX2-LABEL: min_lt_v16i16:
1084 ; AVX2-NEXT: vpminsw %ymm1, %ymm0, %ymm0
1087 ; AVX512-LABEL: min_lt_v16i16:
1089 ; AVX512-NEXT: vpminsw %ymm1, %ymm0, %ymm0
1091 %1 = icmp slt <16 x i16> %a, %b
1092 %2 = select <16 x i1> %1, <16 x i16> %a, <16 x i16> %b
1096 define <16 x i8> @min_lt_v16i8(<16 x i8> %a, <16 x i8> %b) {
1097 ; SSE2-LABEL: min_lt_v16i8:
1099 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1100 ; SSE2-NEXT: pcmpgtb %xmm0, %xmm2
1101 ; SSE2-NEXT: pand %xmm2, %xmm0
1102 ; SSE2-NEXT: pandn %xmm1, %xmm2
1103 ; SSE2-NEXT: por %xmm2, %xmm0
1106 ; SSE41-LABEL: min_lt_v16i8:
1108 ; SSE41-NEXT: pminsb %xmm1, %xmm0
1111 ; SSE42-LABEL: min_lt_v16i8:
1113 ; SSE42-NEXT: pminsb %xmm1, %xmm0
1116 ; AVX-LABEL: min_lt_v16i8:
1118 ; AVX-NEXT: vpminsb %xmm1, %xmm0, %xmm0
1120 %1 = icmp slt <16 x i8> %a, %b
1121 %2 = select <16 x i1> %1, <16 x i8> %a, <16 x i8> %b
1125 define <32 x i8> @min_lt_v32i8(<32 x i8> %a, <32 x i8> %b) {
1126 ; SSE2-LABEL: min_lt_v32i8:
1128 ; SSE2-NEXT: movdqa %xmm2, %xmm4
1129 ; SSE2-NEXT: pcmpgtb %xmm0, %xmm4
1130 ; SSE2-NEXT: pand %xmm4, %xmm0
1131 ; SSE2-NEXT: pandn %xmm2, %xmm4
1132 ; SSE2-NEXT: por %xmm4, %xmm0
1133 ; SSE2-NEXT: movdqa %xmm3, %xmm2
1134 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm2
1135 ; SSE2-NEXT: pand %xmm2, %xmm1
1136 ; SSE2-NEXT: pandn %xmm3, %xmm2
1137 ; SSE2-NEXT: por %xmm2, %xmm1
1140 ; SSE41-LABEL: min_lt_v32i8:
1142 ; SSE41-NEXT: pminsb %xmm2, %xmm0
1143 ; SSE41-NEXT: pminsb %xmm3, %xmm1
1146 ; SSE42-LABEL: min_lt_v32i8:
1148 ; SSE42-NEXT: pminsb %xmm2, %xmm0
1149 ; SSE42-NEXT: pminsb %xmm3, %xmm1
1152 ; AVX1-LABEL: min_lt_v32i8:
1154 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1155 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1156 ; AVX1-NEXT: vpminsb %xmm2, %xmm3, %xmm2
1157 ; AVX1-NEXT: vpminsb %xmm1, %xmm0, %xmm0
1158 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1161 ; AVX2-LABEL: min_lt_v32i8:
1163 ; AVX2-NEXT: vpminsb %ymm1, %ymm0, %ymm0
1166 ; AVX512-LABEL: min_lt_v32i8:
1168 ; AVX512-NEXT: vpminsb %ymm1, %ymm0, %ymm0
1170 %1 = icmp slt <32 x i8> %a, %b
1171 %2 = select <32 x i1> %1, <32 x i8> %a, <32 x i8> %b
1176 ; Signed Minimum (LE)
1179 define <2 x i64> @min_le_v2i64(<2 x i64> %a, <2 x i64> %b) {
1180 ; SSE2-LABEL: min_le_v2i64:
1182 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [2147483648,2147483648]
1183 ; SSE2-NEXT: movdqa %xmm0, %xmm3
1184 ; SSE2-NEXT: pxor %xmm2, %xmm3
1185 ; SSE2-NEXT: pxor %xmm1, %xmm2
1186 ; SSE2-NEXT: movdqa %xmm2, %xmm4
1187 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
1188 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
1189 ; SSE2-NEXT: pcmpeqd %xmm3, %xmm2
1190 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
1191 ; SSE2-NEXT: pand %xmm5, %xmm2
1192 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm4[1,1,3,3]
1193 ; SSE2-NEXT: por %xmm2, %xmm3
1194 ; SSE2-NEXT: pand %xmm3, %xmm0
1195 ; SSE2-NEXT: pandn %xmm1, %xmm3
1196 ; SSE2-NEXT: por %xmm3, %xmm0
1199 ; SSE41-LABEL: min_le_v2i64:
1201 ; SSE41-NEXT: movdqa %xmm0, %xmm2
1202 ; SSE41-NEXT: movdqa {{.*#+}} xmm0 = [2147483648,2147483648]
1203 ; SSE41-NEXT: movdqa %xmm2, %xmm3
1204 ; SSE41-NEXT: pxor %xmm0, %xmm3
1205 ; SSE41-NEXT: pxor %xmm1, %xmm0
1206 ; SSE41-NEXT: movdqa %xmm0, %xmm4
1207 ; SSE41-NEXT: pcmpgtd %xmm3, %xmm4
1208 ; SSE41-NEXT: pshufd {{.*#+}} xmm5 = xmm4[0,0,2,2]
1209 ; SSE41-NEXT: pcmpeqd %xmm3, %xmm0
1210 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1211 ; SSE41-NEXT: pand %xmm5, %xmm0
1212 ; SSE41-NEXT: por %xmm4, %xmm0
1213 ; SSE41-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1214 ; SSE41-NEXT: movapd %xmm1, %xmm0
1217 ; SSE42-LABEL: min_le_v2i64:
1219 ; SSE42-NEXT: movdqa %xmm0, %xmm2
1220 ; SSE42-NEXT: movdqa %xmm1, %xmm0
1221 ; SSE42-NEXT: pcmpgtq %xmm2, %xmm0
1222 ; SSE42-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1223 ; SSE42-NEXT: movapd %xmm1, %xmm0
1226 ; AVX1-LABEL: min_le_v2i64:
1228 ; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm2
1229 ; AVX1-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
1232 ; AVX2-LABEL: min_le_v2i64:
1234 ; AVX2-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm2
1235 ; AVX2-NEXT: vblendvpd %xmm2, %xmm0, %xmm1, %xmm0
1238 ; AVX512-LABEL: min_le_v2i64:
1240 ; AVX512-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1241 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1242 ; AVX512-NEXT: vpminsq %zmm1, %zmm0, %zmm0
1243 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1244 ; AVX512-NEXT: vzeroupper
1246 %1 = icmp sle <2 x i64> %a, %b
1247 %2 = select <2 x i1> %1, <2 x i64> %a, <2 x i64> %b
1251 define <4 x i64> @min_le_v4i64(<4 x i64> %a, <4 x i64> %b) {
1252 ; SSE2-LABEL: min_le_v4i64:
1254 ; SSE2-NEXT: movdqa {{.*#+}} xmm4 = [2147483648,2147483648]
1255 ; SSE2-NEXT: movdqa %xmm0, %xmm5
1256 ; SSE2-NEXT: pxor %xmm4, %xmm5
1257 ; SSE2-NEXT: movdqa %xmm2, %xmm6
1258 ; SSE2-NEXT: pxor %xmm4, %xmm6
1259 ; SSE2-NEXT: movdqa %xmm6, %xmm7
1260 ; SSE2-NEXT: pcmpgtd %xmm5, %xmm7
1261 ; SSE2-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
1262 ; SSE2-NEXT: pcmpeqd %xmm5, %xmm6
1263 ; SSE2-NEXT: pshufd {{.*#+}} xmm5 = xmm6[1,1,3,3]
1264 ; SSE2-NEXT: pand %xmm8, %xmm5
1265 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm7[1,1,3,3]
1266 ; SSE2-NEXT: por %xmm5, %xmm6
1267 ; SSE2-NEXT: pand %xmm6, %xmm0
1268 ; SSE2-NEXT: pandn %xmm2, %xmm6
1269 ; SSE2-NEXT: por %xmm6, %xmm0
1270 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1271 ; SSE2-NEXT: pxor %xmm4, %xmm2
1272 ; SSE2-NEXT: pxor %xmm3, %xmm4
1273 ; SSE2-NEXT: movdqa %xmm4, %xmm5
1274 ; SSE2-NEXT: pcmpgtd %xmm2, %xmm5
1275 ; SSE2-NEXT: pshufd {{.*#+}} xmm6 = xmm5[0,0,2,2]
1276 ; SSE2-NEXT: pcmpeqd %xmm2, %xmm4
1277 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm4[1,1,3,3]
1278 ; SSE2-NEXT: pand %xmm6, %xmm2
1279 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm5[1,1,3,3]
1280 ; SSE2-NEXT: por %xmm2, %xmm4
1281 ; SSE2-NEXT: pand %xmm4, %xmm1
1282 ; SSE2-NEXT: pandn %xmm3, %xmm4
1283 ; SSE2-NEXT: por %xmm4, %xmm1
1286 ; SSE41-LABEL: min_le_v4i64:
1288 ; SSE41-NEXT: movdqa %xmm0, %xmm4
1289 ; SSE41-NEXT: movdqa {{.*#+}} xmm5 = [2147483648,2147483648]
1290 ; SSE41-NEXT: pxor %xmm5, %xmm0
1291 ; SSE41-NEXT: movdqa %xmm2, %xmm6
1292 ; SSE41-NEXT: pxor %xmm5, %xmm6
1293 ; SSE41-NEXT: movdqa %xmm6, %xmm7
1294 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm7
1295 ; SSE41-NEXT: pshufd {{.*#+}} xmm8 = xmm7[0,0,2,2]
1296 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm6
1297 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm6[1,1,3,3]
1298 ; SSE41-NEXT: pand %xmm8, %xmm0
1299 ; SSE41-NEXT: por %xmm7, %xmm0
1300 ; SSE41-NEXT: blendvpd %xmm0, %xmm4, %xmm2
1301 ; SSE41-NEXT: movdqa %xmm1, %xmm0
1302 ; SSE41-NEXT: pxor %xmm5, %xmm0
1303 ; SSE41-NEXT: pxor %xmm3, %xmm5
1304 ; SSE41-NEXT: movdqa %xmm5, %xmm4
1305 ; SSE41-NEXT: pcmpgtd %xmm0, %xmm4
1306 ; SSE41-NEXT: pshufd {{.*#+}} xmm6 = xmm4[0,0,2,2]
1307 ; SSE41-NEXT: pcmpeqd %xmm0, %xmm5
1308 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm5[1,1,3,3]
1309 ; SSE41-NEXT: pand %xmm6, %xmm0
1310 ; SSE41-NEXT: por %xmm4, %xmm0
1311 ; SSE41-NEXT: blendvpd %xmm0, %xmm1, %xmm3
1312 ; SSE41-NEXT: movapd %xmm2, %xmm0
1313 ; SSE41-NEXT: movapd %xmm3, %xmm1
1316 ; SSE42-LABEL: min_le_v4i64:
1318 ; SSE42-NEXT: movdqa %xmm0, %xmm4
1319 ; SSE42-NEXT: movdqa %xmm2, %xmm0
1320 ; SSE42-NEXT: pcmpgtq %xmm4, %xmm0
1321 ; SSE42-NEXT: blendvpd %xmm0, %xmm4, %xmm2
1322 ; SSE42-NEXT: movdqa %xmm3, %xmm0
1323 ; SSE42-NEXT: pcmpgtq %xmm1, %xmm0
1324 ; SSE42-NEXT: blendvpd %xmm0, %xmm1, %xmm3
1325 ; SSE42-NEXT: movapd %xmm2, %xmm0
1326 ; SSE42-NEXT: movapd %xmm3, %xmm1
1329 ; AVX1-LABEL: min_le_v4i64:
1331 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1332 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
1333 ; AVX1-NEXT: vpcmpgtq %xmm2, %xmm3, %xmm2
1334 ; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm3
1335 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1336 ; AVX1-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
1339 ; AVX2-LABEL: min_le_v4i64:
1341 ; AVX2-NEXT: vpcmpgtq %ymm0, %ymm1, %ymm2
1342 ; AVX2-NEXT: vblendvpd %ymm2, %ymm0, %ymm1, %ymm0
1345 ; AVX512-LABEL: min_le_v4i64:
1347 ; AVX512-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
1348 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
1349 ; AVX512-NEXT: vpminsq %zmm1, %zmm0, %zmm0
1350 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1352 %1 = icmp sle <4 x i64> %a, %b
1353 %2 = select <4 x i1> %1, <4 x i64> %a, <4 x i64> %b
1357 define <4 x i32> @min_le_v4i32(<4 x i32> %a, <4 x i32> %b) {
1358 ; SSE2-LABEL: min_le_v4i32:
1360 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1361 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm2
1362 ; SSE2-NEXT: pand %xmm2, %xmm0
1363 ; SSE2-NEXT: pandn %xmm1, %xmm2
1364 ; SSE2-NEXT: por %xmm2, %xmm0
1367 ; SSE41-LABEL: min_le_v4i32:
1369 ; SSE41-NEXT: pminsd %xmm1, %xmm0
1372 ; SSE42-LABEL: min_le_v4i32:
1374 ; SSE42-NEXT: pminsd %xmm1, %xmm0
1377 ; AVX-LABEL: min_le_v4i32:
1379 ; AVX-NEXT: vpminsd %xmm1, %xmm0, %xmm0
1381 %1 = icmp sle <4 x i32> %a, %b
1382 %2 = select <4 x i1> %1, <4 x i32> %a, <4 x i32> %b
1386 define <8 x i32> @min_le_v8i32(<8 x i32> %a, <8 x i32> %b) {
1387 ; SSE2-LABEL: min_le_v8i32:
1389 ; SSE2-NEXT: movdqa %xmm2, %xmm4
1390 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm4
1391 ; SSE2-NEXT: pand %xmm4, %xmm0
1392 ; SSE2-NEXT: pandn %xmm2, %xmm4
1393 ; SSE2-NEXT: por %xmm4, %xmm0
1394 ; SSE2-NEXT: movdqa %xmm3, %xmm2
1395 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1396 ; SSE2-NEXT: pand %xmm2, %xmm1
1397 ; SSE2-NEXT: pandn %xmm3, %xmm2
1398 ; SSE2-NEXT: por %xmm2, %xmm1
1401 ; SSE41-LABEL: min_le_v8i32:
1403 ; SSE41-NEXT: pminsd %xmm2, %xmm0
1404 ; SSE41-NEXT: pminsd %xmm3, %xmm1
1407 ; SSE42-LABEL: min_le_v8i32:
1409 ; SSE42-NEXT: pminsd %xmm2, %xmm0
1410 ; SSE42-NEXT: pminsd %xmm3, %xmm1
1413 ; AVX1-LABEL: min_le_v8i32:
1415 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1416 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1417 ; AVX1-NEXT: vpminsd %xmm2, %xmm3, %xmm2
1418 ; AVX1-NEXT: vpminsd %xmm1, %xmm0, %xmm0
1419 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1422 ; AVX2-LABEL: min_le_v8i32:
1424 ; AVX2-NEXT: vpminsd %ymm1, %ymm0, %ymm0
1427 ; AVX512-LABEL: min_le_v8i32:
1429 ; AVX512-NEXT: vpminsd %ymm1, %ymm0, %ymm0
1431 %1 = icmp sle <8 x i32> %a, %b
1432 %2 = select <8 x i1> %1, <8 x i32> %a, <8 x i32> %b
1436 define <8 x i16> @min_le_v8i16(<8 x i16> %a, <8 x i16> %b) {
1437 ; SSE-LABEL: min_le_v8i16:
1439 ; SSE-NEXT: pminsw %xmm1, %xmm0
1442 ; AVX-LABEL: min_le_v8i16:
1444 ; AVX-NEXT: vpminsw %xmm1, %xmm0, %xmm0
1446 %1 = icmp sle <8 x i16> %a, %b
1447 %2 = select <8 x i1> %1, <8 x i16> %a, <8 x i16> %b
1451 define <16 x i16> @min_le_v16i16(<16 x i16> %a, <16 x i16> %b) {
1452 ; SSE-LABEL: min_le_v16i16:
1454 ; SSE-NEXT: pminsw %xmm2, %xmm0
1455 ; SSE-NEXT: pminsw %xmm3, %xmm1
1458 ; AVX1-LABEL: min_le_v16i16:
1460 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1461 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1462 ; AVX1-NEXT: vpminsw %xmm2, %xmm3, %xmm2
1463 ; AVX1-NEXT: vpminsw %xmm1, %xmm0, %xmm0
1464 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1467 ; AVX2-LABEL: min_le_v16i16:
1469 ; AVX2-NEXT: vpminsw %ymm1, %ymm0, %ymm0
1472 ; AVX512-LABEL: min_le_v16i16:
1474 ; AVX512-NEXT: vpminsw %ymm1, %ymm0, %ymm0
1476 %1 = icmp sle <16 x i16> %a, %b
1477 %2 = select <16 x i1> %1, <16 x i16> %a, <16 x i16> %b
1481 define <16 x i8> @min_le_v16i8(<16 x i8> %a, <16 x i8> %b) {
1482 ; SSE2-LABEL: min_le_v16i8:
1484 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1485 ; SSE2-NEXT: pcmpgtb %xmm0, %xmm2
1486 ; SSE2-NEXT: pand %xmm2, %xmm0
1487 ; SSE2-NEXT: pandn %xmm1, %xmm2
1488 ; SSE2-NEXT: por %xmm2, %xmm0
1491 ; SSE41-LABEL: min_le_v16i8:
1493 ; SSE41-NEXT: pminsb %xmm1, %xmm0
1496 ; SSE42-LABEL: min_le_v16i8:
1498 ; SSE42-NEXT: pminsb %xmm1, %xmm0
1501 ; AVX-LABEL: min_le_v16i8:
1503 ; AVX-NEXT: vpminsb %xmm1, %xmm0, %xmm0
1505 %1 = icmp sle <16 x i8> %a, %b
1506 %2 = select <16 x i1> %1, <16 x i8> %a, <16 x i8> %b
1510 define <32 x i8> @min_le_v32i8(<32 x i8> %a, <32 x i8> %b) {
1511 ; SSE2-LABEL: min_le_v32i8:
1513 ; SSE2-NEXT: movdqa %xmm2, %xmm4
1514 ; SSE2-NEXT: pcmpgtb %xmm0, %xmm4
1515 ; SSE2-NEXT: pand %xmm4, %xmm0
1516 ; SSE2-NEXT: pandn %xmm2, %xmm4
1517 ; SSE2-NEXT: por %xmm4, %xmm0
1518 ; SSE2-NEXT: movdqa %xmm3, %xmm2
1519 ; SSE2-NEXT: pcmpgtb %xmm1, %xmm2
1520 ; SSE2-NEXT: pand %xmm2, %xmm1
1521 ; SSE2-NEXT: pandn %xmm3, %xmm2
1522 ; SSE2-NEXT: por %xmm2, %xmm1
1525 ; SSE41-LABEL: min_le_v32i8:
1527 ; SSE41-NEXT: pminsb %xmm2, %xmm0
1528 ; SSE41-NEXT: pminsb %xmm3, %xmm1
1531 ; SSE42-LABEL: min_le_v32i8:
1533 ; SSE42-NEXT: pminsb %xmm2, %xmm0
1534 ; SSE42-NEXT: pminsb %xmm3, %xmm1
1537 ; AVX1-LABEL: min_le_v32i8:
1539 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
1540 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm3
1541 ; AVX1-NEXT: vpminsb %xmm2, %xmm3, %xmm2
1542 ; AVX1-NEXT: vpminsb %xmm1, %xmm0, %xmm0
1543 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1546 ; AVX2-LABEL: min_le_v32i8:
1548 ; AVX2-NEXT: vpminsb %ymm1, %ymm0, %ymm0
1551 ; AVX512-LABEL: min_le_v32i8:
1553 ; AVX512-NEXT: vpminsb %ymm1, %ymm0, %ymm0
1555 %1 = icmp sle <32 x i8> %a, %b
1556 %2 = select <32 x i1> %1, <32 x i8> %a, <32 x i8> %b
1564 define <2 x i64> @max_gt_v2i64c() {
1565 ; SSE-LABEL: max_gt_v2i64c:
1567 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551615,7]
1570 ; AVX-LABEL: max_gt_v2i64c:
1572 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [18446744073709551615,7]
1574 %1 = insertelement <2 x i64> <i64 -7, i64 7>, i64 -7, i32 0
1575 %2 = insertelement <2 x i64> <i64 -1, i64 1>, i64 -1, i32 0
1576 %3 = icmp sgt <2 x i64> %1, %2
1577 %4 = select <2 x i1> %3, <2 x i64> %1, <2 x i64> %2
1581 define <4 x i64> @max_gt_v4i64c() {
1582 ; SSE-LABEL: max_gt_v4i64c:
1584 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,7]
1585 ; SSE-NEXT: pcmpeqd %xmm0, %xmm0
1588 ; AVX-LABEL: max_gt_v4i64c:
1590 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [18446744073709551615,18446744073709551615,7,7]
1592 %1 = insertelement <4 x i64> <i64 -7, i64 -1, i64 1, i64 7>, i64 -7, i32 0
1593 %2 = insertelement <4 x i64> <i64 -1, i64 -7, i64 7, i64 1>, i64 -1, i32 0
1594 %3 = icmp sgt <4 x i64> %1, %2
1595 %4 = select <4 x i1> %3, <4 x i64> %1, <4 x i64> %2
1599 define <4 x i32> @max_gt_v4i32c() {
1600 ; SSE-LABEL: max_gt_v4i32c:
1602 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967295,4294967295,7,7]
1605 ; AVX-LABEL: max_gt_v4i32c:
1607 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [4294967295,4294967295,7,7]
1609 %1 = insertelement <4 x i32> <i32 -7, i32 -1, i32 1, i32 7>, i32 -7, i32 0
1610 %2 = insertelement <4 x i32> <i32 -1, i32 -7, i32 7, i32 1>, i32 -1, i32 0
1611 %3 = icmp sgt <4 x i32> %1, %2
1612 %4 = select <4 x i1> %3, <4 x i32> %1, <4 x i32> %2
1616 define <8 x i32> @max_gt_v8i32c() {
1617 ; SSE-LABEL: max_gt_v8i32c:
1619 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967295,4294967293,4294967293,4294967295]
1620 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,5,5,7]
1623 ; AVX-LABEL: max_gt_v8i32c:
1625 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [4294967295,4294967293,4294967293,4294967295,7,5,5,7]
1627 %1 = insertelement <8 x i32> <i32 -7, i32 -5, i32 -3, i32 -1, i32 1, i32 3, i32 5, i32 7>, i32 -7, i32 0
1628 %2 = insertelement <8 x i32> <i32 -1, i32 -3, i32 -5, i32 -7, i32 7, i32 5, i32 3, i32 1>, i32 -1, i32 0
1629 %3 = icmp sgt <8 x i32> %1, %2
1630 %4 = select <8 x i1> %3, <8 x i32> %1, <8 x i32> %2
1634 define <8 x i16> @max_gt_v8i16c() {
1635 ; SSE-LABEL: max_gt_v8i16c:
1637 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65535,65533,65533,65535,7,5,5,7]
1640 ; AVX-LABEL: max_gt_v8i16c:
1642 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [65535,65533,65533,65535,7,5,5,7]
1644 %1 = insertelement <8 x i16> <i16 -7, i16 -5, i16 -3, i16 -1, i16 1, i16 3, i16 5, i16 7>, i16 -7, i32 0
1645 %2 = insertelement <8 x i16> <i16 -1, i16 -3, i16 -5, i16 -7, i16 7, i16 5, i16 3, i16 1>, i16 -1, i32 0
1646 %3 = icmp sgt <8 x i16> %1, %2
1647 %4 = select <8 x i1> %3, <8 x i16> %1, <8 x i16> %2
1651 define <16 x i16> @max_gt_v16i16c() {
1652 ; SSE-LABEL: max_gt_v16i16c:
1654 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65535,65534,65533,65532,65533,65534,65535,0]
1655 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,6,5,4,5,6,7,8]
1658 ; AVX-LABEL: max_gt_v16i16c:
1660 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [65535,65534,65533,65532,65533,65534,65535,0,7,6,5,4,5,6,7,8]
1662 %1 = insertelement <16 x i16> <i16 -7, i16 -6, i16 -5, i16 -4, i16 -3, i16 -2, i16 -1, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, i16 -7, i32 0
1663 %2 = insertelement <16 x i16> <i16 -1, i16 -2, i16 -3, i16 -4, i16 -5, i16 -6, i16 -7, i16 0, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, i16 -1, i32 0
1664 %3 = icmp sgt <16 x i16> %1, %2
1665 %4 = select <16 x i1> %3, <16 x i16> %1, <16 x i16> %2
1669 define <16 x i8> @max_gt_v16i8c() {
1670 ; SSE-LABEL: max_gt_v16i8c:
1672 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [255,254,253,252,253,254,255,0,7,6,5,4,5,6,7,8]
1675 ; AVX-LABEL: max_gt_v16i8c:
1677 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [255,254,253,252,253,254,255,0,7,6,5,4,5,6,7,8]
1679 %1 = insertelement <16 x i8> <i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8>, i8 -7, i32 0
1680 %2 = insertelement <16 x i8> <i8 -1, i8 -2, i8 -3, i8 -4, i8 -5, i8 -6, i8 -7, i8 0, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, i8 -1, i32 0
1681 %3 = icmp sgt <16 x i8> %1, %2
1682 %4 = select <16 x i1> %3, <16 x i8> %1, <16 x i8> %2
1686 define <2 x i64> @max_ge_v2i64c() {
1687 ; SSE-LABEL: max_ge_v2i64c:
1689 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551615,7]
1692 ; AVX-LABEL: max_ge_v2i64c:
1694 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [18446744073709551615,7]
1696 %1 = insertelement <2 x i64> <i64 -7, i64 7>, i64 -7, i32 0
1697 %2 = insertelement <2 x i64> <i64 -1, i64 1>, i64 -1, i32 0
1698 %3 = icmp sge <2 x i64> %1, %2
1699 %4 = select <2 x i1> %3, <2 x i64> %1, <2 x i64> %2
1703 define <4 x i64> @max_ge_v4i64c() {
1704 ; SSE-LABEL: max_ge_v4i64c:
1706 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,7]
1707 ; SSE-NEXT: pcmpeqd %xmm0, %xmm0
1710 ; AVX-LABEL: max_ge_v4i64c:
1712 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [18446744073709551615,18446744073709551615,7,7]
1714 %1 = insertelement <4 x i64> <i64 -7, i64 -1, i64 1, i64 7>, i64 -7, i32 0
1715 %2 = insertelement <4 x i64> <i64 -1, i64 -7, i64 7, i64 1>, i64 -1, i32 0
1716 %3 = icmp sge <4 x i64> %1, %2
1717 %4 = select <4 x i1> %3, <4 x i64> %1, <4 x i64> %2
1721 define <4 x i32> @max_ge_v4i32c() {
1722 ; SSE-LABEL: max_ge_v4i32c:
1724 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967295,4294967295,7,7]
1727 ; AVX-LABEL: max_ge_v4i32c:
1729 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [4294967295,4294967295,7,7]
1731 %1 = insertelement <4 x i32> <i32 -7, i32 -1, i32 1, i32 7>, i32 -7, i32 0
1732 %2 = insertelement <4 x i32> <i32 -1, i32 -7, i32 7, i32 1>, i32 -1, i32 0
1733 %3 = icmp sge <4 x i32> %1, %2
1734 %4 = select <4 x i1> %3, <4 x i32> %1, <4 x i32> %2
1738 define <8 x i32> @max_ge_v8i32c() {
1739 ; SSE-LABEL: max_ge_v8i32c:
1741 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967295,4294967293,4294967293,4294967295]
1742 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,5,5,7]
1745 ; AVX-LABEL: max_ge_v8i32c:
1747 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [4294967295,4294967293,4294967293,4294967295,7,5,5,7]
1749 %1 = insertelement <8 x i32> <i32 -7, i32 -5, i32 -3, i32 -1, i32 1, i32 3, i32 5, i32 7>, i32 -7, i32 0
1750 %2 = insertelement <8 x i32> <i32 -1, i32 -3, i32 -5, i32 -7, i32 7, i32 5, i32 3, i32 1>, i32 -1, i32 0
1751 %3 = icmp sge <8 x i32> %1, %2
1752 %4 = select <8 x i1> %3, <8 x i32> %1, <8 x i32> %2
1756 define <8 x i16> @max_ge_v8i16c() {
1757 ; SSE-LABEL: max_ge_v8i16c:
1759 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65535,65533,65533,65535,7,5,5,7]
1762 ; AVX-LABEL: max_ge_v8i16c:
1764 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [65535,65533,65533,65535,7,5,5,7]
1766 %1 = insertelement <8 x i16> <i16 -7, i16 -5, i16 -3, i16 -1, i16 1, i16 3, i16 5, i16 7>, i16 -7, i32 0
1767 %2 = insertelement <8 x i16> <i16 -1, i16 -3, i16 -5, i16 -7, i16 7, i16 5, i16 3, i16 1>, i16 -1, i32 0
1768 %3 = icmp sge <8 x i16> %1, %2
1769 %4 = select <8 x i1> %3, <8 x i16> %1, <8 x i16> %2
1773 define <16 x i16> @max_ge_v16i16c() {
1774 ; SSE-LABEL: max_ge_v16i16c:
1776 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65535,65534,65533,65532,65533,65534,65535,0]
1777 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [7,6,5,4,5,6,7,8]
1780 ; AVX-LABEL: max_ge_v16i16c:
1782 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [65535,65534,65533,65532,65533,65534,65535,0,7,6,5,4,5,6,7,8]
1784 %1 = insertelement <16 x i16> <i16 -7, i16 -6, i16 -5, i16 -4, i16 -3, i16 -2, i16 -1, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, i16 -7, i32 0
1785 %2 = insertelement <16 x i16> <i16 -1, i16 -2, i16 -3, i16 -4, i16 -5, i16 -6, i16 -7, i16 0, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, i16 -1, i32 0
1786 %3 = icmp sge <16 x i16> %1, %2
1787 %4 = select <16 x i1> %3, <16 x i16> %1, <16 x i16> %2
1791 define <16 x i8> @max_ge_v16i8c() {
1792 ; SSE-LABEL: max_ge_v16i8c:
1794 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [255,254,253,252,253,254,255,0,7,6,5,4,5,6,7,8]
1797 ; AVX-LABEL: max_ge_v16i8c:
1799 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [255,254,253,252,253,254,255,0,7,6,5,4,5,6,7,8]
1801 %1 = insertelement <16 x i8> <i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8>, i8 -7, i32 0
1802 %2 = insertelement <16 x i8> <i8 -1, i8 -2, i8 -3, i8 -4, i8 -5, i8 -6, i8 -7, i8 0, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, i8 -1, i32 0
1803 %3 = icmp sge <16 x i8> %1, %2
1804 %4 = select <16 x i1> %3, <16 x i8> %1, <16 x i8> %2
1808 define <2 x i64> @min_lt_v2i64c() {
1809 ; SSE-LABEL: min_lt_v2i64c:
1811 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551609,1]
1814 ; AVX-LABEL: min_lt_v2i64c:
1816 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [18446744073709551609,1]
1818 %1 = insertelement <2 x i64> <i64 -7, i64 7>, i64 -7, i32 0
1819 %2 = insertelement <2 x i64> <i64 -1, i64 1>, i64 -1, i32 0
1820 %3 = icmp slt <2 x i64> %1, %2
1821 %4 = select <2 x i1> %3, <2 x i64> %1, <2 x i64> %2
1825 define <4 x i64> @min_lt_v4i64c() {
1826 ; SSE-LABEL: min_lt_v4i64c:
1828 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551609,18446744073709551609]
1829 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,1]
1832 ; AVX-LABEL: min_lt_v4i64c:
1834 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [18446744073709551609,18446744073709551609,1,1]
1836 %1 = insertelement <4 x i64> <i64 -7, i64 -1, i64 1, i64 7>, i64 -7, i32 0
1837 %2 = insertelement <4 x i64> <i64 -1, i64 -7, i64 7, i64 1>, i64 -1, i32 0
1838 %3 = icmp slt <4 x i64> %1, %2
1839 %4 = select <4 x i1> %3, <4 x i64> %1, <4 x i64> %2
1843 define <4 x i32> @min_lt_v4i32c() {
1844 ; SSE-LABEL: min_lt_v4i32c:
1846 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967289,4294967289,1,1]
1849 ; AVX-LABEL: min_lt_v4i32c:
1851 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [4294967289,4294967289,1,1]
1853 %1 = insertelement <4 x i32> <i32 -7, i32 -1, i32 1, i32 7>, i32 -7, i32 0
1854 %2 = insertelement <4 x i32> <i32 -1, i32 -7, i32 7, i32 1>, i32 -1, i32 0
1855 %3 = icmp slt <4 x i32> %1, %2
1856 %4 = select <4 x i1> %3, <4 x i32> %1, <4 x i32> %2
1860 define <8 x i32> @min_lt_v8i32c() {
1861 ; SSE-LABEL: min_lt_v8i32c:
1863 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967289,4294967291,4294967291,4294967289]
1864 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,3,3,1]
1867 ; AVX-LABEL: min_lt_v8i32c:
1869 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [4294967289,4294967291,4294967291,4294967289,1,3,3,1]
1871 %1 = insertelement <8 x i32> <i32 -7, i32 -5, i32 -3, i32 -1, i32 1, i32 3, i32 5, i32 7>, i32 -7, i32 0
1872 %2 = insertelement <8 x i32> <i32 -1, i32 -3, i32 -5, i32 -7, i32 7, i32 5, i32 3, i32 1>, i32 -1, i32 0
1873 %3 = icmp slt <8 x i32> %1, %2
1874 %4 = select <8 x i1> %3, <8 x i32> %1, <8 x i32> %2
1878 define <8 x i16> @min_lt_v8i16c() {
1879 ; SSE-LABEL: min_lt_v8i16c:
1881 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65529,65531,65531,65529,1,3,3,1]
1884 ; AVX-LABEL: min_lt_v8i16c:
1886 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [65529,65531,65531,65529,1,3,3,1]
1888 %1 = insertelement <8 x i16> <i16 -7, i16 -5, i16 -3, i16 -1, i16 1, i16 3, i16 5, i16 7>, i16 -7, i32 0
1889 %2 = insertelement <8 x i16> <i16 -1, i16 -3, i16 -5, i16 -7, i16 7, i16 5, i16 3, i16 1>, i16 -1, i32 0
1890 %3 = icmp slt <8 x i16> %1, %2
1891 %4 = select <8 x i1> %3, <8 x i16> %1, <8 x i16> %2
1895 define <16 x i16> @min_lt_v16i16c() {
1896 ; SSE-LABEL: min_lt_v16i16c:
1898 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65529,65530,65531,65532,65531,65530,65529,0]
1899 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,2,3,4,3,2,1,0]
1902 ; AVX-LABEL: min_lt_v16i16c:
1904 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [65529,65530,65531,65532,65531,65530,65529,0,1,2,3,4,3,2,1,0]
1906 %1 = insertelement <16 x i16> <i16 -7, i16 -6, i16 -5, i16 -4, i16 -3, i16 -2, i16 -1, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, i16 -7, i32 0
1907 %2 = insertelement <16 x i16> <i16 -1, i16 -2, i16 -3, i16 -4, i16 -5, i16 -6, i16 -7, i16 0, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, i16 -1, i32 0
1908 %3 = icmp slt <16 x i16> %1, %2
1909 %4 = select <16 x i1> %3, <16 x i16> %1, <16 x i16> %2
1913 define <16 x i8> @min_lt_v16i8c() {
1914 ; SSE-LABEL: min_lt_v16i8c:
1916 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [249,250,251,252,251,250,249,0,1,2,3,4,3,2,1,0]
1919 ; AVX-LABEL: min_lt_v16i8c:
1921 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [249,250,251,252,251,250,249,0,1,2,3,4,3,2,1,0]
1923 %1 = insertelement <16 x i8> <i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8>, i8 -7, i32 0
1924 %2 = insertelement <16 x i8> <i8 -1, i8 -2, i8 -3, i8 -4, i8 -5, i8 -6, i8 -7, i8 0, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, i8 -1, i32 0
1925 %3 = icmp slt <16 x i8> %1, %2
1926 %4 = select <16 x i1> %3, <16 x i8> %1, <16 x i8> %2
1930 define <2 x i64> @min_le_v2i64c() {
1931 ; SSE-LABEL: min_le_v2i64c:
1933 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551609,1]
1936 ; AVX-LABEL: min_le_v2i64c:
1938 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [18446744073709551609,1]
1940 %1 = insertelement <2 x i64> <i64 -7, i64 7>, i64 -7, i32 0
1941 %2 = insertelement <2 x i64> <i64 -1, i64 1>, i64 -1, i32 0
1942 %3 = icmp sle <2 x i64> %1, %2
1943 %4 = select <2 x i1> %3, <2 x i64> %1, <2 x i64> %2
1947 define <4 x i64> @min_le_v4i64c() {
1948 ; SSE-LABEL: min_le_v4i64c:
1950 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [18446744073709551609,18446744073709551609]
1951 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,1]
1954 ; AVX-LABEL: min_le_v4i64c:
1956 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [18446744073709551609,18446744073709551609,1,1]
1958 %1 = insertelement <4 x i64> <i64 -7, i64 -1, i64 1, i64 7>, i64 -7, i32 0
1959 %2 = insertelement <4 x i64> <i64 -1, i64 -7, i64 7, i64 1>, i64 -1, i32 0
1960 %3 = icmp sle <4 x i64> %1, %2
1961 %4 = select <4 x i1> %3, <4 x i64> %1, <4 x i64> %2
1965 define <4 x i32> @min_le_v4i32c() {
1966 ; SSE-LABEL: min_le_v4i32c:
1968 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967289,4294967289,1,1]
1971 ; AVX-LABEL: min_le_v4i32c:
1973 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [4294967289,4294967289,1,1]
1975 %1 = insertelement <4 x i32> <i32 -7, i32 -1, i32 1, i32 7>, i32 -7, i32 0
1976 %2 = insertelement <4 x i32> <i32 -1, i32 -7, i32 7, i32 1>, i32 -1, i32 0
1977 %3 = icmp sle <4 x i32> %1, %2
1978 %4 = select <4 x i1> %3, <4 x i32> %1, <4 x i32> %2
1982 define <8 x i32> @min_le_v8i32c() {
1983 ; SSE-LABEL: min_le_v8i32c:
1985 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [4294967289,4294967291,4294967291,4294967289]
1986 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,3,3,1]
1989 ; AVX-LABEL: min_le_v8i32c:
1991 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [4294967289,4294967291,4294967291,4294967289,1,3,3,1]
1993 %1 = insertelement <8 x i32> <i32 -7, i32 -5, i32 -3, i32 -1, i32 1, i32 3, i32 5, i32 7>, i32 -7, i32 0
1994 %2 = insertelement <8 x i32> <i32 -1, i32 -3, i32 -5, i32 -7, i32 7, i32 5, i32 3, i32 1>, i32 -1, i32 0
1995 %3 = icmp sle <8 x i32> %1, %2
1996 %4 = select <8 x i1> %3, <8 x i32> %1, <8 x i32> %2
2000 define <8 x i16> @min_le_v8i16c() {
2001 ; SSE-LABEL: min_le_v8i16c:
2003 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65529,65531,65531,65529,1,3,3,1]
2006 ; AVX-LABEL: min_le_v8i16c:
2008 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [65529,65531,65531,65529,1,3,3,1]
2010 %1 = insertelement <8 x i16> <i16 -7, i16 -5, i16 -3, i16 -1, i16 1, i16 3, i16 5, i16 7>, i16 -7, i32 0
2011 %2 = insertelement <8 x i16> <i16 -1, i16 -3, i16 -5, i16 -7, i16 7, i16 5, i16 3, i16 1>, i16 -1, i32 0
2012 %3 = icmp sle <8 x i16> %1, %2
2013 %4 = select <8 x i1> %3, <8 x i16> %1, <8 x i16> %2
2017 define <16 x i16> @min_le_v16i16c() {
2018 ; SSE-LABEL: min_le_v16i16c:
2020 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [65529,65530,65531,65532,65531,65530,65529,0]
2021 ; SSE-NEXT: movaps {{.*#+}} xmm1 = [1,2,3,4,3,2,1,0]
2024 ; AVX-LABEL: min_le_v16i16c:
2026 ; AVX-NEXT: vmovaps {{.*#+}} ymm0 = [65529,65530,65531,65532,65531,65530,65529,0,1,2,3,4,3,2,1,0]
2028 %1 = insertelement <16 x i16> <i16 -7, i16 -6, i16 -5, i16 -4, i16 -3, i16 -2, i16 -1, i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, i16 -7, i32 0
2029 %2 = insertelement <16 x i16> <i16 -1, i16 -2, i16 -3, i16 -4, i16 -5, i16 -6, i16 -7, i16 0, i16 7, i16 6, i16 5, i16 4, i16 3, i16 2, i16 1, i16 0>, i16 -1, i32 0
2030 %3 = icmp sle <16 x i16> %1, %2
2031 %4 = select <16 x i1> %3, <16 x i16> %1, <16 x i16> %2
2035 define <16 x i8> @min_le_v16i8c() {
2036 ; SSE-LABEL: min_le_v16i8c:
2038 ; SSE-NEXT: movaps {{.*#+}} xmm0 = [249,250,251,252,251,250,249,0,1,2,3,4,3,2,1,0]
2041 ; AVX-LABEL: min_le_v16i8c:
2043 ; AVX-NEXT: vmovaps {{.*#+}} xmm0 = [249,250,251,252,251,250,249,0,1,2,3,4,3,2,1,0]
2045 %1 = insertelement <16 x i8> <i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1, i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8>, i8 -7, i32 0
2046 %2 = insertelement <16 x i8> <i8 -1, i8 -2, i8 -3, i8 -4, i8 -5, i8 -6, i8 -7, i8 0, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, i8 -1, i32 0
2047 %3 = icmp sle <16 x i8> %1, %2
2048 %4 = select <16 x i1> %3, <16 x i8> %1, <16 x i8> %2