blob: d9a69c73893d13253153ca6ce3666c836deaeffd [file] [log] [blame]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512f -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512F
2; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512bw -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512BW
3
4target triple = "x86_64-unknown-unknown"
5
6define <8 x double> @shuffle_v8f64_00000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00007; ALL-LABEL: shuffle_v8f64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +00008; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00009; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +000010; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000011; ALL-NEXT: retq
12 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
13 ret <8 x double> %shuffle
14}
15
16define <8 x double> @shuffle_v8f64_00000010(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000017; ALL-LABEL: shuffle_v8f64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +000018; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000019; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000020; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000021; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000022; ALL-NEXT: retq
23 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0>
24 ret <8 x double> %shuffle
25}
26
27define <8 x double> @shuffle_v8f64_00000200(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000028; ALL-LABEL: shuffle_v8f64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +000029; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000030; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000031; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000032; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000033; ALL-NEXT: retq
34 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0>
35 ret <8 x double> %shuffle
36}
37
38define <8 x double> @shuffle_v8f64_00003000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000039; ALL-LABEL: shuffle_v8f64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000040; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000041; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000042; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +000043; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
44; ALL-NEXT: retq
45 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 0>
46 ret <8 x double> %shuffle
47}
48
49define <8 x double> @shuffle_v8f64_00040000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000050; ALL-LABEL: shuffle_v8f64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000051; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000052; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000053; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
54; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
55; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1,2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000056; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
57; ALL-NEXT: retq
58 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0>
59 ret <8 x double> %shuffle
60}
61
62define <8 x double> @shuffle_v8f64_00500000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000063; ALL-LABEL: shuffle_v8f64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000064; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000065; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000066; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000067; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
68; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000069; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
70; ALL-NEXT: retq
71 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0>
72 ret <8 x double> %shuffle
73}
74
75define <8 x double> @shuffle_v8f64_06000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000076; ALL-LABEL: shuffle_v8f64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000077; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000078; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000079; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000080; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
81; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0],ymm1[1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000082; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
83; ALL-NEXT: retq
84 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
85 ret <8 x double> %shuffle
86}
87
88define <8 x double> @shuffle_v8f64_70000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000089; ALL-LABEL: shuffle_v8f64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000090; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000091; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000092; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000093; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruthf3e88062014-10-03 22:43:17 +000094; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm1[0],ymm0[1,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000095; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
96; ALL-NEXT: retq
97 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
98 ret <8 x double> %shuffle
99}
100
101define <8 x double> @shuffle_v8f64_01014545(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000102; ALL-LABEL: shuffle_v8f64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000103; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000104; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
105; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1
106; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
107; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000108; ALL-NEXT: retq
109 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>
110 ret <8 x double> %shuffle
111}
112
113define <8 x double> @shuffle_v8f64_00112233(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000114; ALL-LABEL: shuffle_v8f64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000115; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000116; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,1,1]
117; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000118; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000119; ALL-NEXT: retq
120 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
121 ret <8 x double> %shuffle
122}
123
124define <8 x double> @shuffle_v8f64_00001111(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000125; ALL-LABEL: shuffle_v8f64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000126; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000127; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000128; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000129; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
130; ALL-NEXT: retq
131 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1>
132 ret <8 x double> %shuffle
133}
134
135define <8 x double> @shuffle_v8f64_81a3c5e7(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000136; ALL-LABEL: shuffle_v8f64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000137; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000138; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
139; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000140; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
141; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000142; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
143; ALL-NEXT: retq
144 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 5, i32 14, i32 7>
145 ret <8 x double> %shuffle
146}
147
148define <8 x double> @shuffle_v8f64_08080808(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000149; ALL-LABEL: shuffle_v8f64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000150; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000151; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000152; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000153; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000154; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0
155; ALL-NEXT: retq
156 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8>
157 ret <8 x double> %shuffle
158}
159
160define <8 x double> @shuffle_v8f64_08084c4c(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000161; ALL-LABEL: shuffle_v8f64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000162; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000163; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
164; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2
165; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000166; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000167; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1],ymm2[2],ymm3[3]
168; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000169; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000170; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000171; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
172; ALL-NEXT: retq
173 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 4, i32 12, i32 4, i32 12>
174 ret <8 x double> %shuffle
175}
176
177define <8 x double> @shuffle_v8f64_8823cc67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000178; ALL-LABEL: shuffle_v8f64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000179; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000180; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
181; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000182; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000183; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000184; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000185; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000186; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
187; ALL-NEXT: retq
188 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 8, i32 8, i32 2, i32 3, i32 12, i32 12, i32 6, i32 7>
189 ret <8 x double> %shuffle
190}
191
192define <8 x double> @shuffle_v8f64_9832dc76(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000193; ALL-LABEL: shuffle_v8f64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000194; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000195; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000196; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm2[0,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000197; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000198; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
199; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
200; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,3,2]
201; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
202; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000203; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
204; ALL-NEXT: retq
205 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 9, i32 8, i32 3, i32 2, i32 13, i32 12, i32 7, i32 6>
206 ret <8 x double> %shuffle
207}
208
209define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000210; ALL-LABEL: shuffle_v8f64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000211; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000212; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000213; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000214; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000215; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
216; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
217; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,0]
218; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
219; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000220; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
221; ALL-NEXT: retq
222 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 9, i32 8, i32 1, i32 0, i32 13, i32 12, i32 5, i32 4>
223 ret <8 x double> %shuffle
224}
225
226define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000227; ALL-LABEL: shuffle_v8f64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000228; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000229; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000230; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000231; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000232; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[0,1,1,3]
233; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
234; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
235; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
236; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000237; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
238; ALL-NEXT: retq
239 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
240 ret <8 x double> %shuffle
241}
242
243define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000244; ALL-LABEL: shuffle_v8f64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000245; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000246; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000247; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000248; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000249; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[2,1,3,3]
250; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
251; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
252; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,3]
253; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000254; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
255; ALL-NEXT: retq
256 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
257 ret <8 x double> %shuffle
258}
259
260define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000261; ALL-LABEL: shuffle_v8f64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000262; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000263; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm1[0,2,2,3]
264; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
265; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
266; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
267; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
268; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000269; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
270; ALL-NEXT: retq
271 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
272 ret <8 x double> %shuffle
273}
274
275define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000276; ALL-LABEL: shuffle_v8f64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000277; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000278; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm0[1,0,2,2]
279; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm1[0,2,3,3]
280; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1,2,3]
281; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,1]
282; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
283; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000284; ALL-NEXT: retq
285 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 9, i32 9, i32 1, i32 10, i32 11, i32 11>
286 ret <8 x double> %shuffle
287}
288
289define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000290; ALL-LABEL: shuffle_v8f64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000291; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000292; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000293; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
294; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
295; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
296; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000297; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
298; ALL-NEXT: retq
299 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 9, i32 1, i32 11, i32 2, i32 13, i32 3, i32 15>
300 ret <8 x double> %shuffle
301}
302
303define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000304; ALL-LABEL: shuffle_v8f64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000305; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000306; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
307; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm0[1,0,2,2]
308; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1,2,3]
309; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
310; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000311; ALL-NEXT: retq
312 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
313 ret <8 x double> %shuffle
314}
315
316define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000317; ALL-LABEL: shuffle_v8f64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000318; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000319; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000320; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000321; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000322; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000323; ALL-NEXT: retq
324 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
325 ret <8 x double> %shuffle
326}
327
328define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000329; ALL-LABEL: shuffle_v8f64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000330; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000331; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000332; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000333; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000334; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000335; ALL-NEXT: retq
336 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
337 ret <8 x double> %shuffle
338}
339
340define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000341; ALL-LABEL: shuffle_v8f64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000342; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000343; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000344; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000345; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000346; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000347; ALL-NEXT: retq
348 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
349 ret <8 x double> %shuffle
350}
351
352define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000353; ALL-LABEL: shuffle_v8f64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000354; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000355; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000356; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000357; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000358; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000359; ALL-NEXT: retq
360 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
361 ret <8 x double> %shuffle
362}
363
364define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000365; ALL-LABEL: shuffle_v8f64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000366; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000367; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000368; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000369; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000370; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000371; ALL-NEXT: retq
372 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
373 ret <8 x double> %shuffle
374}
375
376define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000377; ALL-LABEL: shuffle_v8f64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000378; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000379; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000380; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000381; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000382; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000383; ALL-NEXT: retq
384 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
385 ret <8 x double> %shuffle
386}
387
388define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000389; ALL-LABEL: shuffle_v8f64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000390; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000391; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000392; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000393; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000394; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000395; ALL-NEXT: retq
396 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
397 ret <8 x double> %shuffle
398}
399
400define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000401; ALL-LABEL: shuffle_v8f64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000402; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000403; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000404; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000405; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000406; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000407; ALL-NEXT: retq
408 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
409 ret <8 x double> %shuffle
410}
411
412define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000413; ALL-LABEL: shuffle_v8f64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000414; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000415; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000416; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000417; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000418; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000419; ALL-NEXT: retq
420 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
421 ret <8 x double> %shuffle
422}
423
424define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000425; ALL-LABEL: shuffle_v8f64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000426; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000427; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000428; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000429; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000430; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000431; ALL-NEXT: retq
432 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
433 ret <8 x double> %shuffle
434}
435
436define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000437; ALL-LABEL: shuffle_v8f64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000438; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000439; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000440; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000441; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000442; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000443; ALL-NEXT: retq
444 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
445 ret <8 x double> %shuffle
446}
447
448define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000449; ALL-LABEL: shuffle_v8f64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000450; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000451; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000452; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000453; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000454; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000455; ALL-NEXT: retq
456 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
457 ret <8 x double> %shuffle
458}
459
460define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000461; ALL-LABEL: shuffle_v8f64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000462; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000463; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000464; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000465; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000466; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000467; ALL-NEXT: retq
468 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 2, i32 5, i32 4, i32 6, i32 6>
469 ret <8 x double> %shuffle
470}
471
472define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000473; ALL-LABEL: shuffle_v8f64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000474; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000475; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000476; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000477; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000478; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
479; ALL-NEXT: retq
480 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
481 ret <8 x double> %shuffle
482}
483
484define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000485; ALL-LABEL: shuffle_v8f64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000486; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000487; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000488; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000489; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000490; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
491; ALL-NEXT: retq
492 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 6, i32 4, i32 4>
493 ret <8 x double> %shuffle
494}
495
496define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000497; ALL-LABEL: shuffle_v8f64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000498; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000499; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000500; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000501; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000502; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000503; ALL-NEXT: retq
504 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 4, i32 7, i32 4>
505 ret <8 x double> %shuffle
506}
507
508define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000509; ALL-LABEL: shuffle_v8f64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000510; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000511; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000512; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000513; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000514; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
515; ALL-NEXT: retq
516 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4>
517 ret <8 x double> %shuffle
518}
519
520define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000521; ALL-LABEL: shuffle_v8f64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000522; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000523; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000524; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000525; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000526; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000527; ALL-NEXT: retq
528 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
529 ret <8 x double> %shuffle
530}
531
532define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000533; ALL-LABEL: shuffle_v8f64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000534; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000535; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000536; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000537; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000538; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000539; ALL-NEXT: retq
540 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 4, i32 7, i32 4>
541 ret <8 x double> %shuffle
542}
543
544define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000545; ALL-LABEL: shuffle_v8f64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000546; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000547; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000548; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
549; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000550; ALL-NEXT: retq
551 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
552 ret <8 x double> %shuffle
553}
554
555define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000556; ALL-LABEL: shuffle_v8f64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000557; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000558; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000559; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000560; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000561; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
562; ALL-NEXT: retq
563 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 6, i32 7, i32 4, i32 4>
564 ret <8 x double> %shuffle
565}
566
567define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000568; ALL-LABEL: shuffle_v8f64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000569; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000570; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000571; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000572; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000573; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000574; ALL-NEXT: retq
575 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 6, i32 6, i32 4, i32 4>
576 ret <8 x double> %shuffle
577}
578
579define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000580; ALL-LABEL: shuffle_v8f64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000581; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000582; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000583; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
584; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000585; ALL-NEXT: retq
586 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
587 ret <8 x double> %shuffle
588}
589
590define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000591; ALL-LABEL: shuffle_v8f64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000592; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000593; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000594; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
595; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000596; ALL-NEXT: retq
597 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
598 ret <8 x double> %shuffle
599}
600
601define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000602; ALL-LABEL: shuffle_v8f64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000603; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000604; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000605; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000606; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
607; ALL-NEXT: retq
608 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
609 ret <8 x double> %shuffle
610}
611
612define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000613; ALL-LABEL: shuffle_v8f64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000614; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000615; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000616; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000617; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000618; ALL-NEXT: retq
619 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
620 ret <8 x double> %shuffle
621}
622
623define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000624; ALL-LABEL: shuffle_v8f64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000625; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000626; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000627; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000628; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000629; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000630; ALL-NEXT: retq
631 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 undef, i32 6, i32 undef, i32 4, i32 4>
632 ret <8 x double> %shuffle
633}
634
635define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000636; ALL-LABEL: shuffle_v8f64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000637; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000638; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +0000639; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000640; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000641; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
642; ALL-NEXT: retq
643 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 undef, i32 undef, i32 6, i32 6, i32 undef, i32 undef>
644 ret <8 x double> %shuffle
645}
646
647define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000648; ALL-LABEL: shuffle_v8f64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000649; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000650; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000651; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000652; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
653; ALL-NEXT: retq
654 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
655 ret <8 x double> %shuffle
656}
657
658define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000659; ALL-LABEL: shuffle_v8f64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000660; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000661; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000662; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
663; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000664; ALL-NEXT: retq
665 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 undef, i32 6, i32 7>
666 ret <8 x double> %shuffle
667}
668
669define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000670; ALL-LABEL: shuffle_v8f64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000671; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000672; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000673; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000674; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
675; ALL-NEXT: retq
676 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 undef, i32 undef, i32 3, i32 5, i32 4, i32 undef, i32 undef>
677 ret <8 x double> %shuffle
678}
679
680define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000681; ALL-LABEL: shuffle_v8f64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000682; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000683; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000684; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000685; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000686; ALL-NEXT: retq
687 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 3, i32 undef, i32 undef, i32 6, i32 6>
688 ret <8 x double> %shuffle
689}
690
691define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000692; ALL-LABEL: shuffle_v8f64_c348cda0:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000693; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000694; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
695; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[0,1],ymm2[0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000696; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000697; ALL-NEXT: vbroadcastsd %xmm1, %ymm4
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000698; ALL-NEXT: vblendpd {{.*#+}} ymm4 = ymm3[0,1,2],ymm4[3]
699; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm4[0],ymm2[1,2],ymm4[3]
700; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm3[0,1],ymm1[2],ymm3[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000701; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000702; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000703; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000704; ALL-NEXT: retq
705 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 12, i32 3, i32 4, i32 8, i32 12, i32 13, i32 10, i32 0>
706 ret <8 x double> %shuffle
707}
708
709define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000710; ALL-LABEL: shuffle_v8f64_f511235a:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000711; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000712; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
713; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
714; ALL-NEXT: vpermpd {{.*#+}} ymm4 = ymm3[0,1,1,3]
715; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1],ymm4[2],ymm2[3]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000716; ALL-NEXT: vpermilpd {{.*#+}} ymm4 = ymm1[0,0,2,2]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000717; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1,2],ymm4[3]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000718; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,1]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000719; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm3[1],ymm0[2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000720; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000721; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthf3e88062014-10-03 22:43:17 +0000722; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000723; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000724; ALL-NEXT: retq
725 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 15, i32 5, i32 1, i32 1, i32 2, i32 3, i32 5, i32 10>
726 ret <8 x double> %shuffle
727}
728
729define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000730; ALL-LABEL: shuffle_v8i64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000731; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000732; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000733; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000734; ALL-NEXT: retq
735 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
736 ret <8 x i64> %shuffle
737}
738
739define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000740; ALL-LABEL: shuffle_v8i64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000741; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000742; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000743; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000744; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000745; ALL-NEXT: retq
746 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0>
747 ret <8 x i64> %shuffle
748}
749
750define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000751; ALL-LABEL: shuffle_v8i64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000752; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000753; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000754; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000755; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000756; ALL-NEXT: retq
757 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0>
758 ret <8 x i64> %shuffle
759}
760
761define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000762; ALL-LABEL: shuffle_v8i64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000763; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000764; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000765; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000766; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
767; ALL-NEXT: retq
768 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 0>
769 ret <8 x i64> %shuffle
770}
771
772define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000773; ALL-LABEL: shuffle_v8i64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000774; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000775; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000776; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
777; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
778; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000779; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
780; ALL-NEXT: retq
781 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0>
782 ret <8 x i64> %shuffle
783}
784
785define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000786; ALL-LABEL: shuffle_v8i64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000787; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000788; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000789; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000790; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
791; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000792; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
793; ALL-NEXT: retq
794 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0>
795 ret <8 x i64> %shuffle
796}
797
798define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000799; ALL-LABEL: shuffle_v8i64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000800; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000801; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000802; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000803; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
804; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000805; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
806; ALL-NEXT: retq
807 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
808 ret <8 x i64> %shuffle
809}
810
811define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000812; ALL-LABEL: shuffle_v8i64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000813; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000814; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000815; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000816; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000817; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm0[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000818; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
819; ALL-NEXT: retq
820 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
821 ret <8 x i64> %shuffle
822}
823
824define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000825; ALL-LABEL: shuffle_v8i64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000826; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000827; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
828; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1
829; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
830; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000831; ALL-NEXT: retq
832 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>
833 ret <8 x i64> %shuffle
834}
835
836define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000837; ALL-LABEL: shuffle_v8i64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000838; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000839; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,1,1]
840; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000841; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000842; ALL-NEXT: retq
843 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
844 ret <8 x i64> %shuffle
845}
846
847define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000848; ALL-LABEL: shuffle_v8i64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000849; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000850; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000851; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000852; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
853; ALL-NEXT: retq
854 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1>
855 ret <8 x i64> %shuffle
856}
857
858define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000859; ALL-LABEL: shuffle_v8i64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000860; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000861; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
862; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000863; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
864; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000865; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
866; ALL-NEXT: retq
867 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 5, i32 14, i32 7>
868 ret <8 x i64> %shuffle
869}
870
871define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000872; ALL-LABEL: shuffle_v8i64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000873; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000874; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000875; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000876; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000877; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
878; ALL-NEXT: retq
879 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8>
880 ret <8 x i64> %shuffle
881}
882
883define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000884; ALL-LABEL: shuffle_v8i64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000885; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000886; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
887; ALL-NEXT: vinserti128 $1, %xmm2, %ymm2, %ymm2
888; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000889; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000890; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3],ymm2[4,5],ymm3[6,7]
891; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000892; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000893; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000894; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
895; ALL-NEXT: retq
896 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 4, i32 12, i32 4, i32 12>
897 ret <8 x i64> %shuffle
898}
899
900define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000901; ALL-LABEL: shuffle_v8i64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000902; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000903; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
904; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000905; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000906; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000907; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000908; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000909; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
910; ALL-NEXT: retq
911 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 8, i32 8, i32 2, i32 3, i32 12, i32 12, i32 6, i32 7>
912 ret <8 x i64> %shuffle
913}
914
915define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000916; ALL-LABEL: shuffle_v8i64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000917; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000918; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000919; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +0000920; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000921; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
922; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
923; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
924; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
925; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000926; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
927; ALL-NEXT: retq
928 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 9, i32 8, i32 3, i32 2, i32 13, i32 12, i32 7, i32 6>
929 ret <8 x i64> %shuffle
930}
931
932define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000933; ALL-LABEL: shuffle_v8i64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000934; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000935; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000936; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000937; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000938; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
939; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
940; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,0]
941; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
942; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000943; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
944; ALL-NEXT: retq
945 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 9, i32 8, i32 1, i32 0, i32 13, i32 12, i32 5, i32 4>
946 ret <8 x i64> %shuffle
947}
948
949define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000950; ALL-LABEL: shuffle_v8i64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000951; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000952; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000953; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000954; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000955; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,1,1,3]
956; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
957; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
958; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
959; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000960; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
961; ALL-NEXT: retq
962 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
963 ret <8 x i64> %shuffle
964}
965
966define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000967; ALL-LABEL: shuffle_v8i64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000968; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000969; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000970; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000971; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000972; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[2,1,3,3]
973; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
974; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
975; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,3,3]
976; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000977; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
978; ALL-NEXT: retq
979 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
980 ret <8 x i64> %shuffle
981}
982
983define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000984; ALL-LABEL: shuffle_v8i64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000985; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000986; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,2,2,3]
987; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
988; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
989; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
990; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
991; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000992; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
993; ALL-NEXT: retq
994 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
995 ret <8 x i64> %shuffle
996}
997
998define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000999; ALL-LABEL: shuffle_v8i64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001000; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001001; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm0[2,3,2,3,6,7,6,7]
1002; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm1[0,2,3,3]
1003; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3,4,5,6,7]
1004; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,1,1]
1005; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001006; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1007; ALL-NEXT: retq
1008 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 8, i32 9, i32 9, i32 1, i32 10, i32 11, i32 11>
1009 ret <8 x i64> %shuffle
1010}
1011
1012define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001013; ALL-LABEL: shuffle_v8i64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001014; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001015; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001016; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
1017; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
1018; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1019; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001020; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1021; ALL-NEXT: retq
1022 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 9, i32 1, i32 11, i32 2, i32 13, i32 3, i32 15>
1023 ret <8 x i64> %shuffle
1024}
1025
1026define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001027; ALL-LABEL: shuffle_v8i64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001028; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001029; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001030; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm0[2,3,2,3,6,7,6,7]
1031; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7]
1032; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001033; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1034; ALL-NEXT: retq
1035 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
1036 ret <8 x i64> %shuffle
1037}
1038
1039define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001040; ALL-LABEL: shuffle_v8i64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001041; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001042; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001043; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001044; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001045; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001046; ALL-NEXT: retq
1047 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
1048 ret <8 x i64> %shuffle
1049}
1050
1051define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001052; ALL-LABEL: shuffle_v8i64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001053; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001054; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001055; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001056; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001057; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001058; ALL-NEXT: retq
1059 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
1060 ret <8 x i64> %shuffle
1061}
1062
1063define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001064; ALL-LABEL: shuffle_v8i64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001065; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001066; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001067; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001068; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001069; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001070; ALL-NEXT: retq
1071 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
1072 ret <8 x i64> %shuffle
1073}
1074
1075define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001076; ALL-LABEL: shuffle_v8i64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001077; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001078; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001079; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001080; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001081; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001082; ALL-NEXT: retq
1083 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
1084 ret <8 x i64> %shuffle
1085}
1086
1087define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001088; ALL-LABEL: shuffle_v8i64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001089; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001090; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001091; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001092; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001093; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001094; ALL-NEXT: retq
1095 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
1096 ret <8 x i64> %shuffle
1097}
1098
1099define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001100; ALL-LABEL: shuffle_v8i64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001101; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001102; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001103; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001104; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001105; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001106; ALL-NEXT: retq
1107 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
1108 ret <8 x i64> %shuffle
1109}
1110
1111define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001112; ALL-LABEL: shuffle_v8i64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001113; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001114; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001115; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001116; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001117; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001118; ALL-NEXT: retq
1119 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
1120 ret <8 x i64> %shuffle
1121}
1122
1123define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001124; ALL-LABEL: shuffle_v8i64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001125; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001126; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001127; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001128; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001129; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001130; ALL-NEXT: retq
1131 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
1132 ret <8 x i64> %shuffle
1133}
1134
1135define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001136; ALL-LABEL: shuffle_v8i64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001137; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001138; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001139; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001140; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001141; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001142; ALL-NEXT: retq
1143 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
1144 ret <8 x i64> %shuffle
1145}
1146
1147define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001148; ALL-LABEL: shuffle_v8i64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001149; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001150; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001151; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001152; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001153; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001154; ALL-NEXT: retq
1155 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
1156 ret <8 x i64> %shuffle
1157}
1158
1159define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001160; ALL-LABEL: shuffle_v8i64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001161; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001162; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001163; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001164; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001165; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001166; ALL-NEXT: retq
1167 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
1168 ret <8 x i64> %shuffle
1169}
1170
1171define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001172; ALL-LABEL: shuffle_v8i64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001173; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001174; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001175; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001176; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001177; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001178; ALL-NEXT: retq
1179 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
1180 ret <8 x i64> %shuffle
1181}
1182
1183define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001184; ALL-LABEL: shuffle_v8i64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001185; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001186; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001187; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001188; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001189; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001190; ALL-NEXT: retq
1191 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 2, i32 5, i32 4, i32 6, i32 6>
1192 ret <8 x i64> %shuffle
1193}
1194
1195define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001196; ALL-LABEL: shuffle_v8i64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001197; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001198; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001199; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001200; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001201; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1202; ALL-NEXT: retq
1203 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
1204 ret <8 x i64> %shuffle
1205}
1206
1207define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001208; ALL-LABEL: shuffle_v8i64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001209; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001210; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001211; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001212; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001213; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1214; ALL-NEXT: retq
1215 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 6, i32 4, i32 4>
1216 ret <8 x i64> %shuffle
1217}
1218
1219define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001220; ALL-LABEL: shuffle_v8i64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001221; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001222; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001223; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001224; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001225; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001226; ALL-NEXT: retq
1227 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 4, i32 7, i32 4>
1228 ret <8 x i64> %shuffle
1229}
1230
1231define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001232; ALL-LABEL: shuffle_v8i64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001233; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001234; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001235; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001236; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001237; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1238; ALL-NEXT: retq
1239 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4>
1240 ret <8 x i64> %shuffle
1241}
1242
1243define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001244; ALL-LABEL: shuffle_v8i64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001245; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001246; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001247; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001248; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001249; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001250; ALL-NEXT: retq
1251 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
1252 ret <8 x i64> %shuffle
1253}
1254
1255define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001256; ALL-LABEL: shuffle_v8i64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001257; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001258; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001259; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001260; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001261; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001262; ALL-NEXT: retq
1263 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 4, i32 7, i32 4>
1264 ret <8 x i64> %shuffle
1265}
1266
1267define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001268; ALL-LABEL: shuffle_v8i64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001269; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001270; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001271; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1272; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001273; ALL-NEXT: retq
1274 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
1275 ret <8 x i64> %shuffle
1276}
1277
1278define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001279; ALL-LABEL: shuffle_v8i64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001280; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001281; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001282; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001283; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001284; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1285; ALL-NEXT: retq
1286 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 6, i32 7, i32 4, i32 4>
1287 ret <8 x i64> %shuffle
1288}
1289
1290define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001291; ALL-LABEL: shuffle_v8i64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001292; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001293; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001294; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001295; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001296; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001297; ALL-NEXT: retq
1298 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 6, i32 6, i32 4, i32 4>
1299 ret <8 x i64> %shuffle
1300}
1301
1302define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001303; ALL-LABEL: shuffle_v8i64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001304; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001305; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001306; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1307; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001308; ALL-NEXT: retq
1309 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
1310 ret <8 x i64> %shuffle
1311}
1312
1313define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001314; ALL-LABEL: shuffle_v8i64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001315; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001316; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001317; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1318; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001319; ALL-NEXT: retq
1320 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
1321 ret <8 x i64> %shuffle
1322}
1323
1324define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001325; ALL-LABEL: shuffle_v8i64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001326; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001327; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001328; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001329; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1330; ALL-NEXT: retq
1331 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
1332 ret <8 x i64> %shuffle
1333}
1334
1335define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001336; ALL-LABEL: shuffle_v8i64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001337; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001338; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001339; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001340; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001341; ALL-NEXT: retq
1342 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
1343 ret <8 x i64> %shuffle
1344}
1345
1346define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001347; ALL-LABEL: shuffle_v8i64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001348; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001349; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001350; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001351; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001352; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001353; ALL-NEXT: retq
1354 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 undef, i32 6, i32 undef, i32 4, i32 4>
1355 ret <8 x i64> %shuffle
1356}
1357
1358define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001359; ALL-LABEL: shuffle_v8i64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001360; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001361; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +00001362; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001363; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001364; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1365; ALL-NEXT: retq
1366 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 undef, i32 undef, i32 6, i32 6, i32 undef, i32 undef>
1367 ret <8 x i64> %shuffle
1368}
1369
1370define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001371; ALL-LABEL: shuffle_v8i64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001372; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001373; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001374; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001375; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1376; ALL-NEXT: retq
1377 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
1378 ret <8 x i64> %shuffle
1379}
1380
1381define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001382; ALL-LABEL: shuffle_v8i64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001383; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001384; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001385; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1386; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001387; ALL-NEXT: retq
1388 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 undef, i32 6, i32 7>
1389 ret <8 x i64> %shuffle
1390}
1391
1392define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001393; ALL-LABEL: shuffle_v8i64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001394; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001395; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001396; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001397; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1398; ALL-NEXT: retq
1399 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 undef, i32 undef, i32 3, i32 5, i32 4, i32 undef, i32 undef>
1400 ret <8 x i64> %shuffle
1401}
1402
1403define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001404; ALL-LABEL: shuffle_v8i64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001405; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001406; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001407; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001408; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001409; ALL-NEXT: retq
1410 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 3, i32 undef, i32 undef, i32 6, i32 6>
1411 ret <8 x i64> %shuffle
1412}
1413
1414define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001415; ALL-LABEL: shuffle_v8i64_6caa87e5:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001416; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001417; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001418; ALL-NEXT: vperm2i128 {{.*#+}} ymm2 = ymm0[0,1,0,1]
1419; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
1420; ALL-NEXT: vpblendd {{.*#+}} ymm4 = ymm1[0,1,2,3],ymm3[4,5],ymm1[6,7]
1421; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm4[0,1],ymm2[2,3],ymm4[4,5],ymm2[6,7]
1422; ALL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001423; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001424; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
1425; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm3[2,3],ymm1[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001426; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001427; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001428; ALL-NEXT: retq
1429 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 6, i32 12, i32 10, i32 10, i32 8, i32 7, i32 14, i32 5>
1430 ret <8 x i64> %shuffle
1431}