1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -disable-peephole -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck %s
4 ; These test cases demonstrate cases where vpternlog could benefit from being commuted.
6 declare <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32>, <16 x i32>, <16 x i32>, i32)
8 define <16 x i32> @vpternlog_v16i32_012(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2) {
9 ; CHECK-LABEL: vpternlog_v16i32_012:
11 ; CHECK-NEXT: vpternlogd $114, %zmm2, %zmm1, %zmm0
13 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
17 define <16 x i32> @vpternlog_v16i32_102(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2) {
18 ; CHECK-LABEL: vpternlog_v16i32_102:
20 ; CHECK-NEXT: vpternlogd $78, %zmm2, %zmm1, %zmm0
22 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
26 define <16 x i32> @vpternlog_v16i32_210(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2) {
27 ; CHECK-LABEL: vpternlog_v16i32_210:
29 ; CHECK-NEXT: vpternlogd $92, %zmm1, %zmm2, %zmm0
31 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
35 define <16 x i32> @vpternlog_v16i32_012_load0(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2) {
36 ; CHECK-LABEL: vpternlog_v16i32_012_load0:
38 ; CHECK-NEXT: vpternlogd $46, (%rdi), %zmm1, %zmm0
40 %x0 = load <16 x i32>, ptr %x0ptr
41 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
45 define <16 x i32> @vpternlog_v16i32_012_load1(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2) {
46 ; CHECK-LABEL: vpternlog_v16i32_012_load1:
48 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0
50 %x1 = load <16 x i32>, ptr %x1ptr
51 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
55 define <16 x i32> @vpternlog_v16i32_012_load2(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr) {
56 ; CHECK-LABEL: vpternlog_v16i32_012_load2:
58 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0
60 %x2 = load <16 x i32>, ptr %x2ptr
61 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
65 define <16 x i32> @vpternlog_v16i32_102_load0(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2) {
66 ; CHECK-LABEL: vpternlog_v16i32_102_load0:
68 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0
70 %x0 = load <16 x i32>, ptr %x0ptr
71 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
75 define <16 x i32> @vpternlog_v16i32_102_load1(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2) {
76 ; CHECK-LABEL: vpternlog_v16i32_102_load1:
78 ; CHECK-NEXT: vpternlogd $46, (%rdi), %zmm1, %zmm0
80 %x1 = load <16 x i32>, ptr %x1ptr
81 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
85 define <16 x i32> @vpternlog_v16i32_102_load2(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr) {
86 ; CHECK-LABEL: vpternlog_v16i32_102_load2:
88 ; CHECK-NEXT: vpternlogd $78, (%rdi), %zmm1, %zmm0
90 %x2 = load <16 x i32>, ptr %x2ptr
91 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
95 define <16 x i32> @vpternlog_v16i32_210_load0(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2) {
96 ; CHECK-LABEL: vpternlog_v16i32_210_load0:
98 ; CHECK-NEXT: vpternlogd $78, (%rdi), %zmm1, %zmm0
100 %x0 = load <16 x i32>, ptr %x0ptr
101 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
105 define <16 x i32> @vpternlog_v16i32_210_load1(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2) {
106 ; CHECK-LABEL: vpternlog_v16i32_210_load1:
108 ; CHECK-NEXT: vpternlogd $92, (%rdi), %zmm1, %zmm0
110 %x1 = load <16 x i32>, ptr %x1ptr
111 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
115 define <16 x i32> @vpternlog_v16i32_210_load2(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr) {
116 ; CHECK-LABEL: vpternlog_v16i32_210_load2:
118 ; CHECK-NEXT: vpternlogd $58, (%rdi), %zmm1, %zmm0
120 %x2 = load <16 x i32>, ptr %x2ptr
121 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
125 define <16 x i32> @vpternlog_v16i32_021_load0(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2) {
126 ; CHECK-LABEL: vpternlog_v16i32_021_load0:
128 ; CHECK-NEXT: vpternlogd $58, (%rdi), %zmm1, %zmm0
130 %x0 = load <16 x i32>, ptr %x0ptr
131 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
135 define <16 x i32> @vpternlog_v16i32_021_load1(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2) {
136 ; CHECK-LABEL: vpternlog_v16i32_021_load1:
138 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0
140 %x1 = load <16 x i32>, ptr %x1ptr
141 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
145 define <16 x i32> @vpternlog_v16i32_021_load2(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr) {
146 ; CHECK-LABEL: vpternlog_v16i32_021_load2:
148 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0
150 %x2 = load <16 x i32>, ptr %x2ptr
151 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
155 define <16 x i32> @vpternlog_v16i32_012_mask(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
156 ; CHECK-LABEL: vpternlog_v16i32_012_mask:
158 ; CHECK-NEXT: kmovd %edi, %k1
159 ; CHECK-NEXT: vpternlogd $114, %zmm2, %zmm1, %zmm0 {%k1}
161 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
162 %2 = bitcast i16 %mask to <16 x i1>
163 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
167 define <16 x i32> @vpternlog_v16i32_102_mask(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
168 ; CHECK-LABEL: vpternlog_v16i32_102_mask:
170 ; CHECK-NEXT: kmovd %edi, %k1
171 ; CHECK-NEXT: vpternlogd $114, %zmm2, %zmm0, %zmm1 {%k1}
172 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
174 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
175 %2 = bitcast i16 %mask to <16 x i1>
176 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
180 define <16 x i32> @vpternlog_v16i32_210_mask(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
181 ; CHECK-LABEL: vpternlog_v16i32_210_mask:
183 ; CHECK-NEXT: kmovd %edi, %k1
184 ; CHECK-NEXT: vpternlogd $114, %zmm0, %zmm1, %zmm2 {%k1}
185 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
187 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
188 %2 = bitcast i16 %mask to <16 x i1>
189 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
193 define <16 x i32> @vpternlog_v16i32_012_mask1(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
194 ; CHECK-LABEL: vpternlog_v16i32_012_mask1:
196 ; CHECK-NEXT: kmovd %edi, %k1
197 ; CHECK-NEXT: vpternlogd $78, %zmm2, %zmm0, %zmm1 {%k1}
198 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
200 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
201 %mask.cast = bitcast i16 %mask to <16 x i1>
202 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x1
206 define <16 x i32> @vpternlog_v16i32_012_mask2(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
207 ; CHECK-LABEL: vpternlog_v16i32_012_mask2:
209 ; CHECK-NEXT: kmovd %edi, %k1
210 ; CHECK-NEXT: vpternlogd $58, %zmm0, %zmm1, %zmm2 {%k1}
211 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
213 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
214 %mask.cast = bitcast i16 %mask to <16 x i1>
215 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x2
219 define <16 x i32> @vpternlog_v16i32_012_load0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
220 ; CHECK-LABEL: vpternlog_v16i32_012_load0_mask:
222 ; CHECK-NEXT: vmovdqa64 (%rdi), %zmm2
223 ; CHECK-NEXT: kmovd %esi, %k1
224 ; CHECK-NEXT: vpternlogd $114, %zmm1, %zmm0, %zmm2 {%k1}
225 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
227 %x0 = load <16 x i32>, ptr %x0ptr
228 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
229 %2 = bitcast i16 %mask to <16 x i1>
230 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
234 define <16 x i32> @vpternlog_v16i32_012_load0_mask1(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
235 ; CHECK-LABEL: vpternlog_v16i32_012_load0_mask1:
237 ; CHECK-NEXT: kmovd %esi, %k1
238 ; CHECK-NEXT: vpternlogd $65, (%rdi), %zmm1, %zmm0 {%k1}
240 %x0 = load <16 x i32>, ptr %x0ptr
241 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 33)
242 %mask.cast = bitcast i16 %mask to <16 x i1>
243 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x1
247 define <16 x i32> @vpternlog_v16i32_012_load0_mask2(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
248 ; CHECK-LABEL: vpternlog_v16i32_012_load0_mask2:
250 ; CHECK-NEXT: kmovd %esi, %k1
251 ; CHECK-NEXT: vpternlogd $33, (%rdi), %zmm0, %zmm1 {%k1}
252 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
254 %x0 = load <16 x i32>, ptr %x0ptr
255 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 33)
256 %mask.cast = bitcast i16 %mask to <16 x i1>
257 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x2
261 define <16 x i32> @vpternlog_v16i32_012_load1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
262 ; CHECK-LABEL: vpternlog_v16i32_012_load1_mask:
264 ; CHECK-NEXT: kmovd %esi, %k1
265 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1}
267 %x1 = load <16 x i32>, ptr %x1ptr
268 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
269 %2 = bitcast i16 %mask to <16 x i1>
270 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
274 define <16 x i32> @vpternlog_v16i32_012_load1_mask2(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
275 ; CHECK-LABEL: vpternlog_v16i32_012_load1_mask2:
277 ; CHECK-NEXT: kmovd %esi, %k1
278 ; CHECK-NEXT: vpternlogd $9, (%rdi), %zmm0, %zmm1 {%k1}
279 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
281 %x1 = load <16 x i32>, ptr %x1ptr
282 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 33)
283 %mask.cast = bitcast i16 %mask to <16 x i1>
284 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x2
288 define <16 x i32> @vpternlog_v16i32_012_load2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
289 ; CHECK-LABEL: vpternlog_v16i32_012_load2_mask:
291 ; CHECK-NEXT: kmovd %esi, %k1
292 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0 {%k1}
294 %x2 = load <16 x i32>, ptr %x2ptr
295 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
296 %2 = bitcast i16 %mask to <16 x i1>
297 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
301 define <16 x i32> @vpternlog_v16i32_012_load2_mask1(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
302 ; CHECK-LABEL: vpternlog_v16i32_012_load2_mask1:
304 ; CHECK-NEXT: kmovd %esi, %k1
305 ; CHECK-NEXT: vpternlogd $9, (%rdi), %zmm0, %zmm1 {%k1}
306 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
308 %x2 = load <16 x i32>, ptr %x2ptr
309 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 33)
310 %mask.cast = bitcast i16 %mask to <16 x i1>
311 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x1
315 define <16 x i32> @vpternlog_v16i32_102_load0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
316 ; CHECK-LABEL: vpternlog_v16i32_102_load0_mask:
318 ; CHECK-NEXT: kmovd %esi, %k1
319 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1}
321 %x0 = load <16 x i32>, ptr %x0ptr
322 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
323 %2 = bitcast i16 %mask to <16 x i1>
324 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
328 define <16 x i32> @vpternlog_v16i32_102_load1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
329 ; CHECK-LABEL: vpternlog_v16i32_102_load1_mask:
331 ; CHECK-NEXT: vmovdqa64 (%rdi), %zmm2
332 ; CHECK-NEXT: kmovd %esi, %k1
333 ; CHECK-NEXT: vpternlogd $114, %zmm1, %zmm0, %zmm2 {%k1}
334 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
336 %x1 = load <16 x i32>, ptr %x1ptr
337 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
338 %2 = bitcast i16 %mask to <16 x i1>
339 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
343 define <16 x i32> @vpternlog_v16i32_102_load2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
344 ; CHECK-LABEL: vpternlog_v16i32_102_load2_mask:
346 ; CHECK-NEXT: kmovd %esi, %k1
347 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm0, %zmm1 {%k1}
348 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
350 %x2 = load <16 x i32>, ptr %x2ptr
351 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
352 %2 = bitcast i16 %mask to <16 x i1>
353 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
357 define <16 x i32> @vpternlog_v16i32_210_load0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
358 ; CHECK-LABEL: vpternlog_v16i32_210_load0_mask:
360 ; CHECK-NEXT: kmovd %esi, %k1
361 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm0, %zmm1 {%k1}
362 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
364 %x0 = load <16 x i32>, ptr %x0ptr
365 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
366 %2 = bitcast i16 %mask to <16 x i1>
367 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
371 define <16 x i32> @vpternlog_v16i32_210_load1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
372 ; CHECK-LABEL: vpternlog_v16i32_210_load1_mask:
374 ; CHECK-NEXT: kmovd %esi, %k1
375 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm0, %zmm1 {%k1}
376 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
378 %x1 = load <16 x i32>, ptr %x1ptr
379 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
380 %2 = bitcast i16 %mask to <16 x i1>
381 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
385 define <16 x i32> @vpternlog_v16i32_210_load2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
386 ; CHECK-LABEL: vpternlog_v16i32_210_load2_mask:
388 ; CHECK-NEXT: vmovdqa64 (%rdi), %zmm2
389 ; CHECK-NEXT: kmovd %esi, %k1
390 ; CHECK-NEXT: vpternlogd $114, %zmm0, %zmm1, %zmm2 {%k1}
391 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
393 %x2 = load <16 x i32>, ptr %x2ptr
394 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
395 %2 = bitcast i16 %mask to <16 x i1>
396 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
400 define <16 x i32> @vpternlog_v16i32_021_load0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
401 ; CHECK-LABEL: vpternlog_v16i32_021_load0_mask:
403 ; CHECK-NEXT: vmovdqa64 (%rdi), %zmm2
404 ; CHECK-NEXT: kmovd %esi, %k1
405 ; CHECK-NEXT: vpternlogd $114, %zmm0, %zmm1, %zmm2 {%k1}
406 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
408 %x0 = load <16 x i32>, ptr %x0ptr
409 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
410 %2 = bitcast i16 %mask to <16 x i1>
411 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
415 define <16 x i32> @vpternlog_v16i32_021_load1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
416 ; CHECK-LABEL: vpternlog_v16i32_021_load1_mask:
418 ; CHECK-NEXT: kmovd %esi, %k1
419 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0 {%k1}
421 %x1 = load <16 x i32>, ptr %x1ptr
422 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
423 %2 = bitcast i16 %mask to <16 x i1>
424 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
428 define <16 x i32> @vpternlog_v16i32_021_load2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
429 ; CHECK-LABEL: vpternlog_v16i32_021_load2_mask:
431 ; CHECK-NEXT: kmovd %esi, %k1
432 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1}
434 %x2 = load <16 x i32>, ptr %x2ptr
435 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
436 %2 = bitcast i16 %mask to <16 x i1>
437 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
441 define <16 x i32> @vpternlog_v16i32_012_maskz(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
442 ; CHECK-LABEL: vpternlog_v16i32_012_maskz:
444 ; CHECK-NEXT: kmovd %edi, %k1
445 ; CHECK-NEXT: vpternlogd $114, %zmm2, %zmm1, %zmm0 {%k1} {z}
447 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
448 %2 = bitcast i16 %mask to <16 x i1>
449 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
453 define <16 x i32> @vpternlog_v16i32_102_maskz(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
454 ; CHECK-LABEL: vpternlog_v16i32_102_maskz:
456 ; CHECK-NEXT: kmovd %edi, %k1
457 ; CHECK-NEXT: vpternlogd $78, %zmm2, %zmm1, %zmm0 {%k1} {z}
459 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
460 %2 = bitcast i16 %mask to <16 x i1>
461 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
465 define <16 x i32> @vpternlog_v16i32_210_maskz(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
466 ; CHECK-LABEL: vpternlog_v16i32_210_maskz:
468 ; CHECK-NEXT: kmovd %edi, %k1
469 ; CHECK-NEXT: vpternlogd $92, %zmm1, %zmm2, %zmm0 {%k1} {z}
471 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
472 %2 = bitcast i16 %mask to <16 x i1>
473 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
477 define <16 x i32> @vpternlog_v16i32_012_load0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
478 ; CHECK-LABEL: vpternlog_v16i32_012_load0_maskz:
480 ; CHECK-NEXT: kmovd %esi, %k1
481 ; CHECK-NEXT: vpternlogd $46, (%rdi), %zmm1, %zmm0 {%k1} {z}
483 %x0 = load <16 x i32>, ptr %x0ptr
484 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
485 %2 = bitcast i16 %mask to <16 x i1>
486 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
490 define <16 x i32> @vpternlog_v16i32_012_load1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
491 ; CHECK-LABEL: vpternlog_v16i32_012_load1_maskz:
493 ; CHECK-NEXT: kmovd %esi, %k1
494 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1} {z}
496 %x1 = load <16 x i32>, ptr %x1ptr
497 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
498 %2 = bitcast i16 %mask to <16 x i1>
499 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
503 define <16 x i32> @vpternlog_v16i32_012_load2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
504 ; CHECK-LABEL: vpternlog_v16i32_012_load2_maskz:
506 ; CHECK-NEXT: kmovd %esi, %k1
507 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0 {%k1} {z}
509 %x2 = load <16 x i32>, ptr %x2ptr
510 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
511 %2 = bitcast i16 %mask to <16 x i1>
512 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
516 define <16 x i32> @vpternlog_v16i32_102_load0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
517 ; CHECK-LABEL: vpternlog_v16i32_102_load0_maskz:
519 ; CHECK-NEXT: kmovd %esi, %k1
520 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1} {z}
522 %x0 = load <16 x i32>, ptr %x0ptr
523 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
524 %2 = bitcast i16 %mask to <16 x i1>
525 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
529 define <16 x i32> @vpternlog_v16i32_102_load1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
530 ; CHECK-LABEL: vpternlog_v16i32_102_load1_maskz:
532 ; CHECK-NEXT: kmovd %esi, %k1
533 ; CHECK-NEXT: vpternlogd $46, (%rdi), %zmm1, %zmm0 {%k1} {z}
535 %x1 = load <16 x i32>, ptr %x1ptr
536 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
537 %2 = bitcast i16 %mask to <16 x i1>
538 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
542 define <16 x i32> @vpternlog_v16i32_102_load2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
543 ; CHECK-LABEL: vpternlog_v16i32_102_load2_maskz:
545 ; CHECK-NEXT: kmovd %esi, %k1
546 ; CHECK-NEXT: vpternlogd $78, (%rdi), %zmm1, %zmm0 {%k1} {z}
548 %x2 = load <16 x i32>, ptr %x2ptr
549 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
550 %2 = bitcast i16 %mask to <16 x i1>
551 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
555 define <16 x i32> @vpternlog_v16i32_210_load0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
556 ; CHECK-LABEL: vpternlog_v16i32_210_load0_maskz:
558 ; CHECK-NEXT: kmovd %esi, %k1
559 ; CHECK-NEXT: vpternlogd $78, (%rdi), %zmm1, %zmm0 {%k1} {z}
561 %x0 = load <16 x i32>, ptr %x0ptr
562 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
563 %2 = bitcast i16 %mask to <16 x i1>
564 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
568 define <16 x i32> @vpternlog_v16i32_210_load1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
569 ; CHECK-LABEL: vpternlog_v16i32_210_load1_maskz:
571 ; CHECK-NEXT: kmovd %esi, %k1
572 ; CHECK-NEXT: vpternlogd $92, (%rdi), %zmm1, %zmm0 {%k1} {z}
574 %x1 = load <16 x i32>, ptr %x1ptr
575 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
576 %2 = bitcast i16 %mask to <16 x i1>
577 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
581 define <16 x i32> @vpternlog_v16i32_210_load2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
582 ; CHECK-LABEL: vpternlog_v16i32_210_load2_maskz:
584 ; CHECK-NEXT: kmovd %esi, %k1
585 ; CHECK-NEXT: vpternlogd $58, (%rdi), %zmm1, %zmm0 {%k1} {z}
587 %x2 = load <16 x i32>, ptr %x2ptr
588 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
589 %2 = bitcast i16 %mask to <16 x i1>
590 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
594 define <16 x i32> @vpternlog_v16i32_021_load0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
595 ; CHECK-LABEL: vpternlog_v16i32_021_load0_maskz:
597 ; CHECK-NEXT: kmovd %esi, %k1
598 ; CHECK-NEXT: vpternlogd $58, (%rdi), %zmm1, %zmm0 {%k1} {z}
600 %x0 = load <16 x i32>, ptr %x0ptr
601 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
602 %2 = bitcast i16 %mask to <16 x i1>
603 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
607 define <16 x i32> @vpternlog_v16i32_021_load1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
608 ; CHECK-LABEL: vpternlog_v16i32_021_load1_maskz:
610 ; CHECK-NEXT: kmovd %esi, %k1
611 ; CHECK-NEXT: vpternlogd $114, (%rdi), %zmm1, %zmm0 {%k1} {z}
613 %x1 = load <16 x i32>, ptr %x1ptr
614 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
615 %2 = bitcast i16 %mask to <16 x i1>
616 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
620 define <16 x i32> @vpternlog_v16i32_021_load2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
621 ; CHECK-LABEL: vpternlog_v16i32_021_load2_maskz:
623 ; CHECK-NEXT: kmovd %esi, %k1
624 ; CHECK-NEXT: vpternlogd $116, (%rdi), %zmm1, %zmm0 {%k1} {z}
626 %x2 = load <16 x i32>, ptr %x2ptr
627 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
628 %2 = bitcast i16 %mask to <16 x i1>
629 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
633 define <16 x i32> @vpternlog_v16i32_012_broadcast0(ptr %ptr_x0, <16 x i32> %x1, <16 x i32> %x2) {
634 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast0:
636 ; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm1, %zmm0
638 %x0_scalar = load i32, ptr %ptr_x0
639 %vecinit.i = insertelement <16 x i32> undef, i32 %x0_scalar, i32 0
640 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
641 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
645 define <16 x i32> @vpternlog_v16i32_012_broadcast1(<16 x i32> %x0, ptr %ptr_x1, <16 x i32> %x2) {
646 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast1:
648 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0
650 %x1_scalar = load i32, ptr %ptr_x1
651 %vecinit.i = insertelement <16 x i32> undef, i32 %x1_scalar, i32 0
652 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
653 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
657 define <16 x i32> @vpternlog_v16i32_012_broadcast2(<16 x i32> %x0, <16 x i32> %x1, ptr %ptr_x2) {
658 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast2:
660 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm1, %zmm0
662 %x2_scalar = load i32, ptr %ptr_x2
663 %vecinit.i = insertelement <16 x i32> undef, i32 %x2_scalar, i32 0
664 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
665 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
669 define <16 x i32> @vpternlog_v16i32_102_broadcast0(ptr %ptr_x0, <16 x i32> %x1, <16 x i32> %x2) {
670 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast0:
672 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0
674 %x0_scalar = load i32, ptr %ptr_x0
675 %vecinit.i = insertelement <16 x i32> undef, i32 %x0_scalar, i32 0
676 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
677 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
681 define <16 x i32> @vpternlog_v16i32_102_broadcast1(<16 x i32> %x0, ptr %ptr_x1, <16 x i32> %x2) {
682 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast1:
684 ; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm1, %zmm0
686 %x1_scalar = load i32, ptr %ptr_x1
687 %vecinit.i = insertelement <16 x i32> undef, i32 %x1_scalar, i32 0
688 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
689 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
693 define <16 x i32> @vpternlog_v16i32_102_broadcast2(<16 x i32> %x0, <16 x i32> %x1, ptr %ptr_x2) {
694 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast2:
696 ; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm1, %zmm0
698 %x2_scalar = load i32, ptr %ptr_x2
699 %vecinit.i = insertelement <16 x i32> undef, i32 %x2_scalar, i32 0
700 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
701 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
705 define <16 x i32> @vpternlog_v16i32_210_broadcast0(ptr %ptr_x0, <16 x i32> %x1, <16 x i32> %x2) {
706 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast0:
708 ; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm1, %zmm0
710 %x0_scalar = load i32, ptr %ptr_x0
711 %vecinit.i = insertelement <16 x i32> undef, i32 %x0_scalar, i32 0
712 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
713 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
717 define <16 x i32> @vpternlog_v16i32_210_broadcast1(<16 x i32> %x0, ptr %ptr_x1, <16 x i32> %x2) {
718 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast1:
720 ; CHECK-NEXT: vpternlogd $92, (%rdi){1to16}, %zmm1, %zmm0
722 %x1_scalar = load i32, ptr %ptr_x1
723 %vecinit.i = insertelement <16 x i32> undef, i32 %x1_scalar, i32 0
724 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
725 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
729 define <16 x i32> @vpternlog_v16i32_210_broadcast2(<16 x i32> %x0, <16 x i32> %x1, ptr %ptr_x2) {
730 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast2:
732 ; CHECK-NEXT: vpternlogd $58, (%rdi){1to16}, %zmm1, %zmm0
734 %x2_scalar = load i32, ptr %ptr_x2
735 %vecinit.i = insertelement <16 x i32> undef, i32 %x2_scalar, i32 0
736 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
737 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
741 define <16 x i32> @vpternlog_v16i32_012_broadcast0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
742 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_mask:
744 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm2
745 ; CHECK-NEXT: kmovd %esi, %k1
746 ; CHECK-NEXT: vpternlogd $114, %zmm1, %zmm0, %zmm2 {%k1}
747 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
749 %x0scalar = load i32, ptr %x0ptr
750 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
751 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
752 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
753 %2 = bitcast i16 %mask to <16 x i1>
754 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
758 define <16 x i32> @vpternlog_v16i32_012_broadcast1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
759 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast1_mask:
761 ; CHECK-NEXT: kmovd %esi, %k1
762 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
764 %x1scalar = load i32, ptr %x1ptr
765 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
766 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
767 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
768 %2 = bitcast i16 %mask to <16 x i1>
769 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
773 define <16 x i32> @vpternlog_v16i32_012_broadcast2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
774 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast2_mask:
776 ; CHECK-NEXT: kmovd %esi, %k1
777 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
779 %x2scalar = load i32, ptr %x2ptr
780 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
781 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
782 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
783 %2 = bitcast i16 %mask to <16 x i1>
784 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
788 define <16 x i32> @vpternlog_v16i32_102_broadcast0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
789 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast0_mask:
791 ; CHECK-NEXT: kmovd %esi, %k1
792 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
794 %x0scalar = load i32, ptr %x0ptr
795 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
796 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
797 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
798 %2 = bitcast i16 %mask to <16 x i1>
799 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
803 define <16 x i32> @vpternlog_v16i32_102_broadcast1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
804 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast1_mask:
806 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm2
807 ; CHECK-NEXT: kmovd %esi, %k1
808 ; CHECK-NEXT: vpternlogd $114, %zmm1, %zmm0, %zmm2 {%k1}
809 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
811 %x1scalar = load i32, ptr %x1ptr
812 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
813 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
814 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
815 %2 = bitcast i16 %mask to <16 x i1>
816 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
820 define <16 x i32> @vpternlog_v16i32_102_broadcast2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
821 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast2_mask:
823 ; CHECK-NEXT: kmovd %esi, %k1
824 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
825 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
827 %x2scalar = load i32, ptr %x2ptr
828 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
829 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
830 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
831 %2 = bitcast i16 %mask to <16 x i1>
832 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x1
836 define <16 x i32> @vpternlog_v16i32_210_broadcast0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
837 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast0_mask:
839 ; CHECK-NEXT: kmovd %esi, %k1
840 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
841 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
843 %x0scalar = load i32, ptr %x0ptr
844 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
845 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
846 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
847 %2 = bitcast i16 %mask to <16 x i1>
848 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
852 define <16 x i32> @vpternlog_v16i32_210_broadcast1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
853 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast1_mask:
855 ; CHECK-NEXT: kmovd %esi, %k1
856 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
857 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
859 %x1scalar = load i32, ptr %x1ptr
860 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
861 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
862 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
863 %2 = bitcast i16 %mask to <16 x i1>
864 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
868 define <16 x i32> @vpternlog_v16i32_210_broadcast2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
869 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast2_mask:
871 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm2
872 ; CHECK-NEXT: kmovd %esi, %k1
873 ; CHECK-NEXT: vpternlogd $114, %zmm0, %zmm1, %zmm2 {%k1}
874 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
876 %x2scalar = load i32, ptr %x2ptr
877 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
878 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
879 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
880 %2 = bitcast i16 %mask to <16 x i1>
881 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x2
885 define <16 x i32> @vpternlog_v16i32_021_broadcast0_mask(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
886 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast0_mask:
888 ; CHECK-NEXT: vpbroadcastd (%rdi), %zmm2
889 ; CHECK-NEXT: kmovd %esi, %k1
890 ; CHECK-NEXT: vpternlogd $114, %zmm0, %zmm1, %zmm2 {%k1}
891 ; CHECK-NEXT: vmovdqa64 %zmm2, %zmm0
893 %x0scalar = load i32, ptr %x0ptr
894 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
895 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
896 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
897 %2 = bitcast i16 %mask to <16 x i1>
898 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
902 define <16 x i32> @vpternlog_v16i32_021_broadcast1_mask(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
903 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast1_mask:
905 ; CHECK-NEXT: kmovd %esi, %k1
906 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
908 %x1scalar = load i32, ptr %x1ptr
909 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
910 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
911 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
912 %2 = bitcast i16 %mask to <16 x i1>
913 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
917 define <16 x i32> @vpternlog_v16i32_021_broadcast2_mask(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
918 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast2_mask:
920 ; CHECK-NEXT: kmovd %esi, %k1
921 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
923 %x2scalar = load i32, ptr %x2ptr
924 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
925 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
926 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
927 %2 = bitcast i16 %mask to <16 x i1>
928 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> %x0
932 define <16 x i32> @vpternlog_v16i32_012_broadcast0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
933 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_maskz:
935 ; CHECK-NEXT: kmovd %esi, %k1
936 ; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
938 %x0scalar = load i32, ptr %x0ptr
939 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
940 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
941 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
942 %2 = bitcast i16 %mask to <16 x i1>
943 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
947 define <16 x i32> @vpternlog_v16i32_012_broadcast1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
948 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast1_maskz:
950 ; CHECK-NEXT: kmovd %esi, %k1
951 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
953 %x1scalar = load i32, ptr %x1ptr
954 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
955 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
956 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
957 %2 = bitcast i16 %mask to <16 x i1>
958 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
962 define <16 x i32> @vpternlog_v16i32_012_broadcast2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
963 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast2_maskz:
965 ; CHECK-NEXT: kmovd %esi, %k1
966 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
968 %x2scalar = load i32, ptr %x2ptr
969 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
970 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
971 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
972 %2 = bitcast i16 %mask to <16 x i1>
973 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
977 define <16 x i32> @vpternlog_v16i32_102_broadcast0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
978 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast0_maskz:
980 ; CHECK-NEXT: kmovd %esi, %k1
981 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
983 %x0scalar = load i32, ptr %x0ptr
984 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
985 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
986 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
987 %2 = bitcast i16 %mask to <16 x i1>
988 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
992 define <16 x i32> @vpternlog_v16i32_102_broadcast1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
993 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast1_maskz:
995 ; CHECK-NEXT: kmovd %esi, %k1
996 ; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
998 %x1scalar = load i32, ptr %x1ptr
999 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
1000 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1001 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
1002 %2 = bitcast i16 %mask to <16 x i1>
1003 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1007 define <16 x i32> @vpternlog_v16i32_102_broadcast2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
1008 ; CHECK-LABEL: vpternlog_v16i32_102_broadcast2_maskz:
1010 ; CHECK-NEXT: kmovd %esi, %k1
1011 ; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1013 %x2scalar = load i32, ptr %x2ptr
1014 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
1015 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1016 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x1, <16 x i32> %x0, <16 x i32> %x2, i32 114)
1017 %2 = bitcast i16 %mask to <16 x i1>
1018 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1022 define <16 x i32> @vpternlog_v16i32_210_broadcast0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
1023 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast0_maskz:
1025 ; CHECK-NEXT: kmovd %esi, %k1
1026 ; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1028 %x0scalar = load i32, ptr %x0ptr
1029 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
1030 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1031 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
1032 %2 = bitcast i16 %mask to <16 x i1>
1033 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1037 define <16 x i32> @vpternlog_v16i32_210_broadcast1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
1038 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast1_maskz:
1040 ; CHECK-NEXT: kmovd %esi, %k1
1041 ; CHECK-NEXT: vpternlogd $92, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1043 %x1scalar = load i32, ptr %x1ptr
1044 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
1045 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1046 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
1047 %2 = bitcast i16 %mask to <16 x i1>
1048 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1052 define <16 x i32> @vpternlog_v16i32_210_broadcast2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
1053 ; CHECK-LABEL: vpternlog_v16i32_210_broadcast2_maskz:
1055 ; CHECK-NEXT: kmovd %esi, %k1
1056 ; CHECK-NEXT: vpternlogd $58, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1058 %x2scalar = load i32, ptr %x2ptr
1059 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
1060 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1061 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x2, <16 x i32> %x1, <16 x i32> %x0, i32 114)
1062 %2 = bitcast i16 %mask to <16 x i1>
1063 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1067 define <16 x i32> @vpternlog_v16i32_021_broadcast0_maskz(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
1068 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast0_maskz:
1070 ; CHECK-NEXT: kmovd %esi, %k1
1071 ; CHECK-NEXT: vpternlogd $58, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1073 %x0scalar = load i32, ptr %x0ptr
1074 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
1075 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1076 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
1077 %2 = bitcast i16 %mask to <16 x i1>
1078 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1082 define <16 x i32> @vpternlog_v16i32_021_broadcast1_maskz(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
1083 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast1_maskz:
1085 ; CHECK-NEXT: kmovd %esi, %k1
1086 ; CHECK-NEXT: vpternlogd $114, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1088 %x1scalar = load i32, ptr %x1ptr
1089 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
1090 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1091 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
1092 %2 = bitcast i16 %mask to <16 x i1>
1093 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1097 define <16 x i32> @vpternlog_v16i32_021_broadcast2_maskz(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
1098 ; CHECK-LABEL: vpternlog_v16i32_021_broadcast2_maskz:
1100 ; CHECK-NEXT: kmovd %esi, %k1
1101 ; CHECK-NEXT: vpternlogd $116, (%rdi){1to16}, %zmm1, %zmm0 {%k1} {z}
1103 %x2scalar = load i32, ptr %x2ptr
1104 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
1105 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1106 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x2, <16 x i32> %x1, i32 114)
1107 %2 = bitcast i16 %mask to <16 x i1>
1108 %3 = select <16 x i1> %2, <16 x i32> %1, <16 x i32> zeroinitializer
1112 define <16 x i32> @vpternlog_v16i32_012_broadcast0_mask1(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
1113 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_mask1:
1115 ; CHECK-NEXT: kmovd %esi, %k1
1116 ; CHECK-NEXT: vpternlogd $92, (%rdi){1to16}, %zmm1, %zmm0 {%k1}
1118 %x0scalar = load i32, ptr %x0ptr
1119 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
1120 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1121 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
1122 %mask.cast = bitcast i16 %mask to <16 x i1>
1123 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x1
1124 ret <16 x i32> %res2
1127 define <16 x i32> @vpternlog_v16i32_012_broadcast0_mask2(ptr %x0ptr, <16 x i32> %x1, <16 x i32> %x2, i16 %mask) {
1128 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast0_mask2:
1130 ; CHECK-NEXT: kmovd %esi, %k1
1131 ; CHECK-NEXT: vpternlogd $58, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
1132 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
1134 %x0scalar = load i32, ptr %x0ptr
1135 %vecinit.i = insertelement <16 x i32> undef, i32 %x0scalar, i32 0
1136 %x0 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1137 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
1138 %mask.cast = bitcast i16 %mask to <16 x i1>
1139 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x2
1140 ret <16 x i32> %res2
1143 define <16 x i32> @vpternlog_v16i32_012_broadcast1_mask2(<16 x i32> %x0, ptr %x1ptr, <16 x i32> %x2, i16 %mask) {
1144 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast1_mask2:
1146 ; CHECK-NEXT: kmovd %esi, %k1
1147 ; CHECK-NEXT: vpternlogd $46, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
1148 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
1150 %x1scalar = load i32, ptr %x1ptr
1151 %vecinit.i = insertelement <16 x i32> undef, i32 %x1scalar, i32 0
1152 %x1 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1153 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
1154 %mask.cast = bitcast i16 %mask to <16 x i1>
1155 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x2
1156 ret <16 x i32> %res2
1159 define <16 x i32> @vpternlog_v16i32_012_broadcast2_mask1(<16 x i32> %x0, <16 x i32> %x1, ptr %x2ptr, i16 %mask) {
1160 ; CHECK-LABEL: vpternlog_v16i32_012_broadcast2_mask1:
1162 ; CHECK-NEXT: kmovd %esi, %k1
1163 ; CHECK-NEXT: vpternlogd $78, (%rdi){1to16}, %zmm0, %zmm1 {%k1}
1164 ; CHECK-NEXT: vmovdqa64 %zmm1, %zmm0
1166 %x2scalar = load i32, ptr %x2ptr
1167 %vecinit.i = insertelement <16 x i32> undef, i32 %x2scalar, i32 0
1168 %x2 = shufflevector <16 x i32> %vecinit.i, <16 x i32> undef, <16 x i32> zeroinitializer
1169 %1 = call <16 x i32> @llvm.x86.avx512.pternlog.d.512(<16 x i32> %x0, <16 x i32> %x1, <16 x i32> %x2, i32 114)
1170 %mask.cast = bitcast i16 %mask to <16 x i1>
1171 %res2 = select <16 x i1> %mask.cast, <16 x i32> %1, <16 x i32> %x1
1172 ret <16 x i32> %res2