1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skx | FileCheck %s --check-prefix=CHECK --check-prefix=VLX
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=NoVLX
5 define <4 x i64> @test256_1(<4 x i64> %x, <4 x i64> %y) nounwind {
6 ; VLX-LABEL: test256_1:
8 ; VLX-NEXT: vpcmpeqq %ymm1, %ymm0, %k1
9 ; VLX-NEXT: vpblendmq %ymm0, %ymm1, %ymm0 {%k1}
12 ; NoVLX-LABEL: test256_1:
14 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
15 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
16 ; NoVLX-NEXT: vpcmpeqq %zmm1, %zmm0, %k1
17 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
18 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
20 %mask = icmp eq <4 x i64> %x, %y
21 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %y
25 define <4 x i64> @test256_2(<4 x i64> %x, <4 x i64> %y, <4 x i64> %x1) nounwind {
26 ; VLX-LABEL: test256_2:
28 ; VLX-NEXT: vpcmpgtq %ymm1, %ymm0, %k1
29 ; VLX-NEXT: vpblendmq %ymm2, %ymm1, %ymm0 {%k1}
32 ; NoVLX-LABEL: test256_2:
34 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
35 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
36 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
37 ; NoVLX-NEXT: vpcmpgtq %zmm1, %zmm0, %k1
38 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
39 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
41 %mask = icmp sgt <4 x i64> %x, %y
42 %max = select <4 x i1> %mask, <4 x i64> %x1, <4 x i64> %y
46 define <8 x i32> @test256_3(<8 x i32> %x, <8 x i32> %y, <8 x i32> %x1) nounwind {
47 ; VLX-LABEL: test256_3:
49 ; VLX-NEXT: vpcmpnltd %ymm1, %ymm0, %k1
50 ; VLX-NEXT: vpblendmd %ymm2, %ymm1, %ymm0 {%k1}
53 ; NoVLX-LABEL: test256_3:
55 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
56 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
57 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
58 ; NoVLX-NEXT: vpcmpnltd %zmm1, %zmm0, %k1
59 ; NoVLX-NEXT: vpblendmd %zmm2, %zmm1, %zmm0 {%k1}
60 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
62 %mask = icmp sge <8 x i32> %x, %y
63 %max = select <8 x i1> %mask, <8 x i32> %x1, <8 x i32> %y
67 define <4 x i64> @test256_4(<4 x i64> %x, <4 x i64> %y, <4 x i64> %x1) nounwind {
68 ; VLX-LABEL: test256_4:
70 ; VLX-NEXT: vpcmpnleuq %ymm1, %ymm0, %k1
71 ; VLX-NEXT: vpblendmq %ymm2, %ymm1, %ymm0 {%k1}
74 ; NoVLX-LABEL: test256_4:
76 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
77 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
78 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
79 ; NoVLX-NEXT: vpcmpnleuq %zmm1, %zmm0, %k1
80 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
81 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
83 %mask = icmp ugt <4 x i64> %x, %y
84 %max = select <4 x i1> %mask, <4 x i64> %x1, <4 x i64> %y
88 define <8 x i32> @test256_5(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
89 ; VLX-LABEL: test256_5:
91 ; VLX-NEXT: vpcmpeqd (%rdi), %ymm0, %k1
92 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
95 ; NoVLX-LABEL: test256_5:
97 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
98 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
99 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
100 ; NoVLX-NEXT: vpcmpeqd %zmm2, %zmm0, %k1
101 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
102 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
104 %y = load <8 x i32>, <8 x i32>* %yp, align 4
105 %mask = icmp eq <8 x i32> %x, %y
106 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
110 define <8 x i32> @test256_5b(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
111 ; VLX-LABEL: test256_5b:
113 ; VLX-NEXT: vpcmpeqd (%rdi), %ymm0, %k1
114 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
117 ; NoVLX-LABEL: test256_5b:
119 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
120 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
121 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
122 ; NoVLX-NEXT: vpcmpeqd %zmm0, %zmm2, %k1
123 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
124 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
126 %y = load <8 x i32>, <8 x i32>* %yp, align 4
127 %mask = icmp eq <8 x i32> %y, %x
128 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
132 define <8 x i32> @test256_6(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
133 ; VLX-LABEL: test256_6:
135 ; VLX-NEXT: vpcmpgtd (%rdi), %ymm0, %k1
136 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
139 ; NoVLX-LABEL: test256_6:
141 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
142 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
143 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
144 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
145 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
146 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
148 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
149 %mask = icmp sgt <8 x i32> %x, %y
150 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
154 define <8 x i32> @test256_6b(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
155 ; VLX-LABEL: test256_6b:
157 ; VLX-NEXT: vpcmpgtd (%rdi), %ymm0, %k1
158 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
161 ; NoVLX-LABEL: test256_6b:
163 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
164 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
165 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
166 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
167 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
168 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
170 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
171 %mask = icmp slt <8 x i32> %y, %x
172 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
176 define <8 x i32> @test256_7(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
177 ; VLX-LABEL: test256_7:
179 ; VLX-NEXT: vpcmpled (%rdi), %ymm0, %k1
180 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
183 ; NoVLX-LABEL: test256_7:
185 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
186 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
187 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
188 ; NoVLX-NEXT: vpcmpled %zmm2, %zmm0, %k1
189 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
190 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
192 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
193 %mask = icmp sle <8 x i32> %x, %y
194 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
198 define <8 x i32> @test256_7b(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
199 ; VLX-LABEL: test256_7b:
201 ; VLX-NEXT: vpcmpled (%rdi), %ymm0, %k1
202 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
205 ; NoVLX-LABEL: test256_7b:
207 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
208 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
209 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
210 ; NoVLX-NEXT: vpcmpnltd %zmm0, %zmm2, %k1
211 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
212 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
214 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
215 %mask = icmp sge <8 x i32> %y, %x
216 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
220 define <8 x i32> @test256_8(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
221 ; VLX-LABEL: test256_8:
223 ; VLX-NEXT: vpcmpleud (%rdi), %ymm0, %k1
224 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
227 ; NoVLX-LABEL: test256_8:
229 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
230 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
231 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
232 ; NoVLX-NEXT: vpcmpleud %zmm2, %zmm0, %k1
233 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
234 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
236 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
237 %mask = icmp ule <8 x i32> %x, %y
238 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
242 define <8 x i32> @test256_8b(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %y.ptr) nounwind {
243 ; VLX-LABEL: test256_8b:
245 ; VLX-NEXT: vpcmpleud (%rdi), %ymm0, %k1
246 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
249 ; NoVLX-LABEL: test256_8b:
251 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
252 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
253 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
254 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
255 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
256 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
258 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
259 %mask = icmp uge <8 x i32> %y, %x
260 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
264 define <8 x i32> @test256_9(<8 x i32> %x, <8 x i32> %y, <8 x i32> %x1, <8 x i32> %y1) nounwind {
265 ; VLX-LABEL: test256_9:
267 ; VLX-NEXT: vpcmpeqd %ymm1, %ymm0, %k1
268 ; VLX-NEXT: vpcmpeqd %ymm3, %ymm2, %k1 {%k1}
269 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
272 ; NoVLX-LABEL: test256_9:
274 ; NoVLX-NEXT: # kill: def $ymm3 killed $ymm3 def $zmm3
275 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
276 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
277 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
278 ; NoVLX-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
279 ; NoVLX-NEXT: vpcmpeqd %zmm3, %zmm2, %k1 {%k1}
280 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
281 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
283 %mask1 = icmp eq <8 x i32> %x1, %y1
284 %mask0 = icmp eq <8 x i32> %x, %y
285 %mask = select <8 x i1> %mask0, <8 x i1> %mask1, <8 x i1> zeroinitializer
286 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %y
290 define <4 x i64> @test256_10(<4 x i64> %x, <4 x i64> %y, <4 x i64> %x1, <4 x i64> %y1) nounwind {
291 ; VLX-LABEL: test256_10:
293 ; VLX-NEXT: vpcmpleq %ymm1, %ymm0, %k1
294 ; VLX-NEXT: vpcmpnltq %ymm3, %ymm2, %k1 {%k1}
295 ; VLX-NEXT: vpblendmq %ymm0, %ymm2, %ymm0 {%k1}
298 ; NoVLX-LABEL: test256_10:
300 ; NoVLX-NEXT: # kill: def $ymm3 killed $ymm3 def $zmm3
301 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
302 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
303 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
304 ; NoVLX-NEXT: vpcmpleq %zmm1, %zmm0, %k1
305 ; NoVLX-NEXT: vpcmpnltq %zmm3, %zmm2, %k1 {%k1}
306 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm2, %zmm0 {%k1}
307 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
309 %mask1 = icmp sge <4 x i64> %x1, %y1
310 %mask0 = icmp sle <4 x i64> %x, %y
311 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
312 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
316 define <4 x i64> @test256_11(<4 x i64> %x, <4 x i64>* %y.ptr, <4 x i64> %x1, <4 x i64> %y1) nounwind {
317 ; VLX-LABEL: test256_11:
319 ; VLX-NEXT: vpcmpgtq %ymm2, %ymm1, %k1
320 ; VLX-NEXT: vpcmpgtq (%rdi), %ymm0, %k1 {%k1}
321 ; VLX-NEXT: vpblendmq %ymm0, %ymm1, %ymm0 {%k1}
324 ; NoVLX-LABEL: test256_11:
326 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
327 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
328 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
329 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm3
330 ; NoVLX-NEXT: vpcmpgtq %zmm3, %zmm0, %k1
331 ; NoVLX-NEXT: vpcmpgtq %zmm2, %zmm1, %k1 {%k1}
332 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
333 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
335 %mask1 = icmp sgt <4 x i64> %x1, %y1
336 %y = load <4 x i64>, <4 x i64>* %y.ptr, align 4
337 %mask0 = icmp sgt <4 x i64> %x, %y
338 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
339 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
343 define <8 x i32> @test256_12(<8 x i32> %x, <8 x i32>* %y.ptr, <8 x i32> %x1, <8 x i32> %y1) nounwind {
344 ; VLX-LABEL: test256_12:
346 ; VLX-NEXT: vpcmpnltd %ymm2, %ymm1, %k1
347 ; VLX-NEXT: vpcmpleud (%rdi), %ymm0, %k1 {%k1}
348 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
351 ; NoVLX-LABEL: test256_12:
353 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
354 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
355 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
356 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm3
357 ; NoVLX-NEXT: vpcmpleud %zmm3, %zmm0, %k1
358 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1 {%k1}
359 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
360 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
362 %mask1 = icmp sge <8 x i32> %x1, %y1
363 %y = load <8 x i32>, <8 x i32>* %y.ptr, align 4
364 %mask0 = icmp ule <8 x i32> %x, %y
365 %mask = select <8 x i1> %mask0, <8 x i1> %mask1, <8 x i1> zeroinitializer
366 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
370 define <4 x i64> @test256_13(<4 x i64> %x, <4 x i64> %x1, i64* %yb.ptr) nounwind {
371 ; VLX-LABEL: test256_13:
373 ; VLX-NEXT: vpcmpeqq (%rdi){1to4}, %ymm0, %k1
374 ; VLX-NEXT: vpblendmq %ymm0, %ymm1, %ymm0 {%k1}
377 ; NoVLX-LABEL: test256_13:
379 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
380 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
381 ; NoVLX-NEXT: vpcmpeqq (%rdi){1to8}, %zmm0, %k1
382 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
383 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
385 %yb = load i64, i64* %yb.ptr, align 4
386 %y.0 = insertelement <4 x i64> undef, i64 %yb, i32 0
387 %y = shufflevector <4 x i64> %y.0, <4 x i64> undef, <4 x i32> zeroinitializer
388 %mask = icmp eq <4 x i64> %x, %y
389 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
393 define <8 x i32> @test256_14(<8 x i32> %x, i32* %yb.ptr, <8 x i32> %x1) nounwind {
394 ; VLX-LABEL: test256_14:
396 ; VLX-NEXT: vpcmpled (%rdi){1to8}, %ymm0, %k1
397 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
400 ; NoVLX-LABEL: test256_14:
402 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
403 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
404 ; NoVLX-NEXT: vpcmpled (%rdi){1to16}, %zmm0, %k1
405 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
406 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
408 %yb = load i32, i32* %yb.ptr, align 4
409 %y.0 = insertelement <8 x i32> undef, i32 %yb, i32 0
410 %y = shufflevector <8 x i32> %y.0, <8 x i32> undef, <8 x i32> zeroinitializer
411 %mask = icmp sle <8 x i32> %x, %y
412 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
416 define <8 x i32> @test256_15(<8 x i32> %x, i32* %yb.ptr, <8 x i32> %x1, <8 x i32> %y1) nounwind {
417 ; VLX-LABEL: test256_15:
419 ; VLX-NEXT: vpcmpnltd %ymm2, %ymm1, %k1
420 ; VLX-NEXT: vpcmpgtd (%rdi){1to8}, %ymm0, %k1 {%k1}
421 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
424 ; NoVLX-LABEL: test256_15:
426 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
427 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
428 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
429 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1
430 ; NoVLX-NEXT: vpcmpgtd (%rdi){1to16}, %zmm0, %k1 {%k1}
431 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
432 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
434 %mask1 = icmp sge <8 x i32> %x1, %y1
435 %yb = load i32, i32* %yb.ptr, align 4
436 %y.0 = insertelement <8 x i32> undef, i32 %yb, i32 0
437 %y = shufflevector <8 x i32> %y.0, <8 x i32> undef, <8 x i32> zeroinitializer
438 %mask0 = icmp sgt <8 x i32> %x, %y
439 %mask = select <8 x i1> %mask0, <8 x i1> %mask1, <8 x i1> zeroinitializer
440 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
444 define <4 x i64> @test256_16(<4 x i64> %x, i64* %yb.ptr, <4 x i64> %x1, <4 x i64> %y1) nounwind {
445 ; VLX-LABEL: test256_16:
447 ; VLX-NEXT: vpcmpnltq %ymm2, %ymm1, %k1
448 ; VLX-NEXT: vpcmpgtq (%rdi){1to4}, %ymm0, %k1 {%k1}
449 ; VLX-NEXT: vpblendmq %ymm0, %ymm1, %ymm0 {%k1}
452 ; NoVLX-LABEL: test256_16:
454 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
455 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
456 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
457 ; NoVLX-NEXT: vpcmpnltq %zmm2, %zmm1, %k1
458 ; NoVLX-NEXT: vpcmpgtq (%rdi){1to8}, %zmm0, %k1 {%k1}
459 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
460 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
462 %mask1 = icmp sge <4 x i64> %x1, %y1
463 %yb = load i64, i64* %yb.ptr, align 4
464 %y.0 = insertelement <4 x i64> undef, i64 %yb, i32 0
465 %y = shufflevector <4 x i64> %y.0, <4 x i64> undef, <4 x i32> zeroinitializer
466 %mask0 = icmp sgt <4 x i64> %x, %y
467 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
468 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
472 define <8 x i32> @test256_17(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
473 ; VLX-LABEL: test256_17:
475 ; VLX-NEXT: vpcmpneqd (%rdi), %ymm0, %k1
476 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
479 ; NoVLX-LABEL: test256_17:
481 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
482 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
483 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
484 ; NoVLX-NEXT: vpcmpneqd %zmm2, %zmm0, %k1
485 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
486 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
488 %y = load <8 x i32>, <8 x i32>* %yp, align 4
489 %mask = icmp ne <8 x i32> %x, %y
490 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
494 define <8 x i32> @test256_18(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
495 ; VLX-LABEL: test256_18:
497 ; VLX-NEXT: vpcmpneqd (%rdi), %ymm0, %k1
498 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
501 ; NoVLX-LABEL: test256_18:
503 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
504 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
505 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
506 ; NoVLX-NEXT: vpcmpneqd %zmm0, %zmm2, %k1
507 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
508 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
510 %y = load <8 x i32>, <8 x i32>* %yp, align 4
511 %mask = icmp ne <8 x i32> %y, %x
512 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
516 define <8 x i32> @test256_19(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
517 ; VLX-LABEL: test256_19:
519 ; VLX-NEXT: vpcmpnltud (%rdi), %ymm0, %k1
520 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
523 ; NoVLX-LABEL: test256_19:
525 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
526 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
527 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
528 ; NoVLX-NEXT: vpcmpnltud %zmm2, %zmm0, %k1
529 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
530 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
532 %y = load <8 x i32>, <8 x i32>* %yp, align 4
533 %mask = icmp uge <8 x i32> %x, %y
534 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
538 define <8 x i32> @test256_20(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
539 ; VLX-LABEL: test256_20:
541 ; VLX-NEXT: vpcmpleud (%rdi), %ymm0, %k1
542 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
545 ; NoVLX-LABEL: test256_20:
547 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
548 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
549 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
550 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
551 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
552 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
554 %y = load <8 x i32>, <8 x i32>* %yp, align 4
555 %mask = icmp uge <8 x i32> %y, %x
556 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
560 define <2 x i64> @test128_1(<2 x i64> %x, <2 x i64> %y) nounwind {
561 ; VLX-LABEL: test128_1:
563 ; VLX-NEXT: vpcmpeqq %xmm1, %xmm0, %k1
564 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
567 ; NoVLX-LABEL: test128_1:
569 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
570 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
571 ; NoVLX-NEXT: vpcmpeqq %zmm1, %zmm0, %k1
572 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
573 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
575 %mask = icmp eq <2 x i64> %x, %y
576 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %y
580 define <2 x i64> @test128_2(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1) nounwind {
581 ; VLX-LABEL: test128_2:
583 ; VLX-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
584 ; VLX-NEXT: vpblendmq %xmm2, %xmm1, %xmm0 {%k1}
587 ; NoVLX-LABEL: test128_2:
589 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
590 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
591 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
592 ; NoVLX-NEXT: vpcmpgtq %zmm1, %zmm0, %k1
593 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
594 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
596 %mask = icmp sgt <2 x i64> %x, %y
597 %max = select <2 x i1> %mask, <2 x i64> %x1, <2 x i64> %y
601 define <4 x i32> @test128_3(<4 x i32> %x, <4 x i32> %y, <4 x i32> %x1) nounwind {
602 ; VLX-LABEL: test128_3:
604 ; VLX-NEXT: vpcmpnltd %xmm1, %xmm0, %k1
605 ; VLX-NEXT: vpblendmd %xmm2, %xmm1, %xmm0 {%k1}
608 ; NoVLX-LABEL: test128_3:
610 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
611 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
612 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
613 ; NoVLX-NEXT: vpcmpnltd %zmm1, %zmm0, %k1
614 ; NoVLX-NEXT: vpblendmd %zmm2, %zmm1, %zmm0 {%k1}
615 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
617 %mask = icmp sge <4 x i32> %x, %y
618 %max = select <4 x i1> %mask, <4 x i32> %x1, <4 x i32> %y
622 define <2 x i64> @test128_4(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1) nounwind {
623 ; VLX-LABEL: test128_4:
625 ; VLX-NEXT: vpcmpnleuq %xmm1, %xmm0, %k1
626 ; VLX-NEXT: vpblendmq %xmm2, %xmm1, %xmm0 {%k1}
629 ; NoVLX-LABEL: test128_4:
631 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
632 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
633 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
634 ; NoVLX-NEXT: vpcmpnleuq %zmm1, %zmm0, %k1
635 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
636 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
638 %mask = icmp ugt <2 x i64> %x, %y
639 %max = select <2 x i1> %mask, <2 x i64> %x1, <2 x i64> %y
643 define <4 x i32> @test128_5(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %yp) nounwind {
644 ; VLX-LABEL: test128_5:
646 ; VLX-NEXT: vpcmpeqd (%rdi), %xmm0, %k1
647 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
650 ; NoVLX-LABEL: test128_5:
652 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
653 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
654 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
655 ; NoVLX-NEXT: vpcmpeqd %zmm2, %zmm0, %k1
656 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
657 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
659 %y = load <4 x i32>, <4 x i32>* %yp, align 4
660 %mask = icmp eq <4 x i32> %x, %y
661 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
665 define <4 x i32> @test128_5b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %yp) nounwind {
666 ; VLX-LABEL: test128_5b:
668 ; VLX-NEXT: vpcmpeqd (%rdi), %xmm0, %k1
669 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
672 ; NoVLX-LABEL: test128_5b:
674 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
675 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
676 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
677 ; NoVLX-NEXT: vpcmpeqd %zmm0, %zmm2, %k1
678 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
679 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
681 %y = load <4 x i32>, <4 x i32>* %yp, align 4
682 %mask = icmp eq <4 x i32> %y, %x
683 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
687 define <4 x i32> @test128_6(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
688 ; VLX-LABEL: test128_6:
690 ; VLX-NEXT: vpcmpgtd (%rdi), %xmm0, %k1
691 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
694 ; NoVLX-LABEL: test128_6:
696 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
697 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
698 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
699 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
700 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
701 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
703 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
704 %mask = icmp sgt <4 x i32> %x, %y
705 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
709 define <4 x i32> @test128_6b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
710 ; VLX-LABEL: test128_6b:
712 ; VLX-NEXT: vpcmpgtd (%rdi), %xmm0, %k1
713 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
716 ; NoVLX-LABEL: test128_6b:
718 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
719 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
720 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
721 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
722 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
723 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
725 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
726 %mask = icmp slt <4 x i32> %y, %x
727 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
731 define <4 x i32> @test128_7(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
732 ; VLX-LABEL: test128_7:
734 ; VLX-NEXT: vpcmpled (%rdi), %xmm0, %k1
735 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
738 ; NoVLX-LABEL: test128_7:
740 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
741 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
742 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
743 ; NoVLX-NEXT: vpcmpled %zmm2, %zmm0, %k1
744 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
745 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
747 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
748 %mask = icmp sle <4 x i32> %x, %y
749 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
753 define <4 x i32> @test128_7b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
754 ; VLX-LABEL: test128_7b:
756 ; VLX-NEXT: vpcmpled (%rdi), %xmm0, %k1
757 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
760 ; NoVLX-LABEL: test128_7b:
762 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
763 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
764 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
765 ; NoVLX-NEXT: vpcmpnltd %zmm0, %zmm2, %k1
766 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
767 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
769 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
770 %mask = icmp sge <4 x i32> %y, %x
771 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
775 define <4 x i32> @test128_8(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
776 ; VLX-LABEL: test128_8:
778 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
779 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
782 ; NoVLX-LABEL: test128_8:
784 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
785 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
786 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
787 ; NoVLX-NEXT: vpcmpleud %zmm2, %zmm0, %k1
788 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
789 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
791 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
792 %mask = icmp ule <4 x i32> %x, %y
793 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
797 define <4 x i32> @test128_8b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
798 ; VLX-LABEL: test128_8b:
800 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
801 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
804 ; NoVLX-LABEL: test128_8b:
806 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
807 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
808 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
809 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
810 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
811 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
813 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
814 %mask = icmp uge <4 x i32> %y, %x
815 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
819 define <4 x i32> @test128_9(<4 x i32> %x, <4 x i32> %y, <4 x i32> %x1, <4 x i32> %y1) nounwind {
820 ; VLX-LABEL: test128_9:
822 ; VLX-NEXT: vpcmpeqd %xmm1, %xmm0, %k1
823 ; VLX-NEXT: vpcmpeqd %xmm3, %xmm2, %k1 {%k1}
824 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
827 ; NoVLX-LABEL: test128_9:
829 ; NoVLX-NEXT: # kill: def $xmm3 killed $xmm3 def $zmm3
830 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
831 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
832 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
833 ; NoVLX-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
834 ; NoVLX-NEXT: vpcmpeqd %zmm3, %zmm2, %k1 {%k1}
835 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
836 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
838 %mask1 = icmp eq <4 x i32> %x1, %y1
839 %mask0 = icmp eq <4 x i32> %x, %y
840 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
841 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %y
845 define <2 x i64> @test128_10(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1, <2 x i64> %y1) nounwind {
846 ; VLX-LABEL: test128_10:
848 ; VLX-NEXT: vpcmpleq %xmm1, %xmm0, %k1
849 ; VLX-NEXT: vpcmpnltq %xmm3, %xmm2, %k1 {%k1}
850 ; VLX-NEXT: vpblendmq %xmm0, %xmm2, %xmm0 {%k1}
853 ; NoVLX-LABEL: test128_10:
855 ; NoVLX-NEXT: # kill: def $xmm3 killed $xmm3 def $zmm3
856 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
857 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
858 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
859 ; NoVLX-NEXT: vpcmpleq %zmm1, %zmm0, %k1
860 ; NoVLX-NEXT: vpcmpnltq %zmm3, %zmm2, %k1 {%k1}
861 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm2, %zmm0 {%k1}
862 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
864 %mask1 = icmp sge <2 x i64> %x1, %y1
865 %mask0 = icmp sle <2 x i64> %x, %y
866 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
867 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
871 define <2 x i64> @test128_11(<2 x i64> %x, <2 x i64>* %y.ptr, <2 x i64> %x1, <2 x i64> %y1) nounwind {
872 ; VLX-LABEL: test128_11:
874 ; VLX-NEXT: vpcmpgtq %xmm2, %xmm1, %k1
875 ; VLX-NEXT: vpcmpgtq (%rdi), %xmm0, %k1 {%k1}
876 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
879 ; NoVLX-LABEL: test128_11:
881 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
882 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
883 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
884 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm3
885 ; NoVLX-NEXT: vpcmpgtq %zmm3, %zmm0, %k1
886 ; NoVLX-NEXT: vpcmpgtq %zmm2, %zmm1, %k1 {%k1}
887 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
888 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
890 %mask1 = icmp sgt <2 x i64> %x1, %y1
891 %y = load <2 x i64>, <2 x i64>* %y.ptr, align 4
892 %mask0 = icmp sgt <2 x i64> %x, %y
893 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
894 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
898 define <4 x i32> @test128_12(<4 x i32> %x, <4 x i32>* %y.ptr, <4 x i32> %x1, <4 x i32> %y1) nounwind {
899 ; VLX-LABEL: test128_12:
901 ; VLX-NEXT: vpcmpnltd %xmm2, %xmm1, %k1
902 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1 {%k1}
903 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
906 ; NoVLX-LABEL: test128_12:
908 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
909 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
910 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
911 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm3
912 ; NoVLX-NEXT: vpcmpleud %zmm3, %zmm0, %k1
913 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1 {%k1}
914 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
915 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
917 %mask1 = icmp sge <4 x i32> %x1, %y1
918 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
919 %mask0 = icmp ule <4 x i32> %x, %y
920 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
921 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
925 define <2 x i64> @test128_13(<2 x i64> %x, <2 x i64> %x1, i64* %yb.ptr) nounwind {
926 ; VLX-LABEL: test128_13:
928 ; VLX-NEXT: vpcmpeqq (%rdi){1to2}, %xmm0, %k1
929 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
932 ; NoVLX-LABEL: test128_13:
934 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
935 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
936 ; NoVLX-NEXT: vpcmpeqq (%rdi){1to8}, %zmm0, %k1
937 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
938 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
940 %yb = load i64, i64* %yb.ptr, align 4
941 %y.0 = insertelement <2 x i64> undef, i64 %yb, i32 0
942 %y = insertelement <2 x i64> %y.0, i64 %yb, i32 1
943 %mask = icmp eq <2 x i64> %x, %y
944 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
948 define <4 x i32> @test128_14(<4 x i32> %x, i32* %yb.ptr, <4 x i32> %x1) nounwind {
949 ; VLX-LABEL: test128_14:
951 ; VLX-NEXT: vpcmpled (%rdi){1to4}, %xmm0, %k1
952 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
955 ; NoVLX-LABEL: test128_14:
957 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
958 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
959 ; NoVLX-NEXT: vpcmpled (%rdi){1to16}, %zmm0, %k1
960 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
961 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
963 %yb = load i32, i32* %yb.ptr, align 4
964 %y.0 = insertelement <4 x i32> undef, i32 %yb, i32 0
965 %y = shufflevector <4 x i32> %y.0, <4 x i32> undef, <4 x i32> zeroinitializer
966 %mask = icmp sle <4 x i32> %x, %y
967 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
971 define <4 x i32> @test128_15(<4 x i32> %x, i32* %yb.ptr, <4 x i32> %x1, <4 x i32> %y1) nounwind {
972 ; VLX-LABEL: test128_15:
974 ; VLX-NEXT: vpcmpnltd %xmm2, %xmm1, %k1
975 ; VLX-NEXT: vpcmpgtd (%rdi){1to4}, %xmm0, %k1 {%k1}
976 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
979 ; NoVLX-LABEL: test128_15:
981 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
982 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
983 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
984 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1
985 ; NoVLX-NEXT: vpcmpgtd (%rdi){1to16}, %zmm0, %k1 {%k1}
986 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
987 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
989 %mask1 = icmp sge <4 x i32> %x1, %y1
990 %yb = load i32, i32* %yb.ptr, align 4
991 %y.0 = insertelement <4 x i32> undef, i32 %yb, i32 0
992 %y = shufflevector <4 x i32> %y.0, <4 x i32> undef, <4 x i32> zeroinitializer
993 %mask0 = icmp sgt <4 x i32> %x, %y
994 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
995 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
999 define <2 x i64> @test128_16(<2 x i64> %x, i64* %yb.ptr, <2 x i64> %x1, <2 x i64> %y1) nounwind {
1000 ; VLX-LABEL: test128_16:
1002 ; VLX-NEXT: vpcmpnltq %xmm2, %xmm1, %k1
1003 ; VLX-NEXT: vpcmpgtq (%rdi){1to2}, %xmm0, %k1 {%k1}
1004 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
1007 ; NoVLX-LABEL: test128_16:
1009 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
1010 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1011 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1012 ; NoVLX-NEXT: vpcmpnltq %zmm2, %zmm1, %k1
1013 ; NoVLX-NEXT: vpcmpgtq (%rdi){1to8}, %zmm0, %k1 {%k1}
1014 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
1015 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1017 %mask1 = icmp sge <2 x i64> %x1, %y1
1018 %yb = load i64, i64* %yb.ptr, align 4
1019 %y.0 = insertelement <2 x i64> undef, i64 %yb, i32 0
1020 %y = insertelement <2 x i64> %y.0, i64 %yb, i32 1
1021 %mask0 = icmp sgt <2 x i64> %x, %y
1022 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
1023 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
1027 define <4 x i32> @test128_17(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1028 ; VLX-LABEL: test128_17:
1030 ; VLX-NEXT: vpcmpneqd (%rdi), %xmm0, %k1
1031 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1034 ; NoVLX-LABEL: test128_17:
1036 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1037 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1038 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1039 ; NoVLX-NEXT: vpcmpneqd %zmm2, %zmm0, %k1
1040 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1041 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1043 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1044 %mask = icmp ne <4 x i32> %x, %y
1045 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1049 define <4 x i32> @test128_18(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1050 ; VLX-LABEL: test128_18:
1052 ; VLX-NEXT: vpcmpneqd (%rdi), %xmm0, %k1
1053 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1056 ; NoVLX-LABEL: test128_18:
1058 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1059 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1060 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1061 ; NoVLX-NEXT: vpcmpneqd %zmm0, %zmm2, %k1
1062 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1063 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1065 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1066 %mask = icmp ne <4 x i32> %y, %x
1067 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1071 define <4 x i32> @test128_19(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1072 ; VLX-LABEL: test128_19:
1074 ; VLX-NEXT: vpcmpnltud (%rdi), %xmm0, %k1
1075 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1078 ; NoVLX-LABEL: test128_19:
1080 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1081 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1082 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1083 ; NoVLX-NEXT: vpcmpnltud %zmm2, %zmm0, %k1
1084 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1085 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1087 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1088 %mask = icmp uge <4 x i32> %x, %y
1089 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1093 define <4 x i32> @test128_20(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1094 ; VLX-LABEL: test128_20:
1096 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
1097 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1100 ; NoVLX-LABEL: test128_20:
1102 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1103 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1104 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1105 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
1106 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1107 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1109 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1110 %mask = icmp uge <4 x i32> %y, %x
1111 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1115 define <8 x i32> @testnm_and(<8 x i32> %a, <8 x i32> %b, <8 x i32> %x, <8 x i32> %y) {
1116 ; VLX-LABEL: testnm_and:
1118 ; VLX-NEXT: vpor %ymm1, %ymm0, %ymm0
1119 ; VLX-NEXT: vptestnmd %ymm0, %ymm0, %k1
1120 ; VLX-NEXT: vpblendmd %ymm2, %ymm3, %ymm0 {%k1}
1123 ; NoVLX-LABEL: testnm_and:
1125 ; NoVLX-NEXT: # kill: def $ymm3 killed $ymm3 def $zmm3
1126 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
1127 ; NoVLX-NEXT: vpor %ymm1, %ymm0, %ymm0
1128 ; NoVLX-NEXT: vptestnmd %zmm0, %zmm0, %k1
1129 ; NoVLX-NEXT: vpblendmd %zmm2, %zmm3, %zmm0 {%k1}
1130 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1132 %c = icmp eq <8 x i32> %a, zeroinitializer
1133 %d = icmp eq <8 x i32> %b, zeroinitializer
1134 %e = and <8 x i1> %c, %d
1135 %z = select <8 x i1> %e, <8 x i32> %x, <8 x i32> %y