blob: 8f87c7c90fe036eb1001f05ab2068825d405417f [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:
Robert Khasanovdd09a8f2014-10-28 12:28:51 +00009; ALL-NEXT: vbroadcastsd %xmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000010; ALL-NEXT: retq
11 %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>
12 ret <8 x double> %shuffle
13}
14
15define <8 x double> @shuffle_v8f64_00000010(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000016; ALL-LABEL: shuffle_v8f64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +000017; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000018; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000019; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000020; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000021; ALL-NEXT: retq
22 %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>
23 ret <8 x double> %shuffle
24}
25
26define <8 x double> @shuffle_v8f64_00000200(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000027; ALL-LABEL: shuffle_v8f64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +000028; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000029; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000030; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000031; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000032; ALL-NEXT: retq
33 %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>
34 ret <8 x double> %shuffle
35}
36
37define <8 x double> @shuffle_v8f64_00003000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000038; ALL-LABEL: shuffle_v8f64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000039; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000040; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000041; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +000042; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
43; ALL-NEXT: retq
44 %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>
45 ret <8 x double> %shuffle
46}
47
48define <8 x double> @shuffle_v8f64_00040000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000049; ALL-LABEL: shuffle_v8f64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000050; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000051; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000052; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
53; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
54; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1,2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000055; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
56; ALL-NEXT: retq
57 %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>
58 ret <8 x double> %shuffle
59}
60
61define <8 x double> @shuffle_v8f64_00500000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000062; ALL-LABEL: shuffle_v8f64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000063; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000064; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000065; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000066; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
67; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000068; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
69; ALL-NEXT: retq
70 %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>
71 ret <8 x double> %shuffle
72}
73
74define <8 x double> @shuffle_v8f64_06000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000075; ALL-LABEL: shuffle_v8f64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000076; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000077; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000078; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000079; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
80; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0],ymm1[1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000081; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
82; ALL-NEXT: retq
83 %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>
84 ret <8 x double> %shuffle
85}
86
87define <8 x double> @shuffle_v8f64_70000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000088; ALL-LABEL: shuffle_v8f64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000089; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000090; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000091; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000092; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruthf3e88062014-10-03 22:43:17 +000093; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm1[0],ymm0[1,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000094; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
95; ALL-NEXT: retq
96 %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>
97 ret <8 x double> %shuffle
98}
99
100define <8 x double> @shuffle_v8f64_01014545(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000101; ALL-LABEL: shuffle_v8f64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000102; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000103; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
104; ALL-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1
105; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
106; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000107; ALL-NEXT: retq
108 %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>
109 ret <8 x double> %shuffle
110}
111
112define <8 x double> @shuffle_v8f64_00112233(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000113; ALL-LABEL: shuffle_v8f64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000114; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000115; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,1,1]
116; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000117; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000118; ALL-NEXT: retq
119 %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>
120 ret <8 x double> %shuffle
121}
122
123define <8 x double> @shuffle_v8f64_00001111(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000124; ALL-LABEL: shuffle_v8f64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000125; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000126; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000127; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000128; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
129; ALL-NEXT: retq
130 %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>
131 ret <8 x double> %shuffle
132}
133
134define <8 x double> @shuffle_v8f64_81a3c5e7(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000135; ALL-LABEL: shuffle_v8f64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000136; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000137; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
138; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000139; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
140; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000141; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
142; ALL-NEXT: retq
143 %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>
144 ret <8 x double> %shuffle
145}
146
147define <8 x double> @shuffle_v8f64_08080808(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000148; ALL-LABEL: shuffle_v8f64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000149; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000150; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000151; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000152; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000153; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0
154; ALL-NEXT: retq
155 %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>
156 ret <8 x double> %shuffle
157}
158
159define <8 x double> @shuffle_v8f64_08084c4c(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000160; ALL-LABEL: shuffle_v8f64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000161; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000162; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
163; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2
164; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000165; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000166; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1],ymm2[2],ymm3[3]
167; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000168; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000169; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000170; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
171; ALL-NEXT: retq
172 %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>
173 ret <8 x double> %shuffle
174}
175
176define <8 x double> @shuffle_v8f64_8823cc67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000177; ALL-LABEL: shuffle_v8f64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000178; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000179; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
180; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000181; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000182; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000183; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000184; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000185; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
186; ALL-NEXT: retq
187 %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>
188 ret <8 x double> %shuffle
189}
190
191define <8 x double> @shuffle_v8f64_9832dc76(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000192; ALL-LABEL: shuffle_v8f64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000193; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000194; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000195; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm2[0,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000196; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000197; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
198; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
199; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,3,2]
200; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
201; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000202; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
203; ALL-NEXT: retq
204 %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>
205 ret <8 x double> %shuffle
206}
207
208define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000209; ALL-LABEL: shuffle_v8f64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000210; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000211; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000212; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000213; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000214; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
215; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
216; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,0]
217; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
218; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000219; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
220; ALL-NEXT: retq
221 %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>
222 ret <8 x double> %shuffle
223}
224
225define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000226; ALL-LABEL: shuffle_v8f64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000227; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000228; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000229; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000230; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000231; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[0,1,1,3]
232; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
233; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
234; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
235; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000236; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
237; ALL-NEXT: retq
238 %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>
239 ret <8 x double> %shuffle
240}
241
242define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000243; ALL-LABEL: shuffle_v8f64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000244; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000245; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000246; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000247; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000248; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[2,1,3,3]
249; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
250; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
251; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,3]
252; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000253; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
254; ALL-NEXT: retq
255 %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>
256 ret <8 x double> %shuffle
257}
258
259define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000260; ALL-LABEL: shuffle_v8f64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000261; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000262; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm1[0,2,2,3]
263; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
264; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
265; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
266; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
267; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000268; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
269; ALL-NEXT: retq
270 %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>
271 ret <8 x double> %shuffle
272}
273
274define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000275; ALL-LABEL: shuffle_v8f64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000276; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000277; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm0[1,0,2,2]
278; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm1[0,2,3,3]
279; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1,2,3]
280; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,1]
281; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
282; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000283; ALL-NEXT: retq
284 %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>
285 ret <8 x double> %shuffle
286}
287
288define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000289; ALL-LABEL: shuffle_v8f64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000290; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000291; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000292; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
293; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
294; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
295; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000296; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
297; ALL-NEXT: retq
298 %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>
299 ret <8 x double> %shuffle
300}
301
302define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000303; ALL-LABEL: shuffle_v8f64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000304; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000305; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
306; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm0[1,0,2,2]
307; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1,2,3]
308; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
309; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000310; ALL-NEXT: retq
311 %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>
312 ret <8 x double> %shuffle
313}
314
315define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000316; ALL-LABEL: shuffle_v8f64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000317; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000318; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000319; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000320; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000321; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000322; ALL-NEXT: retq
323 %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>
324 ret <8 x double> %shuffle
325}
326
327define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000328; ALL-LABEL: shuffle_v8f64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000329; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000330; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000331; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000332; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000333; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000334; ALL-NEXT: retq
335 %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>
336 ret <8 x double> %shuffle
337}
338
339define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000340; ALL-LABEL: shuffle_v8f64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000341; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000342; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000343; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000344; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000345; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000346; ALL-NEXT: retq
347 %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>
348 ret <8 x double> %shuffle
349}
350
351define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000352; ALL-LABEL: shuffle_v8f64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000353; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000354; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000355; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000356; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000357; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000358; ALL-NEXT: retq
359 %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>
360 ret <8 x double> %shuffle
361}
362
363define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000364; ALL-LABEL: shuffle_v8f64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000365; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000366; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000367; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000368; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000369; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000370; ALL-NEXT: retq
371 %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>
372 ret <8 x double> %shuffle
373}
374
375define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000376; ALL-LABEL: shuffle_v8f64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000377; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000378; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000379; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000380; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000381; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000382; ALL-NEXT: retq
383 %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>
384 ret <8 x double> %shuffle
385}
386
387define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000388; ALL-LABEL: shuffle_v8f64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000389; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000390; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000391; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000392; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000393; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000394; ALL-NEXT: retq
395 %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>
396 ret <8 x double> %shuffle
397}
398
399define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000400; ALL-LABEL: shuffle_v8f64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000401; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000402; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000403; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000404; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000405; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000406; ALL-NEXT: retq
407 %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>
408 ret <8 x double> %shuffle
409}
410
411define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000412; ALL-LABEL: shuffle_v8f64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000413; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000414; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000415; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000416; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000417; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000418; ALL-NEXT: retq
419 %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>
420 ret <8 x double> %shuffle
421}
422
423define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000424; ALL-LABEL: shuffle_v8f64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000425; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000426; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000427; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000428; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000429; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000430; ALL-NEXT: retq
431 %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>
432 ret <8 x double> %shuffle
433}
434
435define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000436; ALL-LABEL: shuffle_v8f64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000437; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000438; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000439; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000440; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000441; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000442; ALL-NEXT: retq
443 %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>
444 ret <8 x double> %shuffle
445}
446
447define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000448; ALL-LABEL: shuffle_v8f64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000449; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000450; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000451; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000452; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000453; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000454; ALL-NEXT: retq
455 %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>
456 ret <8 x double> %shuffle
457}
458
459define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000460; ALL-LABEL: shuffle_v8f64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000461; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000462; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000463; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000464; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000465; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000466; ALL-NEXT: retq
467 %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>
468 ret <8 x double> %shuffle
469}
470
471define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000472; ALL-LABEL: shuffle_v8f64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000473; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000474; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000475; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000476; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000477; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
478; ALL-NEXT: retq
479 %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>
480 ret <8 x double> %shuffle
481}
482
483define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000484; ALL-LABEL: shuffle_v8f64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000485; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000486; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000487; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000488; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000489; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
490; ALL-NEXT: retq
491 %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>
492 ret <8 x double> %shuffle
493}
494
495define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000496; ALL-LABEL: shuffle_v8f64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000497; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000498; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000499; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000500; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000501; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000502; ALL-NEXT: retq
503 %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>
504 ret <8 x double> %shuffle
505}
506
507define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000508; ALL-LABEL: shuffle_v8f64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000509; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000510; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000511; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000512; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000513; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
514; ALL-NEXT: retq
515 %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>
516 ret <8 x double> %shuffle
517}
518
519define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000520; ALL-LABEL: shuffle_v8f64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000521; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000522; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000523; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000524; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000525; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000526; ALL-NEXT: retq
527 %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>
528 ret <8 x double> %shuffle
529}
530
531define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000532; ALL-LABEL: shuffle_v8f64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000533; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000534; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000535; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000536; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000537; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000538; ALL-NEXT: retq
539 %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>
540 ret <8 x double> %shuffle
541}
542
543define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000544; ALL-LABEL: shuffle_v8f64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000545; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000546; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000547; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
548; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000549; ALL-NEXT: retq
550 %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>
551 ret <8 x double> %shuffle
552}
553
554define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000555; ALL-LABEL: shuffle_v8f64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000556; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000557; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000558; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000559; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000560; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
561; ALL-NEXT: retq
562 %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>
563 ret <8 x double> %shuffle
564}
565
566define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000567; ALL-LABEL: shuffle_v8f64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000568; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000569; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000570; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000571; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000572; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000573; ALL-NEXT: retq
574 %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>
575 ret <8 x double> %shuffle
576}
577
578define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000579; ALL-LABEL: shuffle_v8f64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000580; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000581; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000582; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
583; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000584; ALL-NEXT: retq
585 %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>
586 ret <8 x double> %shuffle
587}
588
589define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000590; ALL-LABEL: shuffle_v8f64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000591; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000592; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000593; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
594; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000595; ALL-NEXT: retq
596 %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>
597 ret <8 x double> %shuffle
598}
599
600define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000601; ALL-LABEL: shuffle_v8f64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000602; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000603; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000604; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000605; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
606; ALL-NEXT: retq
607 %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>
608 ret <8 x double> %shuffle
609}
610
611define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000612; ALL-LABEL: shuffle_v8f64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000613; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000614; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000615; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000616; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000617; ALL-NEXT: retq
618 %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>
619 ret <8 x double> %shuffle
620}
621
622define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000623; ALL-LABEL: shuffle_v8f64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000624; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000625; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000626; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000627; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000628; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000629; ALL-NEXT: retq
630 %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>
631 ret <8 x double> %shuffle
632}
633
634define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000635; ALL-LABEL: shuffle_v8f64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000636; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000637; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +0000638; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000639; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000640; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
641; ALL-NEXT: retq
642 %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>
643 ret <8 x double> %shuffle
644}
645
646define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000647; ALL-LABEL: shuffle_v8f64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000648; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000649; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000650; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000651; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
652; ALL-NEXT: retq
653 %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>
654 ret <8 x double> %shuffle
655}
656
657define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000658; ALL-LABEL: shuffle_v8f64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000659; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000660; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000661; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
662; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000663; ALL-NEXT: retq
664 %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>
665 ret <8 x double> %shuffle
666}
667
668define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000669; ALL-LABEL: shuffle_v8f64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000670; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000671; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000672; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000673; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
674; ALL-NEXT: retq
675 %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>
676 ret <8 x double> %shuffle
677}
678
679define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000680; ALL-LABEL: shuffle_v8f64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000681; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000682; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000683; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000684; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000685; ALL-NEXT: retq
686 %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>
687 ret <8 x double> %shuffle
688}
689
690define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000691; ALL-LABEL: shuffle_v8f64_c348cda0:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000692; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000693; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
694; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[0,1],ymm2[0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000695; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000696; ALL-NEXT: vbroadcastsd %xmm1, %ymm4
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000697; ALL-NEXT: vblendpd {{.*#+}} ymm4 = ymm3[0,1,2],ymm4[3]
698; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm4[0],ymm2[1,2],ymm4[3]
699; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm3[0,1],ymm1[2],ymm3[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000700; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000701; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000702; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000703; ALL-NEXT: retq
704 %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>
705 ret <8 x double> %shuffle
706}
707
708define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000709; ALL-LABEL: shuffle_v8f64_f511235a:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000710; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000711; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
712; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
713; ALL-NEXT: vpermpd {{.*#+}} ymm4 = ymm3[0,1,1,3]
714; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1],ymm4[2],ymm2[3]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000715; ALL-NEXT: vpermilpd {{.*#+}} ymm4 = ymm1[0,0,2,2]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000716; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1,2],ymm4[3]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000717; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,1]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000718; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm3[1],ymm0[2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000719; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000720; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthf3e88062014-10-03 22:43:17 +0000721; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000722; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000723; ALL-NEXT: retq
724 %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>
725 ret <8 x double> %shuffle
726}
727
728define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000729; ALL-LABEL: shuffle_v8i64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000730; ALL: # BB#0:
Robert Khasanovdd09a8f2014-10-28 12:28:51 +0000731; ALL-NEXT: vpbroadcastq %xmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000732; ALL-NEXT: retq
733 %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>
734 ret <8 x i64> %shuffle
735}
736
737define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000738; ALL-LABEL: shuffle_v8i64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000739; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000740; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000741; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000742; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000743; ALL-NEXT: retq
744 %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>
745 ret <8 x i64> %shuffle
746}
747
748define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000749; ALL-LABEL: shuffle_v8i64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000750; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000751; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000752; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000753; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000754; ALL-NEXT: retq
755 %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>
756 ret <8 x i64> %shuffle
757}
758
759define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000760; ALL-LABEL: shuffle_v8i64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000761; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000762; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000763; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000764; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
765; ALL-NEXT: retq
766 %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>
767 ret <8 x i64> %shuffle
768}
769
770define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000771; ALL-LABEL: shuffle_v8i64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000772; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000773; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000774; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
775; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
776; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000777; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
778; ALL-NEXT: retq
779 %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>
780 ret <8 x i64> %shuffle
781}
782
783define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000784; ALL-LABEL: shuffle_v8i64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000785; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000786; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000787; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000788; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
789; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000790; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
791; ALL-NEXT: retq
792 %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>
793 ret <8 x i64> %shuffle
794}
795
796define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000797; ALL-LABEL: shuffle_v8i64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000798; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000799; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000800; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000801; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
802; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000803; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
804; ALL-NEXT: retq
805 %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>
806 ret <8 x i64> %shuffle
807}
808
809define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000810; ALL-LABEL: shuffle_v8i64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000811; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000812; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000813; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000814; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000815; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm0[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000816; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
817; ALL-NEXT: retq
818 %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>
819 ret <8 x i64> %shuffle
820}
821
822define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000823; ALL-LABEL: shuffle_v8i64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000824; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000825; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
826; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1
827; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
828; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000829; ALL-NEXT: retq
830 %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>
831 ret <8 x i64> %shuffle
832}
833
834define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000835; ALL-LABEL: shuffle_v8i64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000836; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000837; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,1,1]
838; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000839; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000840; ALL-NEXT: retq
841 %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>
842 ret <8 x i64> %shuffle
843}
844
845define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000846; ALL-LABEL: shuffle_v8i64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000847; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000848; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000849; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000850; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
851; ALL-NEXT: retq
852 %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>
853 ret <8 x i64> %shuffle
854}
855
856define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000857; ALL-LABEL: shuffle_v8i64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000858; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000859; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
860; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000861; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
862; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000863; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
864; ALL-NEXT: retq
865 %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>
866 ret <8 x i64> %shuffle
867}
868
869define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000870; ALL-LABEL: shuffle_v8i64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000871; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000872; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000873; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000874; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000875; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
876; ALL-NEXT: retq
877 %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>
878 ret <8 x i64> %shuffle
879}
880
881define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000882; ALL-LABEL: shuffle_v8i64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000883; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000884; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
885; ALL-NEXT: vinserti128 $1, %xmm2, %ymm2, %ymm2
886; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000887; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000888; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3],ymm2[4,5],ymm3[6,7]
889; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000890; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000891; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000892; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
893; ALL-NEXT: retq
894 %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>
895 ret <8 x i64> %shuffle
896}
897
898define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000899; ALL-LABEL: shuffle_v8i64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000900; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000901; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
902; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000903; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000904; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000905; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000906; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000907; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
908; ALL-NEXT: retq
909 %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>
910 ret <8 x i64> %shuffle
911}
912
913define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000914; ALL-LABEL: shuffle_v8i64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000915; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000916; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000917; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +0000918; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000919; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
920; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
921; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
922; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
923; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000924; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
925; ALL-NEXT: retq
926 %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>
927 ret <8 x i64> %shuffle
928}
929
930define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000931; ALL-LABEL: shuffle_v8i64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000932; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000933; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000934; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000935; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000936; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
937; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
938; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,0]
939; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
940; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000941; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
942; ALL-NEXT: retq
943 %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>
944 ret <8 x i64> %shuffle
945}
946
947define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000948; ALL-LABEL: shuffle_v8i64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000949; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000950; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000951; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000952; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000953; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,1,1,3]
954; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
955; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
956; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
957; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000958; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
959; ALL-NEXT: retq
960 %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>
961 ret <8 x i64> %shuffle
962}
963
964define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000965; ALL-LABEL: shuffle_v8i64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000966; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000967; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000968; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000969; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000970; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[2,1,3,3]
971; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
972; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
973; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,3,3]
974; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000975; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
976; ALL-NEXT: retq
977 %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>
978 ret <8 x i64> %shuffle
979}
980
981define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000982; ALL-LABEL: shuffle_v8i64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000983; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000984; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,2,2,3]
985; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
986; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
987; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
988; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
989; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000990; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
991; ALL-NEXT: retq
992 %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>
993 ret <8 x i64> %shuffle
994}
995
996define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000997; ALL-LABEL: shuffle_v8i64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000998; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000999; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm0[2,3,2,3,6,7,6,7]
1000; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm1[0,2,3,3]
1001; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3,4,5,6,7]
1002; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,1,1]
1003; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001004; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1005; ALL-NEXT: retq
1006 %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>
1007 ret <8 x i64> %shuffle
1008}
1009
1010define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001011; ALL-LABEL: shuffle_v8i64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001012; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001013; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001014; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
1015; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
1016; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1017; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001018; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1019; ALL-NEXT: retq
1020 %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>
1021 ret <8 x i64> %shuffle
1022}
1023
1024define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001025; ALL-LABEL: shuffle_v8i64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001026; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001027; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001028; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm0[2,3,2,3,6,7,6,7]
1029; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7]
1030; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001031; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1032; ALL-NEXT: retq
1033 %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>
1034 ret <8 x i64> %shuffle
1035}
1036
1037define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001038; ALL-LABEL: shuffle_v8i64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001039; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001040; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001041; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001042; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001043; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001044; ALL-NEXT: retq
1045 %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>
1046 ret <8 x i64> %shuffle
1047}
1048
1049define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001050; ALL-LABEL: shuffle_v8i64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001051; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001052; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001053; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001054; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001055; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001056; ALL-NEXT: retq
1057 %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>
1058 ret <8 x i64> %shuffle
1059}
1060
1061define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001062; ALL-LABEL: shuffle_v8i64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001063; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001064; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001065; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001066; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001067; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001068; ALL-NEXT: retq
1069 %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>
1070 ret <8 x i64> %shuffle
1071}
1072
1073define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001074; ALL-LABEL: shuffle_v8i64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001075; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001076; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001077; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001078; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001079; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001080; ALL-NEXT: retq
1081 %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>
1082 ret <8 x i64> %shuffle
1083}
1084
1085define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001086; ALL-LABEL: shuffle_v8i64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001087; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001088; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001089; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001090; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001091; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001092; ALL-NEXT: retq
1093 %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>
1094 ret <8 x i64> %shuffle
1095}
1096
1097define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001098; ALL-LABEL: shuffle_v8i64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001099; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001100; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001101; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001102; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001103; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001104; ALL-NEXT: retq
1105 %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>
1106 ret <8 x i64> %shuffle
1107}
1108
1109define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001110; ALL-LABEL: shuffle_v8i64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001111; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001112; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001113; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001114; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001115; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001116; ALL-NEXT: retq
1117 %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>
1118 ret <8 x i64> %shuffle
1119}
1120
1121define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001122; ALL-LABEL: shuffle_v8i64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001123; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001124; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001125; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001126; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001127; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001128; ALL-NEXT: retq
1129 %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>
1130 ret <8 x i64> %shuffle
1131}
1132
1133define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001134; ALL-LABEL: shuffle_v8i64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001135; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001136; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001137; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001138; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001139; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001140; ALL-NEXT: retq
1141 %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>
1142 ret <8 x i64> %shuffle
1143}
1144
1145define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001146; ALL-LABEL: shuffle_v8i64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001147; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001148; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001149; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001150; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001151; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001152; ALL-NEXT: retq
1153 %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>
1154 ret <8 x i64> %shuffle
1155}
1156
1157define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001158; ALL-LABEL: shuffle_v8i64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001159; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001160; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001161; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001162; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001163; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001164; ALL-NEXT: retq
1165 %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>
1166 ret <8 x i64> %shuffle
1167}
1168
1169define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001170; ALL-LABEL: shuffle_v8i64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001171; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001172; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001173; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001174; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001175; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001176; ALL-NEXT: retq
1177 %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>
1178 ret <8 x i64> %shuffle
1179}
1180
1181define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001182; ALL-LABEL: shuffle_v8i64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001183; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001184; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001185; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001186; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001187; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001188; ALL-NEXT: retq
1189 %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>
1190 ret <8 x i64> %shuffle
1191}
1192
1193define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001194; ALL-LABEL: shuffle_v8i64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001195; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001196; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001197; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001198; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001199; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1200; ALL-NEXT: retq
1201 %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>
1202 ret <8 x i64> %shuffle
1203}
1204
1205define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001206; ALL-LABEL: shuffle_v8i64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001207; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001208; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001209; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001210; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001211; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1212; ALL-NEXT: retq
1213 %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>
1214 ret <8 x i64> %shuffle
1215}
1216
1217define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001218; ALL-LABEL: shuffle_v8i64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001219; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001220; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001221; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001222; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001223; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001224; ALL-NEXT: retq
1225 %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>
1226 ret <8 x i64> %shuffle
1227}
1228
1229define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001230; ALL-LABEL: shuffle_v8i64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001231; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001232; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001233; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001234; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001235; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1236; ALL-NEXT: retq
1237 %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>
1238 ret <8 x i64> %shuffle
1239}
1240
1241define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001242; ALL-LABEL: shuffle_v8i64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001243; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001244; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001245; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001246; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001247; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001248; ALL-NEXT: retq
1249 %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>
1250 ret <8 x i64> %shuffle
1251}
1252
1253define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001254; ALL-LABEL: shuffle_v8i64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001255; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001256; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001257; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001258; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001259; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001260; ALL-NEXT: retq
1261 %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>
1262 ret <8 x i64> %shuffle
1263}
1264
1265define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001266; ALL-LABEL: shuffle_v8i64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001267; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001268; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001269; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1270; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001271; ALL-NEXT: retq
1272 %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>
1273 ret <8 x i64> %shuffle
1274}
1275
1276define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001277; ALL-LABEL: shuffle_v8i64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001278; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001279; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001280; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001281; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001282; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1283; ALL-NEXT: retq
1284 %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>
1285 ret <8 x i64> %shuffle
1286}
1287
1288define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001289; ALL-LABEL: shuffle_v8i64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001290; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001291; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001292; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001293; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001294; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001295; ALL-NEXT: retq
1296 %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>
1297 ret <8 x i64> %shuffle
1298}
1299
1300define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001301; ALL-LABEL: shuffle_v8i64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001302; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001303; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001304; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1305; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001306; ALL-NEXT: retq
1307 %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>
1308 ret <8 x i64> %shuffle
1309}
1310
1311define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001312; ALL-LABEL: shuffle_v8i64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001313; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001314; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001315; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1316; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001317; ALL-NEXT: retq
1318 %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>
1319 ret <8 x i64> %shuffle
1320}
1321
1322define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001323; ALL-LABEL: shuffle_v8i64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001324; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001325; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001326; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001327; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1328; ALL-NEXT: retq
1329 %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>
1330 ret <8 x i64> %shuffle
1331}
1332
1333define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001334; ALL-LABEL: shuffle_v8i64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001335; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001336; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001337; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001338; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001339; ALL-NEXT: retq
1340 %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>
1341 ret <8 x i64> %shuffle
1342}
1343
1344define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001345; ALL-LABEL: shuffle_v8i64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001346; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001347; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001348; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001349; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001350; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001351; ALL-NEXT: retq
1352 %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>
1353 ret <8 x i64> %shuffle
1354}
1355
1356define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001357; ALL-LABEL: shuffle_v8i64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001358; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001359; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +00001360; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001361; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001362; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1363; ALL-NEXT: retq
1364 %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>
1365 ret <8 x i64> %shuffle
1366}
1367
1368define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001369; ALL-LABEL: shuffle_v8i64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001370; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001371; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001372; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001373; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1374; ALL-NEXT: retq
1375 %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>
1376 ret <8 x i64> %shuffle
1377}
1378
1379define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001380; ALL-LABEL: shuffle_v8i64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001381; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001382; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001383; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1384; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001385; ALL-NEXT: retq
1386 %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>
1387 ret <8 x i64> %shuffle
1388}
1389
1390define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001391; ALL-LABEL: shuffle_v8i64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001392; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001393; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001394; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001395; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1396; ALL-NEXT: retq
1397 %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>
1398 ret <8 x i64> %shuffle
1399}
1400
1401define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001402; ALL-LABEL: shuffle_v8i64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001403; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001404; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001405; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001406; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001407; ALL-NEXT: retq
1408 %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>
1409 ret <8 x i64> %shuffle
1410}
1411
1412define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001413; ALL-LABEL: shuffle_v8i64_6caa87e5:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001414; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001415; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001416; ALL-NEXT: vperm2i128 {{.*#+}} ymm2 = ymm0[0,1,0,1]
1417; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
1418; ALL-NEXT: vpblendd {{.*#+}} ymm4 = ymm1[0,1,2,3],ymm3[4,5],ymm1[6,7]
1419; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm4[0,1],ymm2[2,3],ymm4[4,5],ymm2[6,7]
1420; ALL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001421; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001422; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
1423; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm3[2,3],ymm1[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001424; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001425; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001426; ALL-NEXT: retq
1427 %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>
1428 ret <8 x i64> %shuffle
1429}