1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX1
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX2 --check-prefix=AVX2-SLOW
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2,+fast-variable-shuffle | FileCheck %s --check-prefix=ALL --check-prefix=AVX1OR2 --check-prefix=AVX2 --check-prefix=AVX2-FAST
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefix=ALL --check-prefix=AVX512VL --check-prefix=AVX512VL-SLOW
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,+fast-variable-shuffle | FileCheck %s --check-prefix=ALL --check-prefix=AVX512VL --check-prefix=AVX512VL-FAST
8 define <4 x double> @shuffle_v4f64_0000(<4 x double> %a, <4 x double> %b) {
9 ; AVX1-LABEL: shuffle_v4f64_0000:
11 ; AVX1-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
12 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
15 ; AVX2-LABEL: shuffle_v4f64_0000:
17 ; AVX2-NEXT: vbroadcastsd %xmm0, %ymm0
20 ; AVX512VL-LABEL: shuffle_v4f64_0000:
22 ; AVX512VL-NEXT: vbroadcastsd %xmm0, %ymm0
24 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
25 ret <4 x double> %shuffle
28 define <4 x double> @shuffle_v4f64_0001(<4 x double> %a, <4 x double> %b) {
29 ; AVX1-LABEL: shuffle_v4f64_0001:
31 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = xmm0[0,0]
32 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
35 ; AVX2-LABEL: shuffle_v4f64_0001:
37 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
40 ; AVX512VL-LABEL: shuffle_v4f64_0001:
42 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
44 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
45 ret <4 x double> %shuffle
48 define <4 x double> @shuffle_v4f64_0020(<4 x double> %a, <4 x double> %b) {
49 ; AVX1-LABEL: shuffle_v4f64_0020:
51 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
52 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm0[0]
53 ; AVX1-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
54 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
57 ; AVX2-LABEL: shuffle_v4f64_0020:
59 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
62 ; AVX512VL-LABEL: shuffle_v4f64_0020:
64 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
66 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 0>
67 ret <4 x double> %shuffle
70 define <4 x double> @shuffle_v4f64_0300(<4 x double> %a, <4 x double> %b) {
71 ; AVX1-LABEL: shuffle_v4f64_0300:
73 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
74 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,1,2,2]
75 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
78 ; AVX2-LABEL: shuffle_v4f64_0300:
80 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
83 ; AVX512VL-LABEL: shuffle_v4f64_0300:
85 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
87 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 3, i32 0, i32 0>
88 ret <4 x double> %shuffle
91 define <4 x double> @shuffle_v4f64_1000(<4 x double> %a, <4 x double> %b) {
92 ; AVX1-LABEL: shuffle_v4f64_1000:
94 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
95 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
98 ; AVX2-LABEL: shuffle_v4f64_1000:
100 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
103 ; AVX512VL-LABEL: shuffle_v4f64_1000:
105 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
106 ; AVX512VL-NEXT: retq
107 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
108 ret <4 x double> %shuffle
111 define <4 x double> @shuffle_v4f64_2200(<4 x double> %a, <4 x double> %b) {
112 ; AVX1-LABEL: shuffle_v4f64_2200:
114 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
115 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
118 ; AVX2-LABEL: shuffle_v4f64_2200:
120 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
123 ; AVX512VL-LABEL: shuffle_v4f64_2200:
125 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
126 ; AVX512VL-NEXT: retq
127 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 2, i32 2, i32 0, i32 0>
128 ret <4 x double> %shuffle
131 define <4 x double> @shuffle_v4f64_2222(<4 x double> %a, <4 x double> %b) {
132 ; AVX1-LABEL: shuffle_v4f64_2222:
134 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
135 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
138 ; AVX2-LABEL: shuffle_v4f64_2222:
140 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,2]
143 ; AVX512VL-LABEL: shuffle_v4f64_2222:
145 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,2]
146 ; AVX512VL-NEXT: retq
147 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
148 ret <4 x double> %shuffle
151 define <4 x double> @shuffle_v4f64_2222_bc(<4 x i64> %a, <4 x i64> %b) {
152 ; AVX1-LABEL: shuffle_v4f64_2222_bc:
154 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
155 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
158 ; AVX2-LABEL: shuffle_v4f64_2222_bc:
160 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,2]
163 ; AVX512VL-LABEL: shuffle_v4f64_2222_bc:
165 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,2]
166 ; AVX512VL-NEXT: retq
167 %tmp0 = bitcast <4 x i64> %a to <4 x double>
168 %tmp1 = bitcast <4 x i64> %b to <4 x double>
169 %shuffle = shufflevector <4 x double> %tmp0, <4 x double> %tmp1, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
170 ret <4 x double> %shuffle
173 define <4 x double> @shuffle_v4f64_2233(<4 x double> %a, <4 x double> %b) {
174 ; AVX1-LABEL: shuffle_v4f64_2233:
176 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
177 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,3,3]
180 ; AVX2-LABEL: shuffle_v4f64_2233:
182 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,3,3]
185 ; AVX512VL-LABEL: shuffle_v4f64_2233:
187 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,3,3]
188 ; AVX512VL-NEXT: retq
189 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 2, i32 2, i32 3, i32 3>
190 ret <4 x double> %shuffle
193 define <4 x double> @shuffle_v4f64_3330(<4 x double> %a, <4 x double> %b) {
194 ; AVX1-LABEL: shuffle_v4f64_3330:
196 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
197 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
198 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,2]
201 ; AVX2-LABEL: shuffle_v4f64_3330:
203 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
206 ; AVX512VL-LABEL: shuffle_v4f64_3330:
208 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
209 ; AVX512VL-NEXT: retq
210 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 0>
211 ret <4 x double> %shuffle
214 define <4 x double> @shuffle_v4f64_3210(<4 x double> %a, <4 x double> %b) {
215 ; AVX1-LABEL: shuffle_v4f64_3210:
217 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
218 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
221 ; AVX2-LABEL: shuffle_v4f64_3210:
223 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
226 ; AVX512VL-LABEL: shuffle_v4f64_3210:
228 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
229 ; AVX512VL-NEXT: retq
230 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
231 ret <4 x double> %shuffle
234 define <4 x double> @shuffle_v4f64_0023(<4 x double> %a, <4 x double> %b) {
235 ; ALL-LABEL: shuffle_v4f64_0023:
237 ; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
240 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 3>
241 ret <4 x double> %shuffle
244 define <4 x double> @shuffle_v4f64_0022(<4 x double> %a, <4 x double> %b) {
245 ; ALL-LABEL: shuffle_v4f64_0022:
247 ; ALL-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
249 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 2>
250 ret <4 x double> %shuffle
253 define <4 x double> @shuffle_v4f64mem_0022(<4 x double>* %ptr, <4 x double> %b) {
254 ; ALL-LABEL: shuffle_v4f64mem_0022:
256 ; ALL-NEXT: vmovddup {{.*#+}} ymm0 = mem[0,0,2,2]
258 %a = load <4 x double>, <4 x double>* %ptr
259 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 2>
260 ret <4 x double> %shuffle
263 define <4 x double> @shuffle_v4f64_1032(<4 x double> %a, <4 x double> %b) {
264 ; ALL-LABEL: shuffle_v4f64_1032:
266 ; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
268 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
269 ret <4 x double> %shuffle
272 define <4 x double> @shuffle_v4f64_1133(<4 x double> %a, <4 x double> %b) {
273 ; ALL-LABEL: shuffle_v4f64_1133:
275 ; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
277 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 1, i32 3, i32 3>
278 ret <4 x double> %shuffle
281 define <4 x double> @shuffle_v4f64_1023(<4 x double> %a, <4 x double> %b) {
282 ; ALL-LABEL: shuffle_v4f64_1023:
284 ; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
286 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 2, i32 3>
287 ret <4 x double> %shuffle
290 define <4 x double> @shuffle_v4f64_1022(<4 x double> %a, <4 x double> %b) {
291 ; ALL-LABEL: shuffle_v4f64_1022:
293 ; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
295 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 2, i32 2>
296 ret <4 x double> %shuffle
299 define <4 x double> @shuffle_v4f64_0213(<4 x double> %a, <4 x double> %b) {
300 ; AVX1-LABEL: shuffle_v4f64_0213:
302 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
303 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
304 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2],ymm0[3]
307 ; AVX2-LABEL: shuffle_v4f64_0213:
309 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
312 ; AVX512VL-LABEL: shuffle_v4f64_0213:
314 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
315 ; AVX512VL-NEXT: retq
316 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
317 ret <4 x double> %shuffle
320 define <4 x double> @shuffle_v4f64_0423(<4 x double> %a, <4 x double> %b) {
321 ; AVX1OR2-LABEL: shuffle_v4f64_0423:
323 ; AVX1OR2-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
324 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
327 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_0423:
328 ; AVX512VL-SLOW: # %bb.0:
329 ; AVX512VL-SLOW-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
330 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
331 ; AVX512VL-SLOW-NEXT: retq
333 ; AVX512VL-FAST-LABEL: shuffle_v4f64_0423:
334 ; AVX512VL-FAST: # %bb.0:
335 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [0,4,2,3]
336 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
337 ; AVX512VL-FAST-NEXT: retq
338 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 2, i32 3>
339 ret <4 x double> %shuffle
342 define <4 x double> @shuffle_v4f64_0462(<4 x double> %a, <4 x double> %b) {
343 ; AVX1OR2-LABEL: shuffle_v4f64_0462:
345 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5,6,7]
346 ; AVX1OR2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
347 ; AVX1OR2-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm0[0],ymm2[0],ymm0[2],ymm2[2]
350 ; AVX512VL-LABEL: shuffle_v4f64_0462:
352 ; AVX512VL-NEXT: vmovapd {{.*#+}} ymm2 = [0,4,6,2]
353 ; AVX512VL-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
354 ; AVX512VL-NEXT: retq
355 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 6, i32 2>
356 ret <4 x double> %shuffle
359 define <4 x double> @shuffle_v4f64_0426(<4 x double> %a, <4 x double> %b) {
360 ; ALL-LABEL: shuffle_v4f64_0426:
362 ; ALL-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
364 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
365 ret <4 x double> %shuffle
368 define <4 x double> @shuffle_v4f64_1537(<4 x double> %a, <4 x double> %b) {
369 ; ALL-LABEL: shuffle_v4f64_1537:
371 ; ALL-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
373 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 5, i32 3, i32 7>
374 ret <4 x double> %shuffle
377 define <4 x double> @shuffle_v4f64_4062(<4 x double> %a, <4 x double> %b) {
378 ; ALL-LABEL: shuffle_v4f64_4062:
380 ; ALL-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
382 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 4, i32 0, i32 6, i32 2>
383 ret <4 x double> %shuffle
386 define <4 x double> @shuffle_v4f64_5173(<4 x double> %a, <4 x double> %b) {
387 ; ALL-LABEL: shuffle_v4f64_5173:
389 ; ALL-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3]
391 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 5, i32 1, i32 7, i32 3>
392 ret <4 x double> %shuffle
395 define <4 x double> @shuffle_v4f64_5163(<4 x double> %a, <4 x double> %b) {
396 ; ALL-LABEL: shuffle_v4f64_5163:
398 ; ALL-NEXT: vshufpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[2],ymm0[3]
400 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 5, i32 1, i32 6, i32 3>
401 ret <4 x double> %shuffle
404 define <4 x double> @shuffle_v4f64_0527(<4 x double> %a, <4 x double> %b) {
405 ; ALL-LABEL: shuffle_v4f64_0527:
407 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
409 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
410 ret <4 x double> %shuffle
413 define <4 x double> @shuffle_v4f64_4163(<4 x double> %a, <4 x double> %b) {
414 ; ALL-LABEL: shuffle_v4f64_4163:
416 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
418 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
419 ret <4 x double> %shuffle
422 define <4 x double> @shuffle_v4f64_0145(<4 x double> %a, <4 x double> %b) {
423 ; ALL-LABEL: shuffle_v4f64_0145:
425 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
427 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
428 ret <4 x double> %shuffle
431 define <4 x double> @shuffle_v4f64_4501(<4 x double> %a, <4 x double> %b) {
432 ; ALL-LABEL: shuffle_v4f64_4501:
434 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
436 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 4, i32 5, i32 0, i32 1>
437 ret <4 x double> %shuffle
440 define <4 x double> @shuffle_v4f64_0167(<4 x double> %a, <4 x double> %b) {
441 ; ALL-LABEL: shuffle_v4f64_0167:
443 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
445 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
446 ret <4 x double> %shuffle
449 define <4 x double> @shuffle_v4f64_1054(<4 x double> %a, <4 x double> %b) {
450 ; AVX1OR2-LABEL: shuffle_v4f64_1054:
452 ; AVX1OR2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
453 ; AVX1OR2-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
456 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_1054:
457 ; AVX512VL-SLOW: # %bb.0:
458 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
459 ; AVX512VL-SLOW-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
460 ; AVX512VL-SLOW-NEXT: retq
462 ; AVX512VL-FAST-LABEL: shuffle_v4f64_1054:
463 ; AVX512VL-FAST: # %bb.0:
464 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [1,0,5,4]
465 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
466 ; AVX512VL-FAST-NEXT: retq
467 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 5, i32 4>
468 ret <4 x double> %shuffle
471 define <4 x double> @shuffle_v4f64_3254(<4 x double> %a, <4 x double> %b) {
472 ; AVX1OR2-LABEL: shuffle_v4f64_3254:
474 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
475 ; AVX1OR2-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
478 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_3254:
479 ; AVX512VL-SLOW: # %bb.0:
480 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
481 ; AVX512VL-SLOW-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
482 ; AVX512VL-SLOW-NEXT: retq
484 ; AVX512VL-FAST-LABEL: shuffle_v4f64_3254:
485 ; AVX512VL-FAST: # %bb.0:
486 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [3,2,5,4]
487 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
488 ; AVX512VL-FAST-NEXT: retq
489 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 2, i32 5, i32 4>
490 ret <4 x double> %shuffle
493 define <4 x double> @shuffle_v4f64_3276(<4 x double> %a, <4 x double> %b) {
494 ; AVX1OR2-LABEL: shuffle_v4f64_3276:
496 ; AVX1OR2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
497 ; AVX1OR2-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
500 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_3276:
501 ; AVX512VL-SLOW: # %bb.0:
502 ; AVX512VL-SLOW-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
503 ; AVX512VL-SLOW-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
504 ; AVX512VL-SLOW-NEXT: retq
506 ; AVX512VL-FAST-LABEL: shuffle_v4f64_3276:
507 ; AVX512VL-FAST: # %bb.0:
508 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [3,2,7,6]
509 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
510 ; AVX512VL-FAST-NEXT: retq
511 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 2, i32 7, i32 6>
512 ret <4 x double> %shuffle
515 define <4 x double> @shuffle_v4f64_1076(<4 x double> %a, <4 x double> %b) {
516 ; AVX1OR2-LABEL: shuffle_v4f64_1076:
518 ; AVX1OR2-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3]
519 ; AVX1OR2-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
522 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_1076:
523 ; AVX512VL-SLOW: # %bb.0:
524 ; AVX512VL-SLOW-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3]
525 ; AVX512VL-SLOW-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
526 ; AVX512VL-SLOW-NEXT: retq
528 ; AVX512VL-FAST-LABEL: shuffle_v4f64_1076:
529 ; AVX512VL-FAST: # %bb.0:
530 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [1,0,7,6]
531 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
532 ; AVX512VL-FAST-NEXT: retq
533 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 0, i32 7, i32 6>
534 ret <4 x double> %shuffle
537 define <4 x double> @shuffle_v4f64_0415(<4 x double> %a, <4 x double> %b) {
538 ; AVX1-LABEL: shuffle_v4f64_0415:
540 ; AVX1-NEXT: vunpckhpd {{.*#+}} xmm2 = xmm0[1],xmm1[1]
541 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
542 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
545 ; AVX2-LABEL: shuffle_v4f64_0415:
547 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
548 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
549 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
552 ; AVX512VL-LABEL: shuffle_v4f64_0415:
554 ; AVX512VL-NEXT: vmovapd {{.*#+}} ymm2 = [0,4,1,5]
555 ; AVX512VL-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
556 ; AVX512VL-NEXT: retq
557 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 1, i32 5>
558 ret <4 x double> %shuffle
561 define <4 x double> @shuffle_v4f64_u062(<4 x double> %a, <4 x double> %b) {
562 ; ALL-LABEL: shuffle_v4f64_u062:
564 ; ALL-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
566 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 undef, i32 0, i32 6, i32 2>
567 ret <4 x double> %shuffle
570 define <4 x double> @shuffle_v4f64_15uu(<4 x double> %a, <4 x double> %b) {
571 ; ALL-LABEL: shuffle_v4f64_15uu:
573 ; ALL-NEXT: vunpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
575 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 5, i32 undef, i32 undef>
576 ret <4 x double> %shuffle
579 define <4 x double> @shuffle_v4f64_11uu(<4 x double> %a, <4 x double> %b) {
580 ; ALL-LABEL: shuffle_v4f64_11uu:
582 ; ALL-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,1]
584 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 1, i32 undef, i32 undef>
585 ret <4 x double> %shuffle
588 define <4 x double> @shuffle_v4f64_22uu(<4 x double> %a, <4 x double> %b) {
589 ; AVX1-LABEL: shuffle_v4f64_22uu:
591 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
592 ; AVX1-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
595 ; AVX2-LABEL: shuffle_v4f64_22uu:
597 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
600 ; AVX512VL-LABEL: shuffle_v4f64_22uu:
602 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
603 ; AVX512VL-NEXT: retq
604 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 2, i32 2, i32 undef, i32 undef>
605 ret <4 x double> %shuffle
608 define <4 x double> @shuffle_v4f64_3333(<4 x double> %a, <4 x double> %b) {
609 ; AVX1-LABEL: shuffle_v4f64_3333:
611 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
612 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
615 ; AVX2-LABEL: shuffle_v4f64_3333:
617 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,3]
620 ; AVX512VL-LABEL: shuffle_v4f64_3333:
622 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,3]
623 ; AVX512VL-NEXT: retq
624 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
625 ret <4 x double> %shuffle
628 define <4 x double> @shuffle_v4f64_0456(<4 x double> %a, <4 x double> %b) {
629 ; AVX1-LABEL: shuffle_v4f64_0456:
631 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm2
632 ; AVX1-NEXT: vshufpd {{.*#+}} xmm2 = xmm1[1],xmm2[0]
633 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
634 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm1
635 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
638 ; AVX2-LABEL: shuffle_v4f64_0456:
640 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,2]
641 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
644 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_0456:
645 ; AVX512VL-SLOW: # %bb.0:
646 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,2]
647 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
648 ; AVX512VL-SLOW-NEXT: retq
650 ; AVX512VL-FAST-LABEL: shuffle_v4f64_0456:
651 ; AVX512VL-FAST: # %bb.0:
652 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [4,0,1,2]
653 ; AVX512VL-FAST-NEXT: vpermi2pd %ymm0, %ymm1, %ymm2
654 ; AVX512VL-FAST-NEXT: vmovapd %ymm2, %ymm0
655 ; AVX512VL-FAST-NEXT: retq
656 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
657 ret <4 x double> %shuffle
660 define <4 x double> @shuffle_v4f64_0z3z(<4 x double> %a, <4 x double> %b) {
661 ; ALL-LABEL: shuffle_v4f64_0z3z:
663 ; ALL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
664 ; ALL-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[3],ymm1[2]
666 %shuffle = shufflevector <4 x double> %a, <4 x double> <double 0.000000e+00, double undef, double undef, double undef>, <4 x i32> <i32 0, i32 4, i32 3, i32 4>
667 ret <4 x double> %shuffle
670 define <4 x double> @shuffle_v4f64_1z2z(<4 x double> %a, <4 x double> %b) {
671 ; ALL-LABEL: shuffle_v4f64_1z2z:
673 ; ALL-NEXT: vxorpd %xmm1, %xmm1, %xmm1
674 ; ALL-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],ymm1[0],ymm0[2],ymm1[2]
676 %1 = shufflevector <4 x double> %a, <4 x double> <double 0.000000e+00, double undef, double undef, double undef>, <4 x i32> <i32 1, i32 4, i32 2, i32 4>
680 define <4 x double> @shuffle_v4f64_0044(<4 x double> %a, <4 x double> %b) {
681 ; AVX1-LABEL: shuffle_v4f64_0044:
683 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
684 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
687 ; AVX2-LABEL: shuffle_v4f64_0044:
689 ; AVX2-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
690 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
693 ; AVX512VL-SLOW-LABEL: shuffle_v4f64_0044:
694 ; AVX512VL-SLOW: # %bb.0:
695 ; AVX512VL-SLOW-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
696 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,1]
697 ; AVX512VL-SLOW-NEXT: retq
699 ; AVX512VL-FAST-LABEL: shuffle_v4f64_0044:
700 ; AVX512VL-FAST: # %bb.0:
701 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [0,0,4,4]
702 ; AVX512VL-FAST-NEXT: vpermt2pd %ymm1, %ymm2, %ymm0
703 ; AVX512VL-FAST-NEXT: retq
704 %1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 0, i32 4, i32 4>
708 define <4 x double> @shuffle_v4f64_0044_v2f64(<2 x double> %a, <2 x double> %b) {
709 ; ALL-LABEL: shuffle_v4f64_0044_v2f64:
711 ; ALL-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
712 ; ALL-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
713 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
715 %1 = shufflevector <2 x double> %a, <2 x double> undef, <2 x i32> <i32 0, i32 0>
716 %2 = shufflevector <2 x double> %b, <2 x double> undef, <2 x i32> <i32 0, i32 0>
717 %3 = shufflevector <2 x double> %1, <2 x double> %2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
721 define <4 x double> @shuffle_v4f64_1032_v2f64(<2 x double> %a, <2 x double> %b) {
722 ; ALL-LABEL: shuffle_v4f64_1032_v2f64:
724 ; ALL-NEXT: vpermilpd {{.*#+}} xmm0 = xmm0[1,0]
725 ; ALL-NEXT: vpermilpd {{.*#+}} xmm1 = xmm1[1,0]
726 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
728 %1 = shufflevector <2 x double> %a, <2 x double> undef, <2 x i32> <i32 1, i32 0>
729 %2 = shufflevector <2 x double> %b, <2 x double> undef, <2 x i32> <i32 1, i32 0>
730 %3 = shufflevector <2 x double> %1, <2 x double> %2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
735 define <4 x double> @shuffle_v4f64_2345_0567_select(<4 x double> %vec1, <4 x double> %vec2, <4 x double> %vec3) {
736 ; ALL-LABEL: shuffle_v4f64_2345_0567_select:
738 ; ALL-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
739 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm2[0,1],ymm0[2,3,4,5,6,7]
741 %shuf = shufflevector <4 x double> %vec1, <4 x double> %vec2, <4 x i32> <i32 2, i32 3, i32 4, i32 5>
742 %res = select <4 x i1> <i1 0, i1 1, i1 1, i1 1>, <4 x double> %shuf, <4 x double> %vec3
743 ret <4 x double> %res
746 define <4 x i64> @shuffle_v4i64_0000(<4 x i64> %a, <4 x i64> %b) {
747 ; AVX1-LABEL: shuffle_v4i64_0000:
749 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,0,1]
750 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
753 ; AVX2-LABEL: shuffle_v4i64_0000:
755 ; AVX2-NEXT: vbroadcastsd %xmm0, %ymm0
758 ; AVX512VL-LABEL: shuffle_v4i64_0000:
760 ; AVX512VL-NEXT: vbroadcastsd %xmm0, %ymm0
761 ; AVX512VL-NEXT: retq
762 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
763 ret <4 x i64> %shuffle
766 define <4 x i64> @shuffle_v4i64_0001(<4 x i64> %a, <4 x i64> %b) {
767 ; AVX1-LABEL: shuffle_v4i64_0001:
769 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm0[0,1,0,1]
770 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
773 ; AVX2-LABEL: shuffle_v4i64_0001:
775 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
778 ; AVX512VL-LABEL: shuffle_v4i64_0001:
780 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
781 ; AVX512VL-NEXT: retq
782 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
783 ret <4 x i64> %shuffle
786 define <4 x i64> @shuffle_v4i64_0020(<4 x i64> %a, <4 x i64> %b) {
787 ; AVX1-LABEL: shuffle_v4i64_0020:
789 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
790 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm1 = xmm1[0],xmm0[0]
791 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,0,1]
792 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
795 ; AVX2-LABEL: shuffle_v4i64_0020:
797 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
800 ; AVX512VL-LABEL: shuffle_v4i64_0020:
802 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
803 ; AVX512VL-NEXT: retq
804 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 0>
805 ret <4 x i64> %shuffle
808 define <4 x i64> @shuffle_v4i64_0112(<4 x i64> %a, <4 x i64> %b) {
809 ; AVX1-LABEL: shuffle_v4i64_0112:
811 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
812 ; AVX1-NEXT: vpalignr {{.*#+}} xmm1 = xmm0[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
813 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
816 ; AVX2-LABEL: shuffle_v4i64_0112:
818 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,2]
821 ; AVX512VL-LABEL: shuffle_v4i64_0112:
823 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,2]
824 ; AVX512VL-NEXT: retq
825 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 1, i32 1, i32 2>
826 ret <4 x i64> %shuffle
829 define <4 x i64> @shuffle_v4i64_0300(<4 x i64> %a, <4 x i64> %b) {
830 ; AVX1-LABEL: shuffle_v4i64_0300:
832 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
833 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,1,2,2]
834 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
837 ; AVX2-LABEL: shuffle_v4i64_0300:
839 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
842 ; AVX512VL-LABEL: shuffle_v4i64_0300:
844 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
845 ; AVX512VL-NEXT: retq
846 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 3, i32 0, i32 0>
847 ret <4 x i64> %shuffle
850 define <4 x i64> @shuffle_v4i64_1000(<4 x i64> %a, <4 x i64> %b) {
851 ; AVX1-LABEL: shuffle_v4i64_1000:
853 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
854 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
857 ; AVX2-LABEL: shuffle_v4i64_1000:
859 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
862 ; AVX512VL-LABEL: shuffle_v4i64_1000:
864 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
865 ; AVX512VL-NEXT: retq
866 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
867 ret <4 x i64> %shuffle
870 define <4 x i64> @shuffle_v4i64_2200(<4 x i64> %a, <4 x i64> %b) {
871 ; AVX1-LABEL: shuffle_v4i64_2200:
873 ; AVX1-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
874 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
877 ; AVX2-LABEL: shuffle_v4i64_2200:
879 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
882 ; AVX512VL-LABEL: shuffle_v4i64_2200:
884 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
885 ; AVX512VL-NEXT: retq
886 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 2, i32 2, i32 0, i32 0>
887 ret <4 x i64> %shuffle
890 define <4 x i64> @shuffle_v4i64_3330(<4 x i64> %a, <4 x i64> %b) {
891 ; AVX1-LABEL: shuffle_v4i64_3330:
893 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
894 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
895 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,2]
898 ; AVX2-LABEL: shuffle_v4i64_3330:
900 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
903 ; AVX512VL-LABEL: shuffle_v4i64_3330:
905 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
906 ; AVX512VL-NEXT: retq
907 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 0>
908 ret <4 x i64> %shuffle
911 define <4 x i64> @shuffle_v4i64_3210(<4 x i64> %a, <4 x i64> %b) {
912 ; AVX1-LABEL: shuffle_v4i64_3210:
914 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
915 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
918 ; AVX2-LABEL: shuffle_v4i64_3210:
920 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
923 ; AVX512VL-LABEL: shuffle_v4i64_3210:
925 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
926 ; AVX512VL-NEXT: retq
927 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
928 ret <4 x i64> %shuffle
931 define <4 x i64> @shuffle_v4i64_0213(<4 x i64> %a, <4 x i64> %b) {
932 ; AVX1-LABEL: shuffle_v4i64_0213:
934 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
935 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,3,2]
936 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2],ymm0[3]
939 ; AVX2-LABEL: shuffle_v4i64_0213:
941 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
944 ; AVX512VL-LABEL: shuffle_v4i64_0213:
946 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
947 ; AVX512VL-NEXT: retq
948 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
949 ret <4 x i64> %shuffle
952 define <4 x i64> @shuffle_v4i64_0124(<4 x i64> %a, <4 x i64> %b) {
953 ; AVX1-LABEL: shuffle_v4i64_0124:
955 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,1,0,1]
956 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
957 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
960 ; AVX2-LABEL: shuffle_v4i64_0124:
962 ; AVX2-NEXT: vbroadcastsd %xmm1, %ymm1
963 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
966 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_0124:
967 ; AVX512VL-SLOW: # %bb.0:
968 ; AVX512VL-SLOW-NEXT: vbroadcastsd %xmm1, %ymm1
969 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5],ymm1[6,7]
970 ; AVX512VL-SLOW-NEXT: retq
972 ; AVX512VL-FAST-LABEL: shuffle_v4i64_0124:
973 ; AVX512VL-FAST: # %bb.0:
974 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,1,2,4]
975 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
976 ; AVX512VL-FAST-NEXT: retq
977 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
978 ret <4 x i64> %shuffle
981 define <4 x i64> @shuffle_v4i64_0142(<4 x i64> %a, <4 x i64> %b) {
982 ; AVX1-LABEL: shuffle_v4i64_0142:
984 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
985 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,1,2,2]
986 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2],ymm0[3]
989 ; AVX2-LABEL: shuffle_v4i64_0142:
991 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
992 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,2,2]
993 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
996 ; AVX512VL-LABEL: shuffle_v4i64_0142:
998 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,1,4,2]
999 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1000 ; AVX512VL-NEXT: retq
1001 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 2>
1002 ret <4 x i64> %shuffle
1005 define <4 x i64> @shuffle_v4i64_0412(<4 x i64> %a, <4 x i64> %b) {
1006 ; AVX1-LABEL: shuffle_v4i64_0412:
1008 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,1,0,1]
1009 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1010 ; AVX1-NEXT: vpalignr {{.*#+}} xmm2 = xmm0[8,9,10,11,12,13,14,15],xmm2[0,1,2,3,4,5,6,7]
1011 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1012 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
1015 ; AVX2-LABEL: shuffle_v4i64_0412:
1017 ; AVX2-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
1018 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,2]
1019 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
1022 ; AVX512VL-LABEL: shuffle_v4i64_0412:
1023 ; AVX512VL: # %bb.0:
1024 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,4,1,2]
1025 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1026 ; AVX512VL-NEXT: retq
1027 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 4, i32 1, i32 2>
1028 ret <4 x i64> %shuffle
1031 define <4 x i64> @shuffle_v4i64_4012(<4 x i64> %a, <4 x i64> %b) {
1032 ; AVX1-LABEL: shuffle_v4i64_4012:
1034 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1035 ; AVX1-NEXT: vpalignr {{.*#+}} xmm2 = xmm0[8,9,10,11,12,13,14,15],xmm2[0,1,2,3,4,5,6,7]
1036 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
1037 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1038 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5,6,7]
1041 ; AVX2-LABEL: shuffle_v4i64_4012:
1043 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,2]
1044 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5,6,7]
1047 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_4012:
1048 ; AVX512VL-SLOW: # %bb.0:
1049 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,2]
1050 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5,6,7]
1051 ; AVX512VL-SLOW-NEXT: retq
1053 ; AVX512VL-FAST-LABEL: shuffle_v4i64_4012:
1054 ; AVX512VL-FAST: # %bb.0:
1055 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [4,0,1,2]
1056 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1057 ; AVX512VL-FAST-NEXT: retq
1058 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 4, i32 0, i32 1, i32 2>
1059 ret <4 x i64> %shuffle
1062 define <4 x i64> @shuffle_v4i64_0145(<4 x i64> %a, <4 x i64> %b) {
1063 ; ALL-LABEL: shuffle_v4i64_0145:
1065 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1067 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
1068 ret <4 x i64> %shuffle
1071 define <4 x i64> @shuffle_v4i64_0451(<4 x i64> %a, <4 x i64> %b) {
1072 ; AVX1-LABEL: shuffle_v4i64_0451:
1074 ; AVX1-NEXT: vunpckhpd {{.*#+}} xmm2 = xmm1[1],xmm0[1]
1075 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1076 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1079 ; AVX2-LABEL: shuffle_v4i64_0451:
1081 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,3]
1082 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,2,1]
1083 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5],ymm0[6,7]
1086 ; AVX512VL-LABEL: shuffle_v4i64_0451:
1087 ; AVX512VL: # %bb.0:
1088 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,4,5,1]
1089 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1090 ; AVX512VL-NEXT: retq
1091 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 4, i32 5, i32 1>
1092 ret <4 x i64> %shuffle
1095 define <4 x i64> @shuffle_v4i64_4501(<4 x i64> %a, <4 x i64> %b) {
1096 ; ALL-LABEL: shuffle_v4i64_4501:
1098 ; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1100 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 4, i32 5, i32 0, i32 1>
1101 ret <4 x i64> %shuffle
1104 define <4 x i64> @shuffle_v4i64_4015(<4 x i64> %a, <4 x i64> %b) {
1105 ; AVX1-LABEL: shuffle_v4i64_4015:
1107 ; AVX1-NEXT: vunpckhpd {{.*#+}} xmm2 = xmm0[1],xmm1[1]
1108 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm0 = xmm1[0],xmm0[0]
1109 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1112 ; AVX2-LABEL: shuffle_v4i64_4015:
1114 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,2,1]
1115 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,3]
1116 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5],ymm1[6,7]
1119 ; AVX512VL-LABEL: shuffle_v4i64_4015:
1120 ; AVX512VL: # %bb.0:
1121 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [4,0,1,5]
1122 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1123 ; AVX512VL-NEXT: retq
1124 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 4, i32 0, i32 1, i32 5>
1125 ret <4 x i64> %shuffle
1128 define <4 x i64> @shuffle_v4i64_2u35(<4 x i64> %a, <4 x i64> %b) {
1129 ; AVX1-LABEL: shuffle_v4i64_2u35:
1131 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
1132 ; AVX1-NEXT: vunpckhpd {{.*#+}} xmm1 = xmm0[1],xmm1[1]
1133 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1136 ; AVX2-LABEL: shuffle_v4i64_2u35:
1138 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
1139 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,1]
1142 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_2u35:
1143 ; AVX512VL-SLOW: # %bb.0:
1144 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
1145 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,1]
1146 ; AVX512VL-SLOW-NEXT: retq
1148 ; AVX512VL-FAST-LABEL: shuffle_v4i64_2u35:
1149 ; AVX512VL-FAST: # %bb.0:
1150 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [2,5,3,5]
1151 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1152 ; AVX512VL-FAST-NEXT: retq
1153 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 2, i32 undef, i32 3, i32 5>
1154 ret <4 x i64> %shuffle
1157 define <4 x i64> @shuffle_v4i64_1251(<4 x i64> %a, <4 x i64> %b) {
1158 ; AVX1-LABEL: shuffle_v4i64_1251:
1160 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
1161 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],ymm2[0],ymm0[2],ymm2[3]
1162 ; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[2,3,0,1]
1163 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1
1164 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2],ymm0[3]
1167 ; AVX2-LABEL: shuffle_v4i64_1251:
1169 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,1,3]
1170 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,2,2,1]
1171 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
1174 ; AVX512VL-LABEL: shuffle_v4i64_1251:
1175 ; AVX512VL: # %bb.0:
1176 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [1,2,5,1]
1177 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1178 ; AVX512VL-NEXT: retq
1179 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 2, i32 5, i32 1>
1180 ret <4 x i64> %shuffle
1183 define <4 x i64> @shuffle_v4i64_1054(<4 x i64> %a, <4 x i64> %b) {
1184 ; AVX1-LABEL: shuffle_v4i64_1054:
1186 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1187 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1190 ; AVX2-LABEL: shuffle_v4i64_1054:
1192 ; AVX2-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1193 ; AVX2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1196 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_1054:
1197 ; AVX512VL-SLOW: # %bb.0:
1198 ; AVX512VL-SLOW-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1199 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1200 ; AVX512VL-SLOW-NEXT: retq
1202 ; AVX512VL-FAST-LABEL: shuffle_v4i64_1054:
1203 ; AVX512VL-FAST: # %bb.0:
1204 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [1,0,5,4]
1205 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1206 ; AVX512VL-FAST-NEXT: retq
1207 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 0, i32 5, i32 4>
1208 ret <4 x i64> %shuffle
1211 define <4 x i64> @shuffle_v4i64_3254(<4 x i64> %a, <4 x i64> %b) {
1212 ; AVX1-LABEL: shuffle_v4i64_3254:
1214 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
1215 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1218 ; AVX2-LABEL: shuffle_v4i64_3254:
1220 ; AVX2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
1221 ; AVX2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1224 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_3254:
1225 ; AVX512VL-SLOW: # %bb.0:
1226 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[0,1]
1227 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1228 ; AVX512VL-SLOW-NEXT: retq
1230 ; AVX512VL-FAST-LABEL: shuffle_v4i64_3254:
1231 ; AVX512VL-FAST: # %bb.0:
1232 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,5,4]
1233 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1234 ; AVX512VL-FAST-NEXT: retq
1235 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 3, i32 2, i32 5, i32 4>
1236 ret <4 x i64> %shuffle
1239 define <4 x i64> @shuffle_v4i64_3276(<4 x i64> %a, <4 x i64> %b) {
1240 ; AVX1-LABEL: shuffle_v4i64_3276:
1242 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
1243 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1246 ; AVX2-LABEL: shuffle_v4i64_3276:
1248 ; AVX2-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
1249 ; AVX2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1252 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_3276:
1253 ; AVX512VL-SLOW: # %bb.0:
1254 ; AVX512VL-SLOW-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3],ymm1[2,3]
1255 ; AVX512VL-SLOW-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1256 ; AVX512VL-SLOW-NEXT: retq
1258 ; AVX512VL-FAST-LABEL: shuffle_v4i64_3276:
1259 ; AVX512VL-FAST: # %bb.0:
1260 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [3,2,7,6]
1261 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1262 ; AVX512VL-FAST-NEXT: retq
1263 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 3, i32 2, i32 7, i32 6>
1264 ret <4 x i64> %shuffle
1267 define <4 x i64> @shuffle_v4i64_1076(<4 x i64> %a, <4 x i64> %b) {
1268 ; AVX1-LABEL: shuffle_v4i64_1076:
1270 ; AVX1-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3]
1271 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
1274 ; AVX2-LABEL: shuffle_v4i64_1076:
1276 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
1277 ; AVX2-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1280 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_1076:
1281 ; AVX512VL-SLOW: # %bb.0:
1282 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
1283 ; AVX512VL-SLOW-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1284 ; AVX512VL-SLOW-NEXT: retq
1286 ; AVX512VL-FAST-LABEL: shuffle_v4i64_1076:
1287 ; AVX512VL-FAST: # %bb.0:
1288 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [1,0,7,6]
1289 ; AVX512VL-FAST-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1290 ; AVX512VL-FAST-NEXT: retq
1291 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 0, i32 7, i32 6>
1292 ret <4 x i64> %shuffle
1295 define <4 x i64> @shuffle_v4i64_0415(<4 x i64> %a, <4 x i64> %b) {
1296 ; AVX1-LABEL: shuffle_v4i64_0415:
1298 ; AVX1-NEXT: vunpckhpd {{.*#+}} xmm2 = xmm0[1],xmm1[1]
1299 ; AVX1-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1300 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1303 ; AVX2-LABEL: shuffle_v4i64_0415:
1305 ; AVX2-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
1306 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
1307 ; AVX2-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
1310 ; AVX512VL-LABEL: shuffle_v4i64_0415:
1311 ; AVX512VL: # %bb.0:
1312 ; AVX512VL-NEXT: vmovdqa {{.*#+}} ymm2 = [0,4,1,5]
1313 ; AVX512VL-NEXT: vpermt2q %ymm1, %ymm2, %ymm0
1314 ; AVX512VL-NEXT: retq
1315 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 4, i32 1, i32 5>
1316 ret <4 x i64> %shuffle
1319 define <4 x i64> @shuffle_v4i64_z4z6(<4 x i64> %a) {
1320 ; AVX1-LABEL: shuffle_v4i64_z4z6:
1322 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
1323 ; AVX1-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1326 ; AVX2-LABEL: shuffle_v4i64_z4z6:
1328 ; AVX2-NEXT: vpslldq {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23]
1331 ; AVX512VL-LABEL: shuffle_v4i64_z4z6:
1332 ; AVX512VL: # %bb.0:
1333 ; AVX512VL-NEXT: vpslldq {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23]
1334 ; AVX512VL-NEXT: retq
1335 %shuffle = shufflevector <4 x i64> zeroinitializer, <4 x i64> %a, <4 x i32> <i32 0, i32 4, i32 0, i32 6>
1336 ret <4 x i64> %shuffle
1339 define <4 x i64> @shuffle_v4i64_5zuz(<4 x i64> %a) {
1340 ; AVX1-LABEL: shuffle_v4i64_5zuz:
1342 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
1343 ; AVX1-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1346 ; AVX2-LABEL: shuffle_v4i64_5zuz:
1348 ; AVX2-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero
1351 ; AVX512VL-LABEL: shuffle_v4i64_5zuz:
1352 ; AVX512VL: # %bb.0:
1353 ; AVX512VL-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero
1354 ; AVX512VL-NEXT: retq
1355 %shuffle = shufflevector <4 x i64> zeroinitializer, <4 x i64> %a, <4 x i32> <i32 5, i32 0, i32 undef, i32 0>
1356 ret <4 x i64> %shuffle
1359 define <4 x i64> @shuffle_v4i64_40u2(<4 x i64> %a, <4 x i64> %b) {
1360 ; ALL-LABEL: shuffle_v4i64_40u2:
1362 ; ALL-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1364 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 4, i32 0, i32 undef, i32 2>
1365 ret <4 x i64> %shuffle
1368 define <4 x i64> @shuffle_v4i64_15uu(<4 x i64> %a, <4 x i64> %b) {
1369 ; ALL-LABEL: shuffle_v4i64_15uu:
1371 ; ALL-NEXT: vunpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
1373 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 5, i32 undef, i32 undef>
1374 ret <4 x i64> %shuffle
1377 define <4 x i64> @shuffle_v4i64_11uu(<4 x i64> %a, <4 x i64> %b) {
1378 ; ALL-LABEL: shuffle_v4i64_11uu:
1380 ; ALL-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[2,3,2,3]
1382 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 1, i32 undef, i32 undef>
1383 ret <4 x i64> %shuffle
1386 define <4 x i64> @shuffle_v4i64_22uu(<4 x i64> %a, <4 x i64> %b) {
1387 ; AVX1-LABEL: shuffle_v4i64_22uu:
1389 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
1390 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,0,1]
1393 ; AVX2-LABEL: shuffle_v4i64_22uu:
1395 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
1398 ; AVX512VL-LABEL: shuffle_v4i64_22uu:
1399 ; AVX512VL: # %bb.0:
1400 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
1401 ; AVX512VL-NEXT: retq
1402 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 2, i32 2, i32 undef, i32 undef>
1403 ret <4 x i64> %shuffle
1406 define <4 x i64> @shuffle_v4i64_3333(<4 x i64> %a, <4 x i64> %b) {
1407 ; AVX1-LABEL: shuffle_v4i64_3333:
1409 ; AVX1-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
1410 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm0 = ymm0[2,3,2,3]
1413 ; AVX2-LABEL: shuffle_v4i64_3333:
1415 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,3]
1418 ; AVX512VL-LABEL: shuffle_v4i64_3333:
1419 ; AVX512VL: # %bb.0:
1420 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,3]
1421 ; AVX512VL-NEXT: retq
1422 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
1423 ret <4 x i64> %shuffle
1426 define <4 x i64> @shuffle_v4i64_1z3z(<4 x i64> %a, <4 x i64> %b) {
1427 ; AVX1-LABEL: shuffle_v4i64_1z3z:
1429 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
1430 ; AVX1-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1433 ; AVX2-LABEL: shuffle_v4i64_1z3z:
1435 ; AVX2-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero
1438 ; AVX512VL-LABEL: shuffle_v4i64_1z3z:
1439 ; AVX512VL: # %bb.0:
1440 ; AVX512VL-NEXT: vpsrldq {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31],zero,zero,zero,zero,zero,zero,zero,zero
1441 ; AVX512VL-NEXT: retq
1442 %shuffle = shufflevector <4 x i64> %a, <4 x i64> <i64 0, i64 undef, i64 undef, i64 undef>, <4 x i32> <i32 1, i32 4, i32 3, i32 4>
1443 ret <4 x i64> %shuffle
1446 define <4 x i64> @shuffle_v4i64_1032_v2i64(<2 x i64> %a, <2 x i64> %b) {
1447 ; ALL-LABEL: shuffle_v4i64_1032_v2i64:
1449 ; ALL-NEXT: # kill: def $xmm0 killed $xmm0 def $ymm0
1450 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1451 ; ALL-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
1453 %1 = shufflevector <2 x i64> %a, <2 x i64> undef, <2 x i32> <i32 1, i32 0>
1454 %2 = shufflevector <2 x i64> %b, <2 x i64> undef, <2 x i32> <i32 1, i32 0>
1455 %3 = shufflevector <2 x i64> %1, <2 x i64> %2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1459 define <4 x i64> @stress_test1(<4 x i64> %a, <4 x i64> %b) {
1460 ; ALL-LABEL: stress_test1:
1462 %c = shufflevector <4 x i64> %b, <4 x i64> undef, <4 x i32> <i32 3, i32 1, i32 1, i32 0>
1463 %d = shufflevector <4 x i64> %c, <4 x i64> undef, <4 x i32> <i32 3, i32 undef, i32 2, i32 undef>
1464 %e = shufflevector <4 x i64> %b, <4 x i64> undef, <4 x i32> <i32 3, i32 3, i32 1, i32 undef>
1465 %f = shufflevector <4 x i64> %d, <4 x i64> %e, <4 x i32> <i32 5, i32 1, i32 1, i32 0>
1470 define <4 x i64> @insert_reg_and_zero_v4i64(i64 %a) {
1471 ; ALL-LABEL: insert_reg_and_zero_v4i64:
1473 ; ALL-NEXT: vmovq %rdi, %xmm0
1475 %v = insertelement <4 x i64> undef, i64 %a, i64 0
1476 %shuffle = shufflevector <4 x i64> %v, <4 x i64> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1477 ret <4 x i64> %shuffle
1480 define <4 x i64> @insert_mem_and_zero_v4i64(i64* %ptr) {
1481 ; ALL-LABEL: insert_mem_and_zero_v4i64:
1483 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
1485 %a = load i64, i64* %ptr
1486 %v = insertelement <4 x i64> undef, i64 %a, i64 0
1487 %shuffle = shufflevector <4 x i64> %v, <4 x i64> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1488 ret <4 x i64> %shuffle
1491 define <4 x double> @insert_reg_and_zero_v4f64(double %a) {
1492 ; ALL-LABEL: insert_reg_and_zero_v4f64:
1494 ; ALL-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
1496 %v = insertelement <4 x double> undef, double %a, i32 0
1497 %shuffle = shufflevector <4 x double> %v, <4 x double> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1498 ret <4 x double> %shuffle
1501 define <4 x double> @insert_mem_and_zero_v4f64(double* %ptr) {
1502 ; ALL-LABEL: insert_mem_and_zero_v4f64:
1504 ; ALL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero
1506 %a = load double, double* %ptr
1507 %v = insertelement <4 x double> undef, double %a, i32 0
1508 %shuffle = shufflevector <4 x double> %v, <4 x double> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1509 ret <4 x double> %shuffle
1512 define <4 x double> @splat_mem_v4f64(double* %ptr) {
1513 ; ALL-LABEL: splat_mem_v4f64:
1515 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1517 %a = load double, double* %ptr
1518 %v = insertelement <4 x double> undef, double %a, i32 0
1519 %shuffle = shufflevector <4 x double> %v, <4 x double> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1520 ret <4 x double> %shuffle
1523 define <4 x i64> @splat_mem_v4i64(i64* %ptr) {
1524 ; ALL-LABEL: splat_mem_v4i64:
1526 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1528 %a = load i64, i64* %ptr
1529 %v = insertelement <4 x i64> undef, i64 %a, i64 0
1530 %shuffle = shufflevector <4 x i64> %v, <4 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1531 ret <4 x i64> %shuffle
1534 define <4 x double> @splat_mem_v4f64_2(double* %p) {
1535 ; ALL-LABEL: splat_mem_v4f64_2:
1537 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1539 %1 = load double, double* %p
1540 %2 = insertelement <2 x double> undef, double %1, i32 0
1541 %3 = shufflevector <2 x double> %2, <2 x double> undef, <4 x i32> zeroinitializer
1545 define <4 x double> @splat_v4f64(<2 x double> %r) {
1546 ; AVX1-LABEL: splat_v4f64:
1548 ; AVX1-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
1549 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1552 ; AVX2-LABEL: splat_v4f64:
1554 ; AVX2-NEXT: vbroadcastsd %xmm0, %ymm0
1557 ; AVX512VL-LABEL: splat_v4f64:
1558 ; AVX512VL: # %bb.0:
1559 ; AVX512VL-NEXT: vbroadcastsd %xmm0, %ymm0
1560 ; AVX512VL-NEXT: retq
1561 %1 = shufflevector <2 x double> %r, <2 x double> undef, <4 x i32> zeroinitializer
1565 define <4 x i64> @splat_mem_v4i64_from_v2i64(<2 x i64>* %ptr) {
1566 ; ALL-LABEL: splat_mem_v4i64_from_v2i64:
1568 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1570 %v = load <2 x i64>, <2 x i64>* %ptr
1571 %shuffle = shufflevector <2 x i64> %v, <2 x i64> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1572 ret <4 x i64> %shuffle
1575 define <4 x double> @splat_mem_v4f64_from_v2f64(<2 x double>* %ptr) {
1576 ; ALL-LABEL: splat_mem_v4f64_from_v2f64:
1578 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1580 %v = load <2 x double>, <2 x double>* %ptr
1581 %shuffle = shufflevector <2 x double> %v, <2 x double> undef, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
1582 ret <4 x double> %shuffle
1585 define <4 x i64> @splat128_mem_v4i64_from_v2i64(<2 x i64>* %ptr) {
1586 ; AVX1OR2-LABEL: splat128_mem_v4i64_from_v2i64:
1588 ; AVX1OR2-NEXT: vbroadcastf128 {{.*#+}} ymm0 = mem[0,1,0,1]
1589 ; AVX1OR2-NEXT: retq
1591 ; AVX512VL-LABEL: splat128_mem_v4i64_from_v2i64:
1592 ; AVX512VL: # %bb.0:
1593 ; AVX512VL-NEXT: vbroadcasti128 {{.*#+}} ymm0 = mem[0,1,0,1]
1594 ; AVX512VL-NEXT: retq
1595 %v = load <2 x i64>, <2 x i64>* %ptr
1596 %shuffle = shufflevector <2 x i64> %v, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
1597 ret <4 x i64> %shuffle
1600 define <4 x double> @splat128_mem_v4f64_from_v2f64(<2 x double>* %ptr) {
1601 ; ALL-LABEL: splat128_mem_v4f64_from_v2f64:
1603 ; ALL-NEXT: vbroadcastf128 {{.*#+}} ymm0 = mem[0,1,0,1]
1605 %v = load <2 x double>, <2 x double>* %ptr
1606 %shuffle = shufflevector <2 x double> %v, <2 x double> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
1607 ret <4 x double> %shuffle
1610 define <4 x double> @broadcast_v4f64_0000_from_v2i64(<2 x i64> %a0) {
1611 ; AVX1-LABEL: broadcast_v4f64_0000_from_v2i64:
1613 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,1,0,1]
1614 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
1617 ; AVX2-LABEL: broadcast_v4f64_0000_from_v2i64:
1619 ; AVX2-NEXT: vbroadcastsd %xmm0, %ymm0
1622 ; AVX512VL-LABEL: broadcast_v4f64_0000_from_v2i64:
1623 ; AVX512VL: # %bb.0:
1624 ; AVX512VL-NEXT: vbroadcastsd %xmm0, %ymm0
1625 ; AVX512VL-NEXT: retq
1626 %1 = shufflevector <2 x i64> %a0, <2 x i64> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1627 %2 = bitcast <4 x i64> %1 to <4 x double>
1628 %3 = shufflevector <4 x double> %2, <4 x double> undef, <4 x i32> zeroinitializer
1632 define <4 x double> @bitcast_v4f64_0426(<4 x double> %a, <4 x double> %b) {
1633 ; ALL-LABEL: bitcast_v4f64_0426:
1635 ; ALL-NEXT: vunpcklpd {{.*#+}} ymm0 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
1637 %shuffle64 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 4, i32 0, i32 6, i32 2>
1638 %bitcast32 = bitcast <4 x double> %shuffle64 to <8 x float>
1639 %shuffle32 = shufflevector <8 x float> %bitcast32, <8 x float> undef, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
1640 %bitcast16 = bitcast <8 x float> %shuffle32 to <16 x i16>
1641 %shuffle16 = shufflevector <16 x i16> %bitcast16, <16 x i16> undef, <16 x i32> <i32 2, i32 3, i32 0, i32 1, i32 6, i32 7, i32 4, i32 5, i32 10, i32 11, i32 8, i32 9, i32 14, i32 15, i32 12, i32 13>
1642 %bitcast64 = bitcast <16 x i16> %shuffle16 to <4 x double>
1643 ret <4 x double> %bitcast64
1646 define <4 x i64> @concat_v4i64_0167(<4 x i64> %a0, <4 x i64> %a1) {
1647 ; ALL-LABEL: concat_v4i64_0167:
1649 ; ALL-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5,6,7]
1651 %a0lo = shufflevector <4 x i64> %a0, <4 x i64> %a1, <2 x i32> <i32 0, i32 1>
1652 %a1hi = shufflevector <4 x i64> %a0, <4 x i64> %a1, <2 x i32> <i32 6, i32 7>
1653 %shuffle64 = shufflevector <2 x i64> %a0lo, <2 x i64> %a1hi, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1654 ret <4 x i64> %shuffle64
1657 define <4 x i64> @concat_v4i64_0145_bc(<4 x i64> %a0, <4 x i64> %a1) {
1658 ; ALL-LABEL: concat_v4i64_0145_bc:
1660 ; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1662 %a0lo = shufflevector <4 x i64> %a0, <4 x i64> %a1, <2 x i32> <i32 0, i32 1>
1663 %a1lo = shufflevector <4 x i64> %a0, <4 x i64> %a1, <2 x i32> <i32 4, i32 5>
1664 %bc0lo = bitcast <2 x i64> %a0lo to <4 x i32>
1665 %bc1lo = bitcast <2 x i64> %a1lo to <4 x i32>
1666 %shuffle32 = shufflevector <4 x i32> %bc0lo, <4 x i32> %bc1lo, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1667 %shuffle64 = bitcast <8 x i32> %shuffle32 to <4 x i64>
1668 ret <4 x i64> %shuffle64
1671 define <4 x i64> @insert_dup_mem_v4i64(i64* %ptr) {
1672 ; ALL-LABEL: insert_dup_mem_v4i64:
1674 ; ALL-NEXT: vbroadcastsd (%rdi), %ymm0
1676 %tmp = load i64, i64* %ptr, align 1
1677 %tmp1 = insertelement <2 x i64> undef, i64 %tmp, i32 0
1678 %tmp2 = shufflevector <2 x i64> %tmp1, <2 x i64> undef, <4 x i32> zeroinitializer
1682 define <4 x i64> @shuffle_v4i64_1234(<4 x i64> %a, <4 x i64> %b) {
1683 ; AVX1-LABEL: shuffle_v4i64_1234:
1685 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
1686 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],ymm1[0],ymm0[3],ymm1[2]
1689 ; AVX2-LABEL: shuffle_v4i64_1234:
1691 ; AVX2-NEXT: vperm2i128 {{.*#+}} ymm1 = ymm0[2,3],ymm1[0,1]
1692 ; AVX2-NEXT: vpalignr {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],ymm1[0,1,2,3,4,5,6,7],ymm0[24,25,26,27,28,29,30,31],ymm1[16,17,18,19,20,21,22,23]
1695 ; AVX512VL-LABEL: shuffle_v4i64_1234:
1696 ; AVX512VL: # %bb.0:
1697 ; AVX512VL-NEXT: valignq {{.*#+}} ymm0 = ymm0[1,2,3],ymm1[0]
1698 ; AVX512VL-NEXT: retq
1699 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
1700 ret <4 x i64> %shuffle
1703 define <4 x i64> @shuffle_v4i64_1230(<4 x i64> %a) {
1704 ; AVX1-LABEL: shuffle_v4i64_1230:
1706 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm1 = ymm0[2,3,0,1]
1707 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],ymm1[0],ymm0[3],ymm1[2]
1710 ; AVX2-LABEL: shuffle_v4i64_1230:
1712 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,2,3,0]
1715 ; AVX512VL-LABEL: shuffle_v4i64_1230:
1716 ; AVX512VL: # %bb.0:
1717 ; AVX512VL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,2,3,0]
1718 ; AVX512VL-NEXT: retq
1719 %shuffle = shufflevector <4 x i64> %a, <4 x i64> undef, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
1720 ret <4 x i64> %shuffle
1723 define <4 x i64> @shuffle_v4i64_z0z3(<4 x i64> %a, <4 x i64> %b) {
1724 ; AVX1-LABEL: shuffle_v4i64_z0z3:
1726 ; AVX1-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1727 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm1[0],ymm0[0],ymm1[2],ymm0[3]
1730 ; AVX2-SLOW-LABEL: shuffle_v4i64_z0z3:
1731 ; AVX2-SLOW: # %bb.0:
1732 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
1733 ; AVX2-SLOW-NEXT: vxorps %xmm1, %xmm1, %xmm1
1734 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
1735 ; AVX2-SLOW-NEXT: retq
1737 ; AVX2-FAST-LABEL: shuffle_v4i64_z0z3:
1738 ; AVX2-FAST: # %bb.0:
1739 ; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31]
1740 ; AVX2-FAST-NEXT: retq
1742 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_z0z3:
1743 ; AVX512VL-SLOW: # %bb.0:
1744 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
1745 ; AVX512VL-SLOW-NEXT: vxorps %xmm1, %xmm1, %xmm1
1746 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
1747 ; AVX512VL-SLOW-NEXT: retq
1749 ; AVX512VL-FAST-LABEL: shuffle_v4i64_z0z3:
1750 ; AVX512VL-FAST: # %bb.0:
1751 ; AVX512VL-FAST-NEXT: vpshufb {{.*#+}} ymm0 = zero,zero,zero,zero,zero,zero,zero,zero,ymm0[0,1,2,3,4,5,6,7],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[24,25,26,27,28,29,30,31]
1752 ; AVX512VL-FAST-NEXT: retq
1753 %1 = shufflevector <4 x i64> %a, <4 x i64> <i64 0, i64 undef, i64 undef, i64 undef>, <4 x i32> <i32 4, i32 0, i32 4, i32 3>
1757 define <4 x i64> @shuffle_v4i64_1z2z(<4 x i64> %a, <4 x i64> %b) {
1758 ; AVX1-LABEL: shuffle_v4i64_1z2z:
1760 ; AVX1-NEXT: vxorpd %xmm1, %xmm1, %xmm1
1761 ; AVX1-NEXT: vshufpd {{.*#+}} ymm0 = ymm0[1],ymm1[0],ymm0[2],ymm1[2]
1764 ; AVX2-SLOW-LABEL: shuffle_v4i64_1z2z:
1765 ; AVX2-SLOW: # %bb.0:
1766 ; AVX2-SLOW-NEXT: vxorps %xmm1, %xmm1, %xmm1
1767 ; AVX2-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5,6,7]
1768 ; AVX2-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,2,0]
1769 ; AVX2-SLOW-NEXT: retq
1771 ; AVX2-FAST-LABEL: shuffle_v4i64_1z2z:
1772 ; AVX2-FAST: # %bb.0:
1773 ; AVX2-FAST-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23],zero,zero,zero,zero,zero,zero,zero,zero
1774 ; AVX2-FAST-NEXT: retq
1776 ; AVX512VL-SLOW-LABEL: shuffle_v4i64_1z2z:
1777 ; AVX512VL-SLOW: # %bb.0:
1778 ; AVX512VL-SLOW-NEXT: vxorps %xmm1, %xmm1, %xmm1
1779 ; AVX512VL-SLOW-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3,4,5,6,7]
1780 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,2,0]
1781 ; AVX512VL-SLOW-NEXT: retq
1783 ; AVX512VL-FAST-LABEL: shuffle_v4i64_1z2z:
1784 ; AVX512VL-FAST: # %bb.0:
1785 ; AVX512VL-FAST-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[8,9,10,11,12,13,14,15],zero,zero,zero,zero,zero,zero,zero,zero,ymm0[16,17,18,19,20,21,22,23],zero,zero,zero,zero,zero,zero,zero,zero
1786 ; AVX512VL-FAST-NEXT: retq
1787 %1 = shufflevector <4 x i64> %a, <4 x i64> <i64 0, i64 undef, i64 undef, i64 undef>, <4 x i32> <i32 1, i32 4, i32 2, i32 4>
1791 define <4 x double> @add_v4f64_0246_1357(<4 x double> %a, <4 x double> %b) {
1792 ; AVX1-LABEL: add_v4f64_0246_1357:
1793 ; AVX1: # %bb.0: # %entry
1794 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
1795 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1796 ; AVX1-NEXT: vhaddpd %ymm2, %ymm0, %ymm0
1799 ; AVX2-LABEL: add_v4f64_0246_1357:
1800 ; AVX2: # %bb.0: # %entry
1801 ; AVX2-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
1802 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
1803 ; AVX2-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1804 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1805 ; AVX2-NEXT: vaddpd %ymm0, %ymm2, %ymm0
1808 ; AVX512VL-SLOW-LABEL: add_v4f64_0246_1357:
1809 ; AVX512VL-SLOW: # %bb.0: # %entry
1810 ; AVX512VL-SLOW-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
1811 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
1812 ; AVX512VL-SLOW-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1813 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1814 ; AVX512VL-SLOW-NEXT: vaddpd %ymm0, %ymm2, %ymm0
1815 ; AVX512VL-SLOW-NEXT: retq
1817 ; AVX512VL-FAST-LABEL: add_v4f64_0246_1357:
1818 ; AVX512VL-FAST: # %bb.0: # %entry
1819 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [0,2,4,6]
1820 ; AVX512VL-FAST-NEXT: vpermi2pd %ymm1, %ymm0, %ymm2
1821 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm3 = [1,3,5,7]
1822 ; AVX512VL-FAST-NEXT: vpermi2pd %ymm1, %ymm0, %ymm3
1823 ; AVX512VL-FAST-NEXT: vaddpd %ymm3, %ymm2, %ymm0
1824 ; AVX512VL-FAST-NEXT: retq
1826 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
1827 %shuffle1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
1828 %add = fadd <4 x double> %shuffle, %shuffle1
1829 ret <4 x double> %add
1832 define <4 x double> @add_v4f64_4602_5713(<4 x double> %a, <4 x double> %b) {
1833 ; AVX1-LABEL: add_v4f64_4602_5713:
1834 ; AVX1: # %bb.0: # %entry
1835 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
1836 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1837 ; AVX1-NEXT: vhaddpd %ymm2, %ymm0, %ymm0
1840 ; AVX2-LABEL: add_v4f64_4602_5713:
1841 ; AVX2: # %bb.0: # %entry
1842 ; AVX2-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1843 ; AVX2-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
1844 ; AVX2-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3]
1845 ; AVX2-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1846 ; AVX2-NEXT: vaddpd %ymm0, %ymm2, %ymm0
1849 ; AVX512VL-SLOW-LABEL: add_v4f64_4602_5713:
1850 ; AVX512VL-SLOW: # %bb.0: # %entry
1851 ; AVX512VL-SLOW-NEXT: vunpcklpd {{.*#+}} ymm2 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1852 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,1,3]
1853 ; AVX512VL-SLOW-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3]
1854 ; AVX512VL-SLOW-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,1,3]
1855 ; AVX512VL-SLOW-NEXT: vaddpd %ymm0, %ymm2, %ymm0
1856 ; AVX512VL-SLOW-NEXT: retq
1858 ; AVX512VL-FAST-LABEL: add_v4f64_4602_5713:
1859 ; AVX512VL-FAST: # %bb.0: # %entry
1860 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm2 = [0,2,4,6]
1861 ; AVX512VL-FAST-NEXT: vpermi2pd %ymm0, %ymm1, %ymm2
1862 ; AVX512VL-FAST-NEXT: vmovapd {{.*#+}} ymm3 = [1,3,5,7]
1863 ; AVX512VL-FAST-NEXT: vpermi2pd %ymm0, %ymm1, %ymm3
1864 ; AVX512VL-FAST-NEXT: vaddpd %ymm3, %ymm2, %ymm0
1865 ; AVX512VL-FAST-NEXT: retq
1867 %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 4, i32 6, i32 0, i32 2>
1868 %shuffle1 = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 5, i32 7, i32 1, i32 3>
1869 %add = fadd <4 x double> %shuffle, %shuffle1
1870 ret <4 x double> %add
1873 define <4 x i64> @add_v4i64_0246_1357(<4 x i64> %a, <4 x i64> %b) {
1874 ; AVX1-LABEL: add_v4i64_0246_1357:
1875 ; AVX1: # %bb.0: # %entry
1876 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3],ymm1[2,3]
1877 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
1878 ; AVX1-NEXT: vunpcklpd {{.*#+}} ymm1 = ymm0[0],ymm2[0],ymm0[2],ymm2[2]
1879 ; AVX1-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm2[1],ymm0[3],ymm2[3]
1880 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1881 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
1882 ; AVX1-NEXT: vpaddq %xmm2, %xmm3, %xmm2
1883 ; AVX1-NEXT: vpaddq %xmm0, %xmm1, %xmm0
1884 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1887 ; AVX2-LABEL: add_v4i64_0246_1357:
1888 ; AVX2: # %bb.0: # %entry
1889 ; AVX2-NEXT: vpunpcklqdq {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
1890 ; AVX2-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,1,3]
1891 ; AVX2-NEXT: vpunpckhqdq {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1892 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1893 ; AVX2-NEXT: vpaddq %ymm0, %ymm2, %ymm0
1896 ; AVX512VL-SLOW-LABEL: add_v4i64_0246_1357:
1897 ; AVX512VL-SLOW: # %bb.0: # %entry
1898 ; AVX512VL-SLOW-NEXT: vpunpcklqdq {{.*#+}} ymm2 = ymm0[0],ymm1[0],ymm0[2],ymm1[2]
1899 ; AVX512VL-SLOW-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,1,3]
1900 ; AVX512VL-SLOW-NEXT: vpunpckhqdq {{.*#+}} ymm0 = ymm0[1],ymm1[1],ymm0[3],ymm1[3]
1901 ; AVX512VL-SLOW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1902 ; AVX512VL-SLOW-NEXT: vpaddq %ymm0, %ymm2, %ymm0
1903 ; AVX512VL-SLOW-NEXT: retq
1905 ; AVX512VL-FAST-LABEL: add_v4i64_0246_1357:
1906 ; AVX512VL-FAST: # %bb.0: # %entry
1907 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6]
1908 ; AVX512VL-FAST-NEXT: vpermi2q %ymm1, %ymm0, %ymm2
1909 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7]
1910 ; AVX512VL-FAST-NEXT: vpermi2q %ymm1, %ymm0, %ymm3
1911 ; AVX512VL-FAST-NEXT: vpaddq %ymm3, %ymm2, %ymm0
1912 ; AVX512VL-FAST-NEXT: retq
1914 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
1915 %shuffle1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
1916 %add = add <4 x i64> %shuffle, %shuffle1
1920 define <4 x i64> @add_v4i64_4602_5713(<4 x i64> %a, <4 x i64> %b) {
1921 ; AVX1-LABEL: add_v4i64_4602_5713:
1922 ; AVX1: # %bb.0: # %entry
1923 ; AVX1-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm1[2,3],ymm0[2,3]
1924 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1925 ; AVX1-NEXT: vunpcklpd {{.*#+}} ymm1 = ymm0[0],ymm2[0],ymm0[2],ymm2[2]
1926 ; AVX1-NEXT: vunpckhpd {{.*#+}} ymm0 = ymm0[1],ymm2[1],ymm0[3],ymm2[3]
1927 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
1928 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm3
1929 ; AVX1-NEXT: vpaddq %xmm2, %xmm3, %xmm2
1930 ; AVX1-NEXT: vpaddq %xmm0, %xmm1, %xmm0
1931 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
1934 ; AVX2-LABEL: add_v4i64_4602_5713:
1935 ; AVX2: # %bb.0: # %entry
1936 ; AVX2-NEXT: vpunpcklqdq {{.*#+}} ymm2 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1937 ; AVX2-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,1,3]
1938 ; AVX2-NEXT: vpunpckhqdq {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3]
1939 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1940 ; AVX2-NEXT: vpaddq %ymm0, %ymm2, %ymm0
1943 ; AVX512VL-SLOW-LABEL: add_v4i64_4602_5713:
1944 ; AVX512VL-SLOW: # %bb.0: # %entry
1945 ; AVX512VL-SLOW-NEXT: vpunpcklqdq {{.*#+}} ymm2 = ymm1[0],ymm0[0],ymm1[2],ymm0[2]
1946 ; AVX512VL-SLOW-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,1,3]
1947 ; AVX512VL-SLOW-NEXT: vpunpckhqdq {{.*#+}} ymm0 = ymm1[1],ymm0[1],ymm1[3],ymm0[3]
1948 ; AVX512VL-SLOW-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
1949 ; AVX512VL-SLOW-NEXT: vpaddq %ymm0, %ymm2, %ymm0
1950 ; AVX512VL-SLOW-NEXT: retq
1952 ; AVX512VL-FAST-LABEL: add_v4i64_4602_5713:
1953 ; AVX512VL-FAST: # %bb.0: # %entry
1954 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm2 = [0,2,4,6]
1955 ; AVX512VL-FAST-NEXT: vpermi2q %ymm0, %ymm1, %ymm2
1956 ; AVX512VL-FAST-NEXT: vmovdqa {{.*#+}} ymm3 = [1,3,5,7]
1957 ; AVX512VL-FAST-NEXT: vpermi2q %ymm0, %ymm1, %ymm3
1958 ; AVX512VL-FAST-NEXT: vpaddq %ymm3, %ymm2, %ymm0
1959 ; AVX512VL-FAST-NEXT: retq
1961 %shuffle = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 4, i32 6, i32 0, i32 2>
1962 %shuffle1 = shufflevector <4 x i64> %a, <4 x i64> %b, <4 x i32> <i32 5, i32 7, i32 1, i32 3>
1963 %add = add <4 x i64> %shuffle, %shuffle1
1967 define <4 x double> @shuffle_v4f64_0zzz_optsize(<4 x double> %a) optsize {
1968 ; ALL-LABEL: shuffle_v4f64_0zzz_optsize:
1970 ; ALL-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
1972 %b = shufflevector <4 x double> %a, <4 x double> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1976 define <4 x i64> @shuffle_v4i64_0zzz_optsize(<4 x i64> %a) optsize {
1977 ; ALL-LABEL: shuffle_v4i64_0zzz_optsize:
1979 ; ALL-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
1981 %b = shufflevector <4 x i64> %a, <4 x i64> zeroinitializer, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
1985 define <8 x float> @shuffle_v8f32_0zzzzzzz_optsize(<8 x float> %a) optsize {
1986 ; ALL-LABEL: shuffle_v8f32_0zzzzzzz_optsize:
1988 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1989 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = xmm0[0],xmm1[1,2,3]
1991 %b = shufflevector <8 x float> %a, <8 x float> zeroinitializer, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
1995 define <8 x i32> @shuffle_v8i32_0zzzzzzz_optsize(<8 x i32> %a) optsize {
1996 ; ALL-LABEL: shuffle_v8i32_0zzzzzzz_optsize:
1998 ; ALL-NEXT: vxorps %xmm1, %xmm1, %xmm1
1999 ; ALL-NEXT: vmovss {{.*#+}} xmm0 = xmm0[0],xmm1[1,2,3]
2001 %b = shufflevector <8 x i32> %a, <8 x i32> zeroinitializer, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
2005 define <4 x i64> @unpckh_v4i64(<4 x i64> %x, <4 x i64> %y) {
2006 ; ALL-LABEL: unpckh_v4i64:
2008 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2009 ; ALL-NEXT: vunpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
2011 %unpckh = shufflevector <4 x i64> %x, <4 x i64> %y, <4 x i32> <i32 1, i32 7, i32 undef, i32 undef>
2012 ret <4 x i64> %unpckh
2015 define <4 x double> @unpckh_v4f64(<4 x double> %x, <4 x double> %y) {
2016 ; ALL-LABEL: unpckh_v4f64:
2018 ; ALL-NEXT: vextractf128 $1, %ymm1, %xmm1
2019 ; ALL-NEXT: vunpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
2021 %unpckh = shufflevector <4 x double> %x, <4 x double> %y, <4 x i32> <i32 1, i32 7, i32 undef, i32 undef>
2022 ret <4 x double> %unpckh