1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s --check-prefix=ALL --check-prefix=KNL
3 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s --check-prefix=ALL --check-prefix=SKX
6 define <16 x i32> @vpandd(<16 x i32> %a, <16 x i32> %b) nounwind uwtable readnone ssp {
8 ; ALL: ## %bb.0: ## %entry
9 ; ALL-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
10 ; ALL-NEXT: vpandd %zmm1, %zmm0, %zmm0
13 ; Force the execution domain with an add.
14 %a2 = add <16 x i32> %a, <i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2,
15 i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2>
16 %x = and <16 x i32> %a2, %b
20 define <16 x i32> @vpandnd(<16 x i32> %a, <16 x i32> %b) nounwind uwtable readnone ssp {
22 ; ALL: ## %bb.0: ## %entry
23 ; ALL-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
24 ; ALL-NEXT: vpandnd %zmm0, %zmm1, %zmm0
27 ; Force the execution domain with an add.
28 %a2 = add <16 x i32> %a, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3,
29 i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
30 %b2 = xor <16 x i32> %b, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1,
31 i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
32 %x = and <16 x i32> %a2, %b2
36 define <16 x i32> @vpord(<16 x i32> %a, <16 x i32> %b) nounwind uwtable readnone ssp {
38 ; ALL: ## %bb.0: ## %entry
39 ; ALL-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
40 ; ALL-NEXT: vpord %zmm1, %zmm0, %zmm0
43 ; Force the execution domain with an add.
44 %a2 = add <16 x i32> %a, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4,
45 i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
46 %x = or <16 x i32> %a2, %b
50 define <16 x i32> @vpxord(<16 x i32> %a, <16 x i32> %b) nounwind uwtable readnone ssp {
52 ; ALL: ## %bb.0: ## %entry
53 ; ALL-NEXT: vpaddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
54 ; ALL-NEXT: vpxord %zmm1, %zmm0, %zmm0
57 ; Force the execution domain with an add.
58 %a2 = add <16 x i32> %a, <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5,
59 i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>
60 %x = xor <16 x i32> %a2, %b
64 define <8 x i64> @vpandq(<8 x i64> %a, <8 x i64> %b) nounwind uwtable readnone ssp {
66 ; ALL: ## %bb.0: ## %entry
67 ; ALL-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
68 ; ALL-NEXT: vpandq %zmm1, %zmm0, %zmm0
71 ; Force the execution domain with an add.
72 %a2 = add <8 x i64> %a, <i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6, i64 6>
73 %x = and <8 x i64> %a2, %b
77 define <8 x i64> @vpandnq(<8 x i64> %a, <8 x i64> %b) nounwind uwtable readnone ssp {
79 ; ALL: ## %bb.0: ## %entry
80 ; ALL-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
81 ; ALL-NEXT: vpandnq %zmm0, %zmm1, %zmm0
84 ; Force the execution domain with an add.
85 %a2 = add <8 x i64> %a, <i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7, i64 7>
86 %b2 = xor <8 x i64> %b, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
87 %x = and <8 x i64> %a2, %b2
91 define <8 x i64> @vporq(<8 x i64> %a, <8 x i64> %b) nounwind uwtable readnone ssp {
93 ; ALL: ## %bb.0: ## %entry
94 ; ALL-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
95 ; ALL-NEXT: vporq %zmm1, %zmm0, %zmm0
98 ; Force the execution domain with an add.
99 %a2 = add <8 x i64> %a, <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8>
100 %x = or <8 x i64> %a2, %b
104 define <8 x i64> @vpxorq(<8 x i64> %a, <8 x i64> %b) nounwind uwtable readnone ssp {
106 ; ALL: ## %bb.0: ## %entry
107 ; ALL-NEXT: vpaddq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
108 ; ALL-NEXT: vpxorq %zmm1, %zmm0, %zmm0
111 ; Force the execution domain with an add.
112 %a2 = add <8 x i64> %a, <i64 9, i64 9, i64 9, i64 9, i64 9, i64 9, i64 9, i64 9>
113 %x = xor <8 x i64> %a2, %b
118 define <8 x i64> @orq_broadcast(<8 x i64> %a) nounwind {
119 ; KNL-LABEL: orq_broadcast:
121 ; KNL-NEXT: vporq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
124 ; SKX-LABEL: orq_broadcast:
126 ; SKX-NEXT: vorpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
128 %b = or <8 x i64> %a, <i64 2, i64 2, i64 2, i64 2, i64 2, i64 2, i64 2, i64 2>
132 define <16 x i32> @andd512fold(<16 x i32> %y, ptr %x) {
133 ; KNL-LABEL: andd512fold:
134 ; KNL: ## %bb.0: ## %entry
135 ; KNL-NEXT: vpandd (%rdi), %zmm0, %zmm0
138 ; SKX-LABEL: andd512fold:
139 ; SKX: ## %bb.0: ## %entry
140 ; SKX-NEXT: vandps (%rdi), %zmm0, %zmm0
143 %a = load <16 x i32>, ptr %x, align 4
144 %b = and <16 x i32> %y, %a
148 define <8 x i64> @andqbrst(<8 x i64> %p1, ptr %ap) {
149 ; KNL-LABEL: andqbrst:
150 ; KNL: ## %bb.0: ## %entry
151 ; KNL-NEXT: vpandq (%rdi){1to8}, %zmm0, %zmm0
154 ; SKX-LABEL: andqbrst:
155 ; SKX: ## %bb.0: ## %entry
156 ; SKX-NEXT: vandpd (%rdi){1to8}, %zmm0, %zmm0
159 %a = load i64, ptr %ap, align 8
160 %b = insertelement <8 x i64> undef, i64 %a, i32 0
161 %c = shufflevector <8 x i64> %b, <8 x i64> undef, <8 x i32> zeroinitializer
162 %d = and <8 x i64> %p1, %c
166 define <64 x i8> @and_v64i8(<64 x i8> %a, <64 x i8> %b) {
167 ; KNL-LABEL: and_v64i8:
169 ; KNL-NEXT: vpandq %zmm1, %zmm0, %zmm0
172 ; SKX-LABEL: and_v64i8:
174 ; SKX-NEXT: vandps %zmm1, %zmm0, %zmm0
176 %res = and <64 x i8> %a, %b
180 define <64 x i8> @andn_v64i8(<64 x i8> %a, <64 x i8> %b) {
181 ; KNL-LABEL: andn_v64i8:
183 ; KNL-NEXT: vpandnq %zmm0, %zmm1, %zmm0
186 ; SKX-LABEL: andn_v64i8:
188 ; SKX-NEXT: vandnps %zmm0, %zmm1, %zmm0
190 %b2 = xor <64 x i8> %b, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
191 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
192 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1,
193 i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
194 %res = and <64 x i8> %a, %b2
198 define <64 x i8> @or_v64i8(<64 x i8> %a, <64 x i8> %b) {
199 ; KNL-LABEL: or_v64i8:
201 ; KNL-NEXT: vporq %zmm1, %zmm0, %zmm0
204 ; SKX-LABEL: or_v64i8:
206 ; SKX-NEXT: vorps %zmm1, %zmm0, %zmm0
208 %res = or <64 x i8> %a, %b
212 define <64 x i8> @xor_v64i8(<64 x i8> %a, <64 x i8> %b) {
213 ; KNL-LABEL: xor_v64i8:
215 ; KNL-NEXT: vpxorq %zmm1, %zmm0, %zmm0
218 ; SKX-LABEL: xor_v64i8:
220 ; SKX-NEXT: vxorps %zmm1, %zmm0, %zmm0
222 %res = xor <64 x i8> %a, %b
226 define <32 x i16> @and_v32i16(<32 x i16> %a, <32 x i16> %b) {
227 ; KNL-LABEL: and_v32i16:
229 ; KNL-NEXT: vpandq %zmm1, %zmm0, %zmm0
232 ; SKX-LABEL: and_v32i16:
234 ; SKX-NEXT: vandps %zmm1, %zmm0, %zmm0
236 %res = and <32 x i16> %a, %b
240 define <32 x i16> @andn_v32i16(<32 x i16> %a, <32 x i16> %b) {
241 ; KNL-LABEL: andn_v32i16:
243 ; KNL-NEXT: vpandnq %zmm0, %zmm1, %zmm0
246 ; SKX-LABEL: andn_v32i16:
248 ; SKX-NEXT: vandnps %zmm0, %zmm1, %zmm0
250 %b2 = xor <32 x i16> %b, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1,
251 i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
252 %res = and <32 x i16> %a, %b2
256 define <32 x i16> @or_v32i16(<32 x i16> %a, <32 x i16> %b) {
257 ; KNL-LABEL: or_v32i16:
259 ; KNL-NEXT: vporq %zmm1, %zmm0, %zmm0
262 ; SKX-LABEL: or_v32i16:
264 ; SKX-NEXT: vorps %zmm1, %zmm0, %zmm0
266 %res = or <32 x i16> %a, %b
270 define <32 x i16> @xor_v32i16(<32 x i16> %a, <32 x i16> %b) {
271 ; KNL-LABEL: xor_v32i16:
273 ; KNL-NEXT: vpxorq %zmm1, %zmm0, %zmm0
276 ; SKX-LABEL: xor_v32i16:
278 ; SKX-NEXT: vxorps %zmm1, %zmm0, %zmm0
280 %res = xor <32 x i16> %a, %b
284 define <16 x float> @masked_and_v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %passThru, i16 %mask, <16 x float> %c) {
285 ; KNL-LABEL: masked_and_v16f32:
287 ; KNL-NEXT: kmovw %edi, %k1
288 ; KNL-NEXT: vpandd %zmm1, %zmm0, %zmm2 {%k1}
289 ; KNL-NEXT: vaddps %zmm2, %zmm3, %zmm0
292 ; SKX-LABEL: masked_and_v16f32:
294 ; SKX-NEXT: kmovd %edi, %k1
295 ; SKX-NEXT: vandps %zmm1, %zmm0, %zmm2 {%k1}
296 ; SKX-NEXT: vaddps %zmm2, %zmm3, %zmm0
298 %a1 = bitcast <16 x float> %a to <16 x i32>
299 %b1 = bitcast <16 x float> %b to <16 x i32>
300 %passThru1 = bitcast <16 x float> %passThru to <16 x i32>
301 %mask1 = bitcast i16 %mask to <16 x i1>
302 %op = and <16 x i32> %a1, %b1
303 %select = select <16 x i1> %mask1, <16 x i32> %op, <16 x i32> %passThru1
304 %cast = bitcast <16 x i32> %select to <16 x float>
305 %add = fadd <16 x float> %c, %cast
306 ret <16 x float> %add
309 define <16 x float> @masked_or_v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %passThru, i16 %mask, <16 x float> %c) {
310 ; KNL-LABEL: masked_or_v16f32:
312 ; KNL-NEXT: kmovw %edi, %k1
313 ; KNL-NEXT: vpandd %zmm1, %zmm0, %zmm2 {%k1}
314 ; KNL-NEXT: vaddps %zmm2, %zmm3, %zmm0
317 ; SKX-LABEL: masked_or_v16f32:
319 ; SKX-NEXT: kmovd %edi, %k1
320 ; SKX-NEXT: vandps %zmm1, %zmm0, %zmm2 {%k1}
321 ; SKX-NEXT: vaddps %zmm2, %zmm3, %zmm0
323 %a1 = bitcast <16 x float> %a to <16 x i32>
324 %b1 = bitcast <16 x float> %b to <16 x i32>
325 %passThru1 = bitcast <16 x float> %passThru to <16 x i32>
326 %mask1 = bitcast i16 %mask to <16 x i1>
327 %op = and <16 x i32> %a1, %b1
328 %select = select <16 x i1> %mask1, <16 x i32> %op, <16 x i32> %passThru1
329 %cast = bitcast <16 x i32> %select to <16 x float>
330 %add = fadd <16 x float> %c, %cast
331 ret <16 x float> %add
334 define <16 x float> @masked_xor_v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %passThru, i16 %mask, <16 x float> %c) {
335 ; KNL-LABEL: masked_xor_v16f32:
337 ; KNL-NEXT: kmovw %edi, %k1
338 ; KNL-NEXT: vpandd %zmm1, %zmm0, %zmm2 {%k1}
339 ; KNL-NEXT: vaddps %zmm2, %zmm3, %zmm0
342 ; SKX-LABEL: masked_xor_v16f32:
344 ; SKX-NEXT: kmovd %edi, %k1
345 ; SKX-NEXT: vandps %zmm1, %zmm0, %zmm2 {%k1}
346 ; SKX-NEXT: vaddps %zmm2, %zmm3, %zmm0
348 %a1 = bitcast <16 x float> %a to <16 x i32>
349 %b1 = bitcast <16 x float> %b to <16 x i32>
350 %passThru1 = bitcast <16 x float> %passThru to <16 x i32>
351 %mask1 = bitcast i16 %mask to <16 x i1>
352 %op = and <16 x i32> %a1, %b1
353 %select = select <16 x i1> %mask1, <16 x i32> %op, <16 x i32> %passThru1
354 %cast = bitcast <16 x i32> %select to <16 x float>
355 %add = fadd <16 x float> %c, %cast
356 ret <16 x float> %add
359 define <8 x double> @masked_and_v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %passThru, i8 %mask, <8 x double> %c) {
360 ; KNL-LABEL: masked_and_v8f64:
362 ; KNL-NEXT: kmovw %edi, %k1
363 ; KNL-NEXT: vpandq %zmm1, %zmm0, %zmm2 {%k1}
364 ; KNL-NEXT: vaddpd %zmm2, %zmm3, %zmm0
367 ; SKX-LABEL: masked_and_v8f64:
369 ; SKX-NEXT: kmovd %edi, %k1
370 ; SKX-NEXT: vandpd %zmm1, %zmm0, %zmm2 {%k1}
371 ; SKX-NEXT: vaddpd %zmm2, %zmm3, %zmm0
373 %a1 = bitcast <8 x double> %a to <8 x i64>
374 %b1 = bitcast <8 x double> %b to <8 x i64>
375 %passThru1 = bitcast <8 x double> %passThru to <8 x i64>
376 %mask1 = bitcast i8 %mask to <8 x i1>
377 %op = and <8 x i64> %a1, %b1
378 %select = select <8 x i1> %mask1, <8 x i64> %op, <8 x i64> %passThru1
379 %cast = bitcast <8 x i64> %select to <8 x double>
380 %add = fadd <8 x double> %c, %cast
381 ret <8 x double> %add
384 define <8 x double> @masked_or_v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %passThru, i8 %mask, <8 x double> %c) {
385 ; KNL-LABEL: masked_or_v8f64:
387 ; KNL-NEXT: kmovw %edi, %k1
388 ; KNL-NEXT: vpandq %zmm1, %zmm0, %zmm2 {%k1}
389 ; KNL-NEXT: vaddpd %zmm2, %zmm3, %zmm0
392 ; SKX-LABEL: masked_or_v8f64:
394 ; SKX-NEXT: kmovd %edi, %k1
395 ; SKX-NEXT: vandpd %zmm1, %zmm0, %zmm2 {%k1}
396 ; SKX-NEXT: vaddpd %zmm2, %zmm3, %zmm0
398 %a1 = bitcast <8 x double> %a to <8 x i64>
399 %b1 = bitcast <8 x double> %b to <8 x i64>
400 %passThru1 = bitcast <8 x double> %passThru to <8 x i64>
401 %mask1 = bitcast i8 %mask to <8 x i1>
402 %op = and <8 x i64> %a1, %b1
403 %select = select <8 x i1> %mask1, <8 x i64> %op, <8 x i64> %passThru1
404 %cast = bitcast <8 x i64> %select to <8 x double>
405 %add = fadd <8 x double> %c, %cast
406 ret <8 x double> %add
409 define <8 x double> @masked_xor_v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %passThru, i8 %mask, <8 x double> %c) {
410 ; KNL-LABEL: masked_xor_v8f64:
412 ; KNL-NEXT: kmovw %edi, %k1
413 ; KNL-NEXT: vpandq %zmm1, %zmm0, %zmm2 {%k1}
414 ; KNL-NEXT: vaddpd %zmm2, %zmm3, %zmm0
417 ; SKX-LABEL: masked_xor_v8f64:
419 ; SKX-NEXT: kmovd %edi, %k1
420 ; SKX-NEXT: vandpd %zmm1, %zmm0, %zmm2 {%k1}
421 ; SKX-NEXT: vaddpd %zmm2, %zmm3, %zmm0
423 %a1 = bitcast <8 x double> %a to <8 x i64>
424 %b1 = bitcast <8 x double> %b to <8 x i64>
425 %passThru1 = bitcast <8 x double> %passThru to <8 x i64>
426 %mask1 = bitcast i8 %mask to <8 x i1>
427 %op = and <8 x i64> %a1, %b1
428 %select = select <8 x i1> %mask1, <8 x i64> %op, <8 x i64> %passThru1
429 %cast = bitcast <8 x i64> %select to <8 x double>
430 %add = fadd <8 x double> %c, %cast
431 ret <8 x double> %add
434 define <8 x i64> @test_mm512_mask_and_epi32(<8 x i64> %__src, i16 zeroext %__k, <8 x i64> %__a, <8 x i64> %__b) {
435 ; KNL-LABEL: test_mm512_mask_and_epi32:
436 ; KNL: ## %bb.0: ## %entry
437 ; KNL-NEXT: kmovw %edi, %k1
438 ; KNL-NEXT: vpandd %zmm2, %zmm1, %zmm0 {%k1}
441 ; SKX-LABEL: test_mm512_mask_and_epi32:
442 ; SKX: ## %bb.0: ## %entry
443 ; SKX-NEXT: kmovd %edi, %k1
444 ; SKX-NEXT: vandps %zmm2, %zmm1, %zmm0 {%k1}
447 %and1.i.i = and <8 x i64> %__a, %__b
448 %0 = bitcast <8 x i64> %and1.i.i to <16 x i32>
449 %1 = bitcast <8 x i64> %__src to <16 x i32>
450 %2 = bitcast i16 %__k to <16 x i1>
451 %3 = select <16 x i1> %2, <16 x i32> %0, <16 x i32> %1
452 %4 = bitcast <16 x i32> %3 to <8 x i64>
456 define <8 x i64> @test_mm512_mask_or_epi32(<8 x i64> %__src, i16 zeroext %__k, <8 x i64> %__a, <8 x i64> %__b) {
457 ; KNL-LABEL: test_mm512_mask_or_epi32:
458 ; KNL: ## %bb.0: ## %entry
459 ; KNL-NEXT: kmovw %edi, %k1
460 ; KNL-NEXT: vpord %zmm2, %zmm1, %zmm0 {%k1}
463 ; SKX-LABEL: test_mm512_mask_or_epi32:
464 ; SKX: ## %bb.0: ## %entry
465 ; SKX-NEXT: kmovd %edi, %k1
466 ; SKX-NEXT: vorps %zmm2, %zmm1, %zmm0 {%k1}
469 %or1.i.i = or <8 x i64> %__a, %__b
470 %0 = bitcast <8 x i64> %or1.i.i to <16 x i32>
471 %1 = bitcast <8 x i64> %__src to <16 x i32>
472 %2 = bitcast i16 %__k to <16 x i1>
473 %3 = select <16 x i1> %2, <16 x i32> %0, <16 x i32> %1
474 %4 = bitcast <16 x i32> %3 to <8 x i64>
478 define <8 x i64> @test_mm512_mask_xor_epi32(<8 x i64> %__src, i16 zeroext %__k, <8 x i64> %__a, <8 x i64> %__b) {
479 ; KNL-LABEL: test_mm512_mask_xor_epi32:
480 ; KNL: ## %bb.0: ## %entry
481 ; KNL-NEXT: kmovw %edi, %k1
482 ; KNL-NEXT: vpxord %zmm2, %zmm1, %zmm0 {%k1}
485 ; SKX-LABEL: test_mm512_mask_xor_epi32:
486 ; SKX: ## %bb.0: ## %entry
487 ; SKX-NEXT: kmovd %edi, %k1
488 ; SKX-NEXT: vxorps %zmm2, %zmm1, %zmm0 {%k1}
491 %xor1.i.i = xor <8 x i64> %__a, %__b
492 %0 = bitcast <8 x i64> %xor1.i.i to <16 x i32>
493 %1 = bitcast <8 x i64> %__src to <16 x i32>
494 %2 = bitcast i16 %__k to <16 x i1>
495 %3 = select <16 x i1> %2, <16 x i32> %0, <16 x i32> %1
496 %4 = bitcast <16 x i32> %3 to <8 x i64>
500 define <8 x double> @test_mm512_mask_xor_pd(<8 x double> %__W, i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
501 ; KNL-LABEL: test_mm512_mask_xor_pd:
502 ; KNL: ## %bb.0: ## %entry
503 ; KNL-NEXT: kmovw %edi, %k1
504 ; KNL-NEXT: vpxorq %zmm2, %zmm1, %zmm0 {%k1}
507 ; SKX-LABEL: test_mm512_mask_xor_pd:
508 ; SKX: ## %bb.0: ## %entry
509 ; SKX-NEXT: kmovd %edi, %k1
510 ; SKX-NEXT: vxorpd %zmm2, %zmm1, %zmm0 {%k1}
513 %0 = bitcast <8 x double> %__A to <8 x i64>
514 %1 = bitcast <8 x double> %__B to <8 x i64>
515 %xor.i.i = xor <8 x i64> %0, %1
516 %2 = bitcast <8 x i64> %xor.i.i to <8 x double>
517 %3 = bitcast i8 %__U to <8 x i1>
518 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> %__W
522 define <8 x double> @test_mm512_maskz_xor_pd(i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
523 ; KNL-LABEL: test_mm512_maskz_xor_pd:
524 ; KNL: ## %bb.0: ## %entry
525 ; KNL-NEXT: kmovw %edi, %k1
526 ; KNL-NEXT: vpxorq %zmm1, %zmm0, %zmm0 {%k1} {z}
529 ; SKX-LABEL: test_mm512_maskz_xor_pd:
530 ; SKX: ## %bb.0: ## %entry
531 ; SKX-NEXT: kmovd %edi, %k1
532 ; SKX-NEXT: vxorpd %zmm1, %zmm0, %zmm0 {%k1} {z}
535 %0 = bitcast <8 x double> %__A to <8 x i64>
536 %1 = bitcast <8 x double> %__B to <8 x i64>
537 %xor.i.i = xor <8 x i64> %0, %1
538 %2 = bitcast <8 x i64> %xor.i.i to <8 x double>
539 %3 = bitcast i8 %__U to <8 x i1>
540 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> zeroinitializer
544 define <16 x float> @test_mm512_mask_xor_ps(<16 x float> %__W, i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
545 ; KNL-LABEL: test_mm512_mask_xor_ps:
546 ; KNL: ## %bb.0: ## %entry
547 ; KNL-NEXT: kmovw %edi, %k1
548 ; KNL-NEXT: vpxord %zmm2, %zmm1, %zmm0 {%k1}
551 ; SKX-LABEL: test_mm512_mask_xor_ps:
552 ; SKX: ## %bb.0: ## %entry
553 ; SKX-NEXT: kmovd %edi, %k1
554 ; SKX-NEXT: vxorps %zmm2, %zmm1, %zmm0 {%k1}
557 %0 = bitcast <16 x float> %__A to <16 x i32>
558 %1 = bitcast <16 x float> %__B to <16 x i32>
559 %xor.i.i = xor <16 x i32> %0, %1
560 %2 = bitcast <16 x i32> %xor.i.i to <16 x float>
561 %3 = bitcast i16 %__U to <16 x i1>
562 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> %__W
566 define <16 x float> @test_mm512_maskz_xor_ps(i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
567 ; KNL-LABEL: test_mm512_maskz_xor_ps:
568 ; KNL: ## %bb.0: ## %entry
569 ; KNL-NEXT: kmovw %edi, %k1
570 ; KNL-NEXT: vpxord %zmm1, %zmm0, %zmm0 {%k1} {z}
573 ; SKX-LABEL: test_mm512_maskz_xor_ps:
574 ; SKX: ## %bb.0: ## %entry
575 ; SKX-NEXT: kmovd %edi, %k1
576 ; SKX-NEXT: vxorps %zmm1, %zmm0, %zmm0 {%k1} {z}
579 %0 = bitcast <16 x float> %__A to <16 x i32>
580 %1 = bitcast <16 x float> %__B to <16 x i32>
581 %xor.i.i = xor <16 x i32> %0, %1
582 %2 = bitcast <16 x i32> %xor.i.i to <16 x float>
583 %3 = bitcast i16 %__U to <16 x i1>
584 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> zeroinitializer
588 define <8 x double> @test_mm512_mask_or_pd(<8 x double> %__W, i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
589 ; KNL-LABEL: test_mm512_mask_or_pd:
590 ; KNL: ## %bb.0: ## %entry
591 ; KNL-NEXT: kmovw %edi, %k1
592 ; KNL-NEXT: vporq %zmm1, %zmm2, %zmm0 {%k1}
595 ; SKX-LABEL: test_mm512_mask_or_pd:
596 ; SKX: ## %bb.0: ## %entry
597 ; SKX-NEXT: kmovd %edi, %k1
598 ; SKX-NEXT: vorpd %zmm1, %zmm2, %zmm0 {%k1}
601 %0 = bitcast <8 x double> %__A to <8 x i64>
602 %1 = bitcast <8 x double> %__B to <8 x i64>
603 %or.i.i = or <8 x i64> %1, %0
604 %2 = bitcast <8 x i64> %or.i.i to <8 x double>
605 %3 = bitcast i8 %__U to <8 x i1>
606 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> %__W
610 define <8 x double> @test_mm512_maskz_or_pd(i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
611 ; KNL-LABEL: test_mm512_maskz_or_pd:
612 ; KNL: ## %bb.0: ## %entry
613 ; KNL-NEXT: kmovw %edi, %k1
614 ; KNL-NEXT: vporq %zmm0, %zmm1, %zmm0 {%k1} {z}
617 ; SKX-LABEL: test_mm512_maskz_or_pd:
618 ; SKX: ## %bb.0: ## %entry
619 ; SKX-NEXT: kmovd %edi, %k1
620 ; SKX-NEXT: vorpd %zmm0, %zmm1, %zmm0 {%k1} {z}
623 %0 = bitcast <8 x double> %__A to <8 x i64>
624 %1 = bitcast <8 x double> %__B to <8 x i64>
625 %or.i.i = or <8 x i64> %1, %0
626 %2 = bitcast <8 x i64> %or.i.i to <8 x double>
627 %3 = bitcast i8 %__U to <8 x i1>
628 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> zeroinitializer
632 define <16 x float> @test_mm512_mask_or_ps(<16 x float> %__W, i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
633 ; KNL-LABEL: test_mm512_mask_or_ps:
634 ; KNL: ## %bb.0: ## %entry
635 ; KNL-NEXT: kmovw %edi, %k1
636 ; KNL-NEXT: vpord %zmm1, %zmm2, %zmm0 {%k1}
639 ; SKX-LABEL: test_mm512_mask_or_ps:
640 ; SKX: ## %bb.0: ## %entry
641 ; SKX-NEXT: kmovd %edi, %k1
642 ; SKX-NEXT: vorps %zmm1, %zmm2, %zmm0 {%k1}
645 %0 = bitcast <16 x float> %__A to <16 x i32>
646 %1 = bitcast <16 x float> %__B to <16 x i32>
647 %or.i.i = or <16 x i32> %1, %0
648 %2 = bitcast <16 x i32> %or.i.i to <16 x float>
649 %3 = bitcast i16 %__U to <16 x i1>
650 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> %__W
654 define <16 x float> @test_mm512_maskz_or_ps(i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
655 ; KNL-LABEL: test_mm512_maskz_or_ps:
656 ; KNL: ## %bb.0: ## %entry
657 ; KNL-NEXT: kmovw %edi, %k1
658 ; KNL-NEXT: vpord %zmm0, %zmm1, %zmm0 {%k1} {z}
661 ; SKX-LABEL: test_mm512_maskz_or_ps:
662 ; SKX: ## %bb.0: ## %entry
663 ; SKX-NEXT: kmovd %edi, %k1
664 ; SKX-NEXT: vorps %zmm0, %zmm1, %zmm0 {%k1} {z}
667 %0 = bitcast <16 x float> %__A to <16 x i32>
668 %1 = bitcast <16 x float> %__B to <16 x i32>
669 %or.i.i = or <16 x i32> %1, %0
670 %2 = bitcast <16 x i32> %or.i.i to <16 x float>
671 %3 = bitcast i16 %__U to <16 x i1>
672 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> zeroinitializer
676 define <8 x double> @test_mm512_mask_and_pd(<8 x double> %__W, i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
677 ; KNL-LABEL: test_mm512_mask_and_pd:
678 ; KNL: ## %bb.0: ## %entry
679 ; KNL-NEXT: kmovw %edi, %k1
680 ; KNL-NEXT: vpandq %zmm1, %zmm2, %zmm0 {%k1}
683 ; SKX-LABEL: test_mm512_mask_and_pd:
684 ; SKX: ## %bb.0: ## %entry
685 ; SKX-NEXT: kmovd %edi, %k1
686 ; SKX-NEXT: vandpd %zmm1, %zmm2, %zmm0 {%k1}
689 %0 = bitcast <8 x double> %__A to <8 x i64>
690 %1 = bitcast <8 x double> %__B to <8 x i64>
691 %and.i.i = and <8 x i64> %1, %0
692 %2 = bitcast <8 x i64> %and.i.i to <8 x double>
693 %3 = bitcast i8 %__U to <8 x i1>
694 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> %__W
698 define <8 x double> @test_mm512_maskz_and_pd(i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
699 ; KNL-LABEL: test_mm512_maskz_and_pd:
700 ; KNL: ## %bb.0: ## %entry
701 ; KNL-NEXT: kmovw %edi, %k1
702 ; KNL-NEXT: vpandq %zmm0, %zmm1, %zmm0 {%k1} {z}
705 ; SKX-LABEL: test_mm512_maskz_and_pd:
706 ; SKX: ## %bb.0: ## %entry
707 ; SKX-NEXT: kmovd %edi, %k1
708 ; SKX-NEXT: vandpd %zmm0, %zmm1, %zmm0 {%k1} {z}
711 %0 = bitcast <8 x double> %__A to <8 x i64>
712 %1 = bitcast <8 x double> %__B to <8 x i64>
713 %and.i.i = and <8 x i64> %1, %0
714 %2 = bitcast <8 x i64> %and.i.i to <8 x double>
715 %3 = bitcast i8 %__U to <8 x i1>
716 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> zeroinitializer
720 define <16 x float> @test_mm512_mask_and_ps(<16 x float> %__W, i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
721 ; KNL-LABEL: test_mm512_mask_and_ps:
722 ; KNL: ## %bb.0: ## %entry
723 ; KNL-NEXT: kmovw %edi, %k1
724 ; KNL-NEXT: vpandd %zmm1, %zmm2, %zmm0 {%k1}
727 ; SKX-LABEL: test_mm512_mask_and_ps:
728 ; SKX: ## %bb.0: ## %entry
729 ; SKX-NEXT: kmovd %edi, %k1
730 ; SKX-NEXT: vandps %zmm1, %zmm2, %zmm0 {%k1}
733 %0 = bitcast <16 x float> %__A to <16 x i32>
734 %1 = bitcast <16 x float> %__B to <16 x i32>
735 %and.i.i = and <16 x i32> %1, %0
736 %2 = bitcast <16 x i32> %and.i.i to <16 x float>
737 %3 = bitcast i16 %__U to <16 x i1>
738 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> %__W
742 define <16 x float> @test_mm512_maskz_and_ps(i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
743 ; KNL-LABEL: test_mm512_maskz_and_ps:
744 ; KNL: ## %bb.0: ## %entry
745 ; KNL-NEXT: kmovw %edi, %k1
746 ; KNL-NEXT: vpandd %zmm0, %zmm1, %zmm0 {%k1} {z}
749 ; SKX-LABEL: test_mm512_maskz_and_ps:
750 ; SKX: ## %bb.0: ## %entry
751 ; SKX-NEXT: kmovd %edi, %k1
752 ; SKX-NEXT: vandps %zmm0, %zmm1, %zmm0 {%k1} {z}
755 %0 = bitcast <16 x float> %__A to <16 x i32>
756 %1 = bitcast <16 x float> %__B to <16 x i32>
757 %and.i.i = and <16 x i32> %1, %0
758 %2 = bitcast <16 x i32> %and.i.i to <16 x float>
759 %3 = bitcast i16 %__U to <16 x i1>
760 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> zeroinitializer
764 define <8 x double> @test_mm512_mask_andnot_pd(<8 x double> %__W, i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
765 ; KNL-LABEL: test_mm512_mask_andnot_pd:
766 ; KNL: ## %bb.0: ## %entry
767 ; KNL-NEXT: kmovw %edi, %k1
768 ; KNL-NEXT: vpandnq %zmm2, %zmm1, %zmm0 {%k1}
771 ; SKX-LABEL: test_mm512_mask_andnot_pd:
772 ; SKX: ## %bb.0: ## %entry
773 ; SKX-NEXT: kmovd %edi, %k1
774 ; SKX-NEXT: vandnpd %zmm2, %zmm1, %zmm0 {%k1}
777 %0 = bitcast <8 x double> %__A to <8 x i64>
778 %neg.i.i = xor <8 x i64> %0, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
779 %1 = bitcast <8 x double> %__B to <8 x i64>
780 %and.i.i = and <8 x i64> %1, %neg.i.i
781 %2 = bitcast <8 x i64> %and.i.i to <8 x double>
782 %3 = bitcast i8 %__U to <8 x i1>
783 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> %__W
787 define <8 x double> @test_mm512_maskz_andnot_pd(i8 zeroext %__U, <8 x double> %__A, <8 x double> %__B) {
788 ; KNL-LABEL: test_mm512_maskz_andnot_pd:
789 ; KNL: ## %bb.0: ## %entry
790 ; KNL-NEXT: kmovw %edi, %k1
791 ; KNL-NEXT: vpandnq %zmm1, %zmm0, %zmm0 {%k1} {z}
794 ; SKX-LABEL: test_mm512_maskz_andnot_pd:
795 ; SKX: ## %bb.0: ## %entry
796 ; SKX-NEXT: kmovd %edi, %k1
797 ; SKX-NEXT: vandnpd %zmm1, %zmm0, %zmm0 {%k1} {z}
800 %0 = bitcast <8 x double> %__A to <8 x i64>
801 %neg.i.i = xor <8 x i64> %0, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
802 %1 = bitcast <8 x double> %__B to <8 x i64>
803 %and.i.i = and <8 x i64> %1, %neg.i.i
804 %2 = bitcast <8 x i64> %and.i.i to <8 x double>
805 %3 = bitcast i8 %__U to <8 x i1>
806 %4 = select <8 x i1> %3, <8 x double> %2, <8 x double> zeroinitializer
810 define <16 x float> @test_mm512_mask_andnot_ps(<16 x float> %__W, i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
811 ; KNL-LABEL: test_mm512_mask_andnot_ps:
812 ; KNL: ## %bb.0: ## %entry
813 ; KNL-NEXT: kmovw %edi, %k1
814 ; KNL-NEXT: vpandnd %zmm2, %zmm1, %zmm0 {%k1}
817 ; SKX-LABEL: test_mm512_mask_andnot_ps:
818 ; SKX: ## %bb.0: ## %entry
819 ; SKX-NEXT: kmovd %edi, %k1
820 ; SKX-NEXT: vandnps %zmm2, %zmm1, %zmm0 {%k1}
823 %0 = bitcast <16 x float> %__A to <16 x i32>
824 %neg.i.i = xor <16 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
825 %1 = bitcast <16 x float> %__B to <16 x i32>
826 %and.i.i = and <16 x i32> %1, %neg.i.i
827 %2 = bitcast <16 x i32> %and.i.i to <16 x float>
828 %3 = bitcast i16 %__U to <16 x i1>
829 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> %__W
833 define <16 x float> @test_mm512_maskz_andnot_ps(i16 zeroext %__U, <16 x float> %__A, <16 x float> %__B) {
834 ; KNL-LABEL: test_mm512_maskz_andnot_ps:
835 ; KNL: ## %bb.0: ## %entry
836 ; KNL-NEXT: kmovw %edi, %k1
837 ; KNL-NEXT: vpandnd %zmm1, %zmm0, %zmm0 {%k1} {z}
840 ; SKX-LABEL: test_mm512_maskz_andnot_ps:
841 ; SKX: ## %bb.0: ## %entry
842 ; SKX-NEXT: kmovd %edi, %k1
843 ; SKX-NEXT: vandnps %zmm1, %zmm0, %zmm0 {%k1} {z}
846 %0 = bitcast <16 x float> %__A to <16 x i32>
847 %neg.i.i = xor <16 x i32> %0, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
848 %1 = bitcast <16 x float> %__B to <16 x i32>
849 %and.i.i = and <16 x i32> %1, %neg.i.i
850 %2 = bitcast <16 x i32> %and.i.i to <16 x float>
851 %3 = bitcast i16 %__U to <16 x i1>
852 %4 = select <16 x i1> %3, <16 x float> %2, <16 x float> zeroinitializer
856 define <16 x i32> @ternlog_and_andn(<16 x i32> %x, <16 x i32> %y, <16 x i32> %z) {
857 ; ALL-LABEL: ternlog_and_andn:
859 ; ALL-NEXT: vpternlogd $8, %zmm1, %zmm2, %zmm0
861 %a = xor <16 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
862 %b = and <16 x i32> %y, %a
863 %c = and <16 x i32> %b, %z
867 define <16 x i32> @ternlog_or_andn(<16 x i32> %x, <16 x i32> %y, <16 x i32> %z) {
868 ; ALL-LABEL: ternlog_or_andn:
870 ; ALL-NEXT: vpternlogd $206, %zmm1, %zmm2, %zmm0
872 %a = xor <16 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
873 %b = and <16 x i32> %y, %a
874 %c = or <16 x i32> %b, %z
878 define <16 x i32> @ternlog_xor_andn(<16 x i32> %x, <16 x i32> %y, <16 x i32> %z) {
879 ; ALL-LABEL: ternlog_xor_andn:
881 ; ALL-NEXT: vpternlogd $198, %zmm1, %zmm2, %zmm0
883 %a = xor <16 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
884 %b = and <16 x i32> %y, %a
885 %c = xor <16 x i32> %b, %z
889 define <16 x i32> @ternlog_or_and_mask(<16 x i32> %x, <16 x i32> %y) {
890 ; ALL-LABEL: ternlog_or_and_mask:
892 ; ALL-NEXT: vpternlogd $236, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %zmm0
894 %a = and <16 x i32> %x, <i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255>
895 %b = or <16 x i32> %a, %y
899 define <8 x i64> @ternlog_xor_and_mask(<8 x i64> %x, <8 x i64> %y) {
900 ; ALL-LABEL: ternlog_xor_and_mask:
902 ; ALL-NEXT: vpternlogq $108, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm1, %zmm0
904 %a = and <8 x i64> %x, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
905 %b = xor <8 x i64> %a, %y
909 define <16 x i32> @ternlog_maskz_or_and_mask(<16 x i32> %x, <16 x i32> %y, <16 x i32> %mask) {
910 ; ALL-LABEL: ternlog_maskz_or_and_mask:
912 ; ALL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm3
913 ; ALL-NEXT: vpsrad $31, %zmm2, %zmm0
914 ; ALL-NEXT: vpternlogd $224, %zmm1, %zmm3, %zmm0
916 %m = icmp slt <16 x i32> %mask, zeroinitializer
917 %a = and <16 x i32> %x, <i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255>
918 %b = or <16 x i32> %a, %y
919 %c = select <16 x i1> %m, <16 x i32> %b, <16 x i32> zeroinitializer
923 define <8 x i64> @ternlog_maskz_xor_and_mask(<8 x i64> %x, <8 x i64> %y, <8 x i64> %mask) {
924 ; ALL-LABEL: ternlog_maskz_xor_and_mask:
926 ; ALL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm3
927 ; ALL-NEXT: vpsraq $63, %zmm2, %zmm0
928 ; ALL-NEXT: vpternlogq $96, %zmm1, %zmm3, %zmm0
930 %m = icmp slt <8 x i64> %mask, zeroinitializer
931 %a = and <8 x i64> %x, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
932 %b = xor <8 x i64> %a, %y
933 %c = select <8 x i1> %m, <8 x i64> %b, <8 x i64> zeroinitializer
937 define <16 x i32> @ternlog_maskx_or_and_mask(<16 x i32> %x, <16 x i32> %y, <16 x i32> %mask) {
938 ; KNL-LABEL: ternlog_maskx_or_and_mask:
940 ; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3
941 ; KNL-NEXT: vpcmpgtd %zmm2, %zmm3, %k1
942 ; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm2
943 ; KNL-NEXT: vpord %zmm1, %zmm2, %zmm0 {%k1}
946 ; SKX-LABEL: ternlog_maskx_or_and_mask:
948 ; SKX-NEXT: vpmovd2m %zmm2, %k1
949 ; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm2
950 ; SKX-NEXT: vorps %zmm1, %zmm2, %zmm0 {%k1}
952 %m = icmp slt <16 x i32> %mask, zeroinitializer
953 %a = and <16 x i32> %x, <i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255>
954 %b = or <16 x i32> %a, %y
955 %c = select <16 x i1> %m, <16 x i32> %b, <16 x i32> %x
959 define <16 x i32> @ternlog_masky_or_and_mask(<16 x i32> %x, <16 x i32> %y, <16 x i32> %mask) {
960 ; KNL-LABEL: ternlog_masky_or_and_mask:
962 ; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3
963 ; KNL-NEXT: vpcmpgtd %zmm2, %zmm3, %k1
964 ; KNL-NEXT: vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
965 ; KNL-NEXT: vpord %zmm1, %zmm0, %zmm1 {%k1}
966 ; KNL-NEXT: vmovdqa64 %zmm1, %zmm0
969 ; SKX-LABEL: ternlog_masky_or_and_mask:
971 ; SKX-NEXT: vpmovd2m %zmm2, %k1
972 ; SKX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm0, %zmm0
973 ; SKX-NEXT: vorps %zmm1, %zmm0, %zmm1 {%k1}
974 ; SKX-NEXT: vmovaps %zmm1, %zmm0
976 %m = icmp slt <16 x i32> %mask, zeroinitializer
977 %a = and <16 x i32> %x, <i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255, i32 255>
978 %b = or <16 x i32> %a, %y
979 %c = select <16 x i1> %m, <16 x i32> %b, <16 x i32> %y
983 define <8 x i64> @ternlog_maskx_xor_and_mask(<8 x i64> %x, <8 x i64> %y, <8 x i64> %mask) {
984 ; KNL-LABEL: ternlog_maskx_xor_and_mask:
986 ; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3
987 ; KNL-NEXT: vpcmpgtq %zmm2, %zmm3, %k1
988 ; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm2
989 ; KNL-NEXT: vpxorq %zmm1, %zmm2, %zmm0 {%k1}
992 ; SKX-LABEL: ternlog_maskx_xor_and_mask:
994 ; SKX-NEXT: vpmovq2m %zmm2, %k1
995 ; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm2
996 ; SKX-NEXT: vxorpd %zmm1, %zmm2, %zmm0 {%k1}
998 %m = icmp slt <8 x i64> %mask, zeroinitializer
999 %a = and <8 x i64> %x, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
1000 %b = xor <8 x i64> %a, %y
1001 %c = select <8 x i1> %m, <8 x i64> %b, <8 x i64> %x
1005 define <8 x i64> @ternlog_masky_xor_and_mask(<8 x i64> %x, <8 x i64> %y, <8 x i64> %mask) {
1006 ; KNL-LABEL: ternlog_masky_xor_and_mask:
1008 ; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3
1009 ; KNL-NEXT: vpcmpgtq %zmm2, %zmm3, %k1
1010 ; KNL-NEXT: vpandq {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
1011 ; KNL-NEXT: vpxorq %zmm1, %zmm0, %zmm1 {%k1}
1012 ; KNL-NEXT: vmovdqa64 %zmm1, %zmm0
1015 ; SKX-LABEL: ternlog_masky_xor_and_mask:
1017 ; SKX-NEXT: vpmovq2m %zmm2, %k1
1018 ; SKX-NEXT: vandpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm0, %zmm0
1019 ; SKX-NEXT: vxorpd %zmm1, %zmm0, %zmm1 {%k1}
1020 ; SKX-NEXT: vmovapd %zmm1, %zmm0
1022 %m = icmp slt <8 x i64> %mask, zeroinitializer
1023 %a = and <8 x i64> %x, <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295>
1024 %b = xor <8 x i64> %a, %y
1025 %c = select <8 x i1> %m, <8 x i64> %b, <8 x i64> %y