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: vpbroadcastq (%rdi), %ymm2
382 ; NoVLX-NEXT: vpcmpeqq %zmm2, %zmm0, %k1
383 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
384 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
386 %yb = load i64, i64* %yb.ptr, align 4
387 %y.0 = insertelement <4 x i64> undef, i64 %yb, i32 0
388 %y = shufflevector <4 x i64> %y.0, <4 x i64> undef, <4 x i32> zeroinitializer
389 %mask = icmp eq <4 x i64> %x, %y
390 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
394 define <8 x i32> @test256_14(<8 x i32> %x, i32* %yb.ptr, <8 x i32> %x1) nounwind {
395 ; VLX-LABEL: test256_14:
397 ; VLX-NEXT: vpcmpled (%rdi){1to8}, %ymm0, %k1
398 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
401 ; NoVLX-LABEL: test256_14:
403 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
404 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
405 ; NoVLX-NEXT: vpbroadcastd (%rdi), %ymm2
406 ; NoVLX-NEXT: vpcmpled %zmm2, %zmm0, %k1
407 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
408 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
410 %yb = load i32, i32* %yb.ptr, align 4
411 %y.0 = insertelement <8 x i32> undef, i32 %yb, i32 0
412 %y = shufflevector <8 x i32> %y.0, <8 x i32> undef, <8 x i32> zeroinitializer
413 %mask = icmp sle <8 x i32> %x, %y
414 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
418 define <8 x i32> @test256_15(<8 x i32> %x, i32* %yb.ptr, <8 x i32> %x1, <8 x i32> %y1) nounwind {
419 ; VLX-LABEL: test256_15:
421 ; VLX-NEXT: vpcmpnltd %ymm2, %ymm1, %k1
422 ; VLX-NEXT: vpcmpgtd (%rdi){1to8}, %ymm0, %k1 {%k1}
423 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
426 ; NoVLX-LABEL: test256_15:
428 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
429 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
430 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
431 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1
432 ; NoVLX-NEXT: vpbroadcastd (%rdi), %ymm2
433 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1 {%k1}
434 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
435 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
437 %mask1 = icmp sge <8 x i32> %x1, %y1
438 %yb = load i32, i32* %yb.ptr, align 4
439 %y.0 = insertelement <8 x i32> undef, i32 %yb, i32 0
440 %y = shufflevector <8 x i32> %y.0, <8 x i32> undef, <8 x i32> zeroinitializer
441 %mask0 = icmp sgt <8 x i32> %x, %y
442 %mask = select <8 x i1> %mask0, <8 x i1> %mask1, <8 x i1> zeroinitializer
443 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
447 define <4 x i64> @test256_16(<4 x i64> %x, i64* %yb.ptr, <4 x i64> %x1, <4 x i64> %y1) nounwind {
448 ; VLX-LABEL: test256_16:
450 ; VLX-NEXT: vpcmpnltq %ymm2, %ymm1, %k1
451 ; VLX-NEXT: vpcmpgtq (%rdi){1to4}, %ymm0, %k1 {%k1}
452 ; VLX-NEXT: vpblendmq %ymm0, %ymm1, %ymm0 {%k1}
455 ; NoVLX-LABEL: test256_16:
457 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
458 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
459 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
460 ; NoVLX-NEXT: vpcmpnltq %zmm2, %zmm1, %k1
461 ; NoVLX-NEXT: vpbroadcastq (%rdi), %ymm2
462 ; NoVLX-NEXT: vpcmpgtq %zmm2, %zmm0, %k1 {%k1}
463 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
464 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
466 %mask1 = icmp sge <4 x i64> %x1, %y1
467 %yb = load i64, i64* %yb.ptr, align 4
468 %y.0 = insertelement <4 x i64> undef, i64 %yb, i32 0
469 %y = shufflevector <4 x i64> %y.0, <4 x i64> undef, <4 x i32> zeroinitializer
470 %mask0 = icmp sgt <4 x i64> %x, %y
471 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
472 %max = select <4 x i1> %mask, <4 x i64> %x, <4 x i64> %x1
476 define <8 x i32> @test256_17(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
477 ; VLX-LABEL: test256_17:
479 ; VLX-NEXT: vpcmpneqd (%rdi), %ymm0, %k1
480 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
483 ; NoVLX-LABEL: test256_17:
485 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
486 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
487 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
488 ; NoVLX-NEXT: vpcmpneqd %zmm2, %zmm0, %k1
489 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
490 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
492 %y = load <8 x i32>, <8 x i32>* %yp, align 4
493 %mask = icmp ne <8 x i32> %x, %y
494 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
498 define <8 x i32> @test256_18(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
499 ; VLX-LABEL: test256_18:
501 ; VLX-NEXT: vpcmpneqd (%rdi), %ymm0, %k1
502 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
505 ; NoVLX-LABEL: test256_18:
507 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
508 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
509 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
510 ; NoVLX-NEXT: vpcmpneqd %zmm0, %zmm2, %k1
511 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
512 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
514 %y = load <8 x i32>, <8 x i32>* %yp, align 4
515 %mask = icmp ne <8 x i32> %y, %x
516 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
520 define <8 x i32> @test256_19(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
521 ; VLX-LABEL: test256_19:
523 ; VLX-NEXT: vpcmpnltud (%rdi), %ymm0, %k1
524 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
527 ; NoVLX-LABEL: test256_19:
529 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
530 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
531 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
532 ; NoVLX-NEXT: vpcmpnltud %zmm2, %zmm0, %k1
533 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
534 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
536 %y = load <8 x i32>, <8 x i32>* %yp, align 4
537 %mask = icmp uge <8 x i32> %x, %y
538 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
542 define <8 x i32> @test256_20(<8 x i32> %x, <8 x i32> %x1, <8 x i32>* %yp) nounwind {
543 ; VLX-LABEL: test256_20:
545 ; VLX-NEXT: vpcmpleud (%rdi), %ymm0, %k1
546 ; VLX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
549 ; NoVLX-LABEL: test256_20:
551 ; NoVLX-NEXT: # kill: def $ymm1 killed $ymm1 def $zmm1
552 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
553 ; NoVLX-NEXT: vmovdqu (%rdi), %ymm2
554 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
555 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
556 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
558 %y = load <8 x i32>, <8 x i32>* %yp, align 4
559 %mask = icmp uge <8 x i32> %y, %x
560 %max = select <8 x i1> %mask, <8 x i32> %x, <8 x i32> %x1
564 define <2 x i64> @test128_1(<2 x i64> %x, <2 x i64> %y) nounwind {
565 ; VLX-LABEL: test128_1:
567 ; VLX-NEXT: vpcmpeqq %xmm1, %xmm0, %k1
568 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
571 ; NoVLX-LABEL: test128_1:
573 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
574 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
575 ; NoVLX-NEXT: vpcmpeqq %zmm1, %zmm0, %k1
576 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
577 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
579 %mask = icmp eq <2 x i64> %x, %y
580 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %y
584 define <2 x i64> @test128_2(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1) nounwind {
585 ; VLX-LABEL: test128_2:
587 ; VLX-NEXT: vpcmpgtq %xmm1, %xmm0, %k1
588 ; VLX-NEXT: vpblendmq %xmm2, %xmm1, %xmm0 {%k1}
591 ; NoVLX-LABEL: test128_2:
593 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
594 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
595 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
596 ; NoVLX-NEXT: vpcmpgtq %zmm1, %zmm0, %k1
597 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
598 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
600 %mask = icmp sgt <2 x i64> %x, %y
601 %max = select <2 x i1> %mask, <2 x i64> %x1, <2 x i64> %y
605 define <4 x i32> @test128_3(<4 x i32> %x, <4 x i32> %y, <4 x i32> %x1) nounwind {
606 ; VLX-LABEL: test128_3:
608 ; VLX-NEXT: vpcmpnltd %xmm1, %xmm0, %k1
609 ; VLX-NEXT: vpblendmd %xmm2, %xmm1, %xmm0 {%k1}
612 ; NoVLX-LABEL: test128_3:
614 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
615 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
616 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
617 ; NoVLX-NEXT: vpcmpnltd %zmm1, %zmm0, %k1
618 ; NoVLX-NEXT: vpblendmd %zmm2, %zmm1, %zmm0 {%k1}
619 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
621 %mask = icmp sge <4 x i32> %x, %y
622 %max = select <4 x i1> %mask, <4 x i32> %x1, <4 x i32> %y
626 define <2 x i64> @test128_4(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1) nounwind {
627 ; VLX-LABEL: test128_4:
629 ; VLX-NEXT: vpcmpnleuq %xmm1, %xmm0, %k1
630 ; VLX-NEXT: vpblendmq %xmm2, %xmm1, %xmm0 {%k1}
633 ; NoVLX-LABEL: test128_4:
635 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
636 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
637 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
638 ; NoVLX-NEXT: vpcmpnleuq %zmm1, %zmm0, %k1
639 ; NoVLX-NEXT: vpblendmq %zmm2, %zmm1, %zmm0 {%k1}
640 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
642 %mask = icmp ugt <2 x i64> %x, %y
643 %max = select <2 x i1> %mask, <2 x i64> %x1, <2 x i64> %y
647 define <4 x i32> @test128_5(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %yp) nounwind {
648 ; VLX-LABEL: test128_5:
650 ; VLX-NEXT: vpcmpeqd (%rdi), %xmm0, %k1
651 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
654 ; NoVLX-LABEL: test128_5:
656 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
657 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
658 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
659 ; NoVLX-NEXT: vpcmpeqd %zmm2, %zmm0, %k1
660 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
661 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
663 %y = load <4 x i32>, <4 x i32>* %yp, align 4
664 %mask = icmp eq <4 x i32> %x, %y
665 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
669 define <4 x i32> @test128_5b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %yp) nounwind {
670 ; VLX-LABEL: test128_5b:
672 ; VLX-NEXT: vpcmpeqd (%rdi), %xmm0, %k1
673 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
676 ; NoVLX-LABEL: test128_5b:
678 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
679 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
680 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
681 ; NoVLX-NEXT: vpcmpeqd %zmm0, %zmm2, %k1
682 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
683 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
685 %y = load <4 x i32>, <4 x i32>* %yp, align 4
686 %mask = icmp eq <4 x i32> %y, %x
687 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
691 define <4 x i32> @test128_6(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
692 ; VLX-LABEL: test128_6:
694 ; VLX-NEXT: vpcmpgtd (%rdi), %xmm0, %k1
695 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
698 ; NoVLX-LABEL: test128_6:
700 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
701 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
702 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
703 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
704 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
705 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
707 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
708 %mask = icmp sgt <4 x i32> %x, %y
709 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
713 define <4 x i32> @test128_6b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
714 ; VLX-LABEL: test128_6b:
716 ; VLX-NEXT: vpcmpgtd (%rdi), %xmm0, %k1
717 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
720 ; NoVLX-LABEL: test128_6b:
722 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
723 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
724 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
725 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1
726 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
727 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
729 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
730 %mask = icmp slt <4 x i32> %y, %x
731 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
735 define <4 x i32> @test128_7(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
736 ; VLX-LABEL: test128_7:
738 ; VLX-NEXT: vpcmpled (%rdi), %xmm0, %k1
739 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
742 ; NoVLX-LABEL: test128_7:
744 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
745 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
746 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
747 ; NoVLX-NEXT: vpcmpled %zmm2, %zmm0, %k1
748 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
749 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
751 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
752 %mask = icmp sle <4 x i32> %x, %y
753 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
757 define <4 x i32> @test128_7b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
758 ; VLX-LABEL: test128_7b:
760 ; VLX-NEXT: vpcmpled (%rdi), %xmm0, %k1
761 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
764 ; NoVLX-LABEL: test128_7b:
766 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
767 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
768 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
769 ; NoVLX-NEXT: vpcmpnltd %zmm0, %zmm2, %k1
770 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
771 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
773 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
774 %mask = icmp sge <4 x i32> %y, %x
775 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
779 define <4 x i32> @test128_8(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
780 ; VLX-LABEL: test128_8:
782 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
783 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
786 ; NoVLX-LABEL: test128_8:
788 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
789 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
790 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
791 ; NoVLX-NEXT: vpcmpleud %zmm2, %zmm0, %k1
792 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
793 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
795 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
796 %mask = icmp ule <4 x i32> %x, %y
797 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
801 define <4 x i32> @test128_8b(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
802 ; VLX-LABEL: test128_8b:
804 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
805 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
808 ; NoVLX-LABEL: test128_8b:
810 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
811 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
812 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
813 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
814 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
815 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
817 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
818 %mask = icmp uge <4 x i32> %y, %x
819 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
823 define <4 x i32> @test128_9(<4 x i32> %x, <4 x i32> %y, <4 x i32> %x1, <4 x i32> %y1) nounwind {
824 ; VLX-LABEL: test128_9:
826 ; VLX-NEXT: vpcmpeqd %xmm1, %xmm0, %k1
827 ; VLX-NEXT: vpcmpeqd %xmm3, %xmm2, %k1 {%k1}
828 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
831 ; NoVLX-LABEL: test128_9:
833 ; NoVLX-NEXT: # kill: def $xmm3 killed $xmm3 def $zmm3
834 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
835 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
836 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
837 ; NoVLX-NEXT: vpcmpeqd %zmm1, %zmm0, %k1
838 ; NoVLX-NEXT: vpcmpeqd %zmm3, %zmm2, %k1 {%k1}
839 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
840 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
842 %mask1 = icmp eq <4 x i32> %x1, %y1
843 %mask0 = icmp eq <4 x i32> %x, %y
844 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
845 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %y
849 define <2 x i64> @test128_10(<2 x i64> %x, <2 x i64> %y, <2 x i64> %x1, <2 x i64> %y1) nounwind {
850 ; VLX-LABEL: test128_10:
852 ; VLX-NEXT: vpcmpleq %xmm1, %xmm0, %k1
853 ; VLX-NEXT: vpcmpnltq %xmm3, %xmm2, %k1 {%k1}
854 ; VLX-NEXT: vpblendmq %xmm0, %xmm2, %xmm0 {%k1}
857 ; NoVLX-LABEL: test128_10:
859 ; NoVLX-NEXT: # kill: def $xmm3 killed $xmm3 def $zmm3
860 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
861 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
862 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
863 ; NoVLX-NEXT: vpcmpleq %zmm1, %zmm0, %k1
864 ; NoVLX-NEXT: vpcmpnltq %zmm3, %zmm2, %k1 {%k1}
865 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm2, %zmm0 {%k1}
866 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
868 %mask1 = icmp sge <2 x i64> %x1, %y1
869 %mask0 = icmp sle <2 x i64> %x, %y
870 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
871 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
875 define <2 x i64> @test128_11(<2 x i64> %x, <2 x i64>* %y.ptr, <2 x i64> %x1, <2 x i64> %y1) nounwind {
876 ; VLX-LABEL: test128_11:
878 ; VLX-NEXT: vpcmpgtq %xmm2, %xmm1, %k1
879 ; VLX-NEXT: vpcmpgtq (%rdi), %xmm0, %k1 {%k1}
880 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
883 ; NoVLX-LABEL: test128_11:
885 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
886 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
887 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
888 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm3
889 ; NoVLX-NEXT: vpcmpgtq %zmm3, %zmm0, %k1
890 ; NoVLX-NEXT: vpcmpgtq %zmm2, %zmm1, %k1 {%k1}
891 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
892 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
894 %mask1 = icmp sgt <2 x i64> %x1, %y1
895 %y = load <2 x i64>, <2 x i64>* %y.ptr, align 4
896 %mask0 = icmp sgt <2 x i64> %x, %y
897 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
898 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
902 define <4 x i32> @test128_12(<4 x i32> %x, <4 x i32>* %y.ptr, <4 x i32> %x1, <4 x i32> %y1) nounwind {
903 ; VLX-LABEL: test128_12:
905 ; VLX-NEXT: vpcmpnltd %xmm2, %xmm1, %k1
906 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1 {%k1}
907 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
910 ; NoVLX-LABEL: test128_12:
912 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
913 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
914 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
915 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm3
916 ; NoVLX-NEXT: vpcmpleud %zmm3, %zmm0, %k1
917 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1 {%k1}
918 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
919 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
921 %mask1 = icmp sge <4 x i32> %x1, %y1
922 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
923 %mask0 = icmp ule <4 x i32> %x, %y
924 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
925 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
929 define <2 x i64> @test128_13(<2 x i64> %x, <2 x i64> %x1, i64* %yb.ptr) nounwind {
930 ; VLX-LABEL: test128_13:
932 ; VLX-NEXT: vpcmpeqq (%rdi){1to2}, %xmm0, %k1
933 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
936 ; NoVLX-LABEL: test128_13:
938 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
939 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
940 ; NoVLX-NEXT: vpbroadcastq (%rdi), %xmm2
941 ; NoVLX-NEXT: vpcmpeqq %zmm2, %zmm0, %k1
942 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
943 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
945 %yb = load i64, i64* %yb.ptr, align 4
946 %y.0 = insertelement <2 x i64> undef, i64 %yb, i32 0
947 %y = insertelement <2 x i64> %y.0, i64 %yb, i32 1
948 %mask = icmp eq <2 x i64> %x, %y
949 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
953 define <4 x i32> @test128_14(<4 x i32> %x, i32* %yb.ptr, <4 x i32> %x1) nounwind {
954 ; VLX-LABEL: test128_14:
956 ; VLX-NEXT: vpcmpled (%rdi){1to4}, %xmm0, %k1
957 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
960 ; NoVLX-LABEL: test128_14:
962 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
963 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
964 ; NoVLX-NEXT: vpbroadcastd (%rdi), %xmm2
965 ; NoVLX-NEXT: vpcmpled %zmm2, %zmm0, %k1
966 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
967 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
969 %yb = load i32, i32* %yb.ptr, align 4
970 %y.0 = insertelement <4 x i32> undef, i32 %yb, i32 0
971 %y = shufflevector <4 x i32> %y.0, <4 x i32> undef, <4 x i32> zeroinitializer
972 %mask = icmp sle <4 x i32> %x, %y
973 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
977 define <4 x i32> @test128_15(<4 x i32> %x, i32* %yb.ptr, <4 x i32> %x1, <4 x i32> %y1) nounwind {
978 ; VLX-LABEL: test128_15:
980 ; VLX-NEXT: vpcmpnltd %xmm2, %xmm1, %k1
981 ; VLX-NEXT: vpcmpgtd (%rdi){1to4}, %xmm0, %k1 {%k1}
982 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
985 ; NoVLX-LABEL: test128_15:
987 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
988 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
989 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
990 ; NoVLX-NEXT: vpcmpnltd %zmm2, %zmm1, %k1
991 ; NoVLX-NEXT: vpbroadcastd (%rdi), %xmm2
992 ; NoVLX-NEXT: vpcmpgtd %zmm2, %zmm0, %k1 {%k1}
993 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
994 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
996 %mask1 = icmp sge <4 x i32> %x1, %y1
997 %yb = load i32, i32* %yb.ptr, align 4
998 %y.0 = insertelement <4 x i32> undef, i32 %yb, i32 0
999 %y = shufflevector <4 x i32> %y.0, <4 x i32> undef, <4 x i32> zeroinitializer
1000 %mask0 = icmp sgt <4 x i32> %x, %y
1001 %mask = select <4 x i1> %mask0, <4 x i1> %mask1, <4 x i1> zeroinitializer
1002 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1006 define <2 x i64> @test128_16(<2 x i64> %x, i64* %yb.ptr, <2 x i64> %x1, <2 x i64> %y1) nounwind {
1007 ; VLX-LABEL: test128_16:
1009 ; VLX-NEXT: vpcmpnltq %xmm2, %xmm1, %k1
1010 ; VLX-NEXT: vpcmpgtq (%rdi){1to2}, %xmm0, %k1 {%k1}
1011 ; VLX-NEXT: vpblendmq %xmm0, %xmm1, %xmm0 {%k1}
1014 ; NoVLX-LABEL: test128_16:
1016 ; NoVLX-NEXT: # kill: def $xmm2 killed $xmm2 def $zmm2
1017 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1018 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1019 ; NoVLX-NEXT: vpcmpnltq %zmm2, %zmm1, %k1
1020 ; NoVLX-NEXT: vpbroadcastq (%rdi), %xmm2
1021 ; NoVLX-NEXT: vpcmpgtq %zmm2, %zmm0, %k1 {%k1}
1022 ; NoVLX-NEXT: vpblendmq %zmm0, %zmm1, %zmm0 {%k1}
1023 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1025 %mask1 = icmp sge <2 x i64> %x1, %y1
1026 %yb = load i64, i64* %yb.ptr, align 4
1027 %y.0 = insertelement <2 x i64> undef, i64 %yb, i32 0
1028 %y = insertelement <2 x i64> %y.0, i64 %yb, i32 1
1029 %mask0 = icmp sgt <2 x i64> %x, %y
1030 %mask = select <2 x i1> %mask0, <2 x i1> %mask1, <2 x i1> zeroinitializer
1031 %max = select <2 x i1> %mask, <2 x i64> %x, <2 x i64> %x1
1035 define <4 x i32> @test128_17(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1036 ; VLX-LABEL: test128_17:
1038 ; VLX-NEXT: vpcmpneqd (%rdi), %xmm0, %k1
1039 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1042 ; NoVLX-LABEL: test128_17:
1044 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1045 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1046 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1047 ; NoVLX-NEXT: vpcmpneqd %zmm2, %zmm0, %k1
1048 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1049 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1051 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1052 %mask = icmp ne <4 x i32> %x, %y
1053 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1057 define <4 x i32> @test128_18(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1058 ; VLX-LABEL: test128_18:
1060 ; VLX-NEXT: vpcmpneqd (%rdi), %xmm0, %k1
1061 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1064 ; NoVLX-LABEL: test128_18:
1066 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1067 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1068 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1069 ; NoVLX-NEXT: vpcmpneqd %zmm0, %zmm2, %k1
1070 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1071 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1073 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1074 %mask = icmp ne <4 x i32> %y, %x
1075 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1079 define <4 x i32> @test128_19(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1080 ; VLX-LABEL: test128_19:
1082 ; VLX-NEXT: vpcmpnltud (%rdi), %xmm0, %k1
1083 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1086 ; NoVLX-LABEL: test128_19:
1088 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1089 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1090 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1091 ; NoVLX-NEXT: vpcmpnltud %zmm2, %zmm0, %k1
1092 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1093 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1095 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1096 %mask = icmp uge <4 x i32> %x, %y
1097 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1101 define <4 x i32> @test128_20(<4 x i32> %x, <4 x i32> %x1, <4 x i32>* %y.ptr) nounwind {
1102 ; VLX-LABEL: test128_20:
1104 ; VLX-NEXT: vpcmpleud (%rdi), %xmm0, %k1
1105 ; VLX-NEXT: vpblendmd %xmm0, %xmm1, %xmm0 {%k1}
1108 ; NoVLX-LABEL: test128_20:
1110 ; NoVLX-NEXT: # kill: def $xmm1 killed $xmm1 def $zmm1
1111 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 def $zmm0
1112 ; NoVLX-NEXT: vmovdqu (%rdi), %xmm2
1113 ; NoVLX-NEXT: vpcmpnltud %zmm0, %zmm2, %k1
1114 ; NoVLX-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
1115 ; NoVLX-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1117 %y = load <4 x i32>, <4 x i32>* %y.ptr, align 4
1118 %mask = icmp uge <4 x i32> %y, %x
1119 %max = select <4 x i1> %mask, <4 x i32> %x, <4 x i32> %x1
1123 define <8 x i32> @testnm_and(<8 x i32> %a, <8 x i32> %b, <8 x i32> %x, <8 x i32> %y) {
1124 ; VLX-LABEL: testnm_and:
1126 ; VLX-NEXT: vpor %ymm1, %ymm0, %ymm0
1127 ; VLX-NEXT: vptestnmd %ymm0, %ymm0, %k1
1128 ; VLX-NEXT: vpblendmd %ymm2, %ymm3, %ymm0 {%k1}
1131 ; NoVLX-LABEL: testnm_and:
1133 ; NoVLX-NEXT: # kill: def $ymm3 killed $ymm3 def $zmm3
1134 ; NoVLX-NEXT: # kill: def $ymm2 killed $ymm2 def $zmm2
1135 ; NoVLX-NEXT: vpor %ymm1, %ymm0, %ymm0
1136 ; NoVLX-NEXT: vptestnmd %zmm0, %zmm0, %k1
1137 ; NoVLX-NEXT: vpblendmd %zmm2, %zmm3, %zmm0 {%k1}
1138 ; NoVLX-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1140 %c = icmp eq <8 x i32> %a, zeroinitializer
1141 %d = icmp eq <8 x i32> %b, zeroinitializer
1142 %e = and <8 x i1> %c, %d
1143 %z = select <8 x i1> %e, <8 x i32> %x, <8 x i32> %y