blob: 20cbbaef17eb7e126c07754a1bc33e3fd1f04205 [file] [log] [blame]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512f -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512F
2; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512bw -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512BW
3
4target triple = "x86_64-unknown-unknown"
5
6define <8 x double> @shuffle_v8f64_00000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00007; ALL-LABEL: shuffle_v8f64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +00008; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +0000103; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000104; 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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthbb525e32015-02-04 10:46:53 +0000162; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000163; ALL-NEXT: vinsertf128 $1, %xmm2, %ymm2, %ymm2
Chandler Carruthbb525e32015-02-04 10:46:53 +0000164; 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 Carruthbb525e32015-02-04 10:46:53 +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 Carruthce5a26b2014-11-21 14:53:03 +0000194; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm1[0,1],ymm0[2,3]
195; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm2[1,0,3,2]
196; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
197; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000198; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000199; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
200; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000201; ALL-NEXT: retq
202 %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>
203 ret <8 x double> %shuffle
204}
205
206define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000207; ALL-LABEL: shuffle_v8f64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000208; ALL: # BB#0:
Chandler Carruthd2b19bc2014-11-21 13:56:05 +0000209; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm2
210; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm2[1,0,3,2]
211; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
212; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
213; ALL-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
214; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
215; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000216; ALL-NEXT: retq
217 %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>
218 ret <8 x double> %shuffle
219}
220
221define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000222; ALL-LABEL: shuffle_v8f64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000223; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000224; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000225; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000226; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000227; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[0,1,1,3]
228; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
229; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
230; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
231; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000232; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
233; ALL-NEXT: retq
234 %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>
235 ret <8 x double> %shuffle
236}
237
238define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000239; ALL-LABEL: shuffle_v8f64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000240; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000241; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000242; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000243; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000244; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[2,1,3,3]
245; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
246; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
247; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,3]
248; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000249; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
250; ALL-NEXT: retq
251 %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>
252 ret <8 x double> %shuffle
253}
254
255define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000256; ALL-LABEL: shuffle_v8f64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000257; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000258; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm1[0,2,2,3]
259; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
260; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
261; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
262; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
263; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000264; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
265; ALL-NEXT: retq
266 %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>
267 ret <8 x double> %shuffle
268}
269
270define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000271; ALL-LABEL: shuffle_v8f64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000272; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000273; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm0[1,0,2,2]
274; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm1[0,2,3,3]
275; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1,2,3]
276; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,1]
277; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
278; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000279; ALL-NEXT: retq
280 %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>
281 ret <8 x double> %shuffle
282}
283
284define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000285; ALL-LABEL: shuffle_v8f64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000286; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000287; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000288; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
289; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
290; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
291; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000292; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
293; ALL-NEXT: retq
294 %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>
295 ret <8 x double> %shuffle
296}
297
298define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000299; ALL-LABEL: shuffle_v8f64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000300; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000301; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carruthf3e88062014-10-03 22:43:17 +0000302; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm0[1,0,2,2]
303; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1,2,3]
304; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
305; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000306; ALL-NEXT: retq
307 %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>
308 ret <8 x double> %shuffle
309}
310
311define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000312; ALL-LABEL: shuffle_v8f64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000313; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000314; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000315; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000316; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000317; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000318; ALL-NEXT: retq
319 %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>
320 ret <8 x double> %shuffle
321}
322
323define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000324; ALL-LABEL: shuffle_v8f64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000325; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000326; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000327; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000328; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000329; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000330; ALL-NEXT: retq
331 %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>
332 ret <8 x double> %shuffle
333}
334
335define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000336; ALL-LABEL: shuffle_v8f64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000337; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000338; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000339; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000340; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000341; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000342; ALL-NEXT: retq
343 %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>
344 ret <8 x double> %shuffle
345}
346
347define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000348; ALL-LABEL: shuffle_v8f64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000349; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000350; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000351; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000352; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000353; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000354; ALL-NEXT: retq
355 %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>
356 ret <8 x double> %shuffle
357}
358
359define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000360; ALL-LABEL: shuffle_v8f64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000361; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000362; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000363; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000364; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000365; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000366; ALL-NEXT: retq
367 %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>
368 ret <8 x double> %shuffle
369}
370
371define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000372; ALL-LABEL: shuffle_v8f64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000373; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000374; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000375; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000376; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000377; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000378; ALL-NEXT: retq
379 %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>
380 ret <8 x double> %shuffle
381}
382
383define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000384; ALL-LABEL: shuffle_v8f64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000385; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000386; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000387; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000388; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000389; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000390; ALL-NEXT: retq
391 %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>
392 ret <8 x double> %shuffle
393}
394
395define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000396; ALL-LABEL: shuffle_v8f64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000397; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000398; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000399; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000400; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000401; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000402; ALL-NEXT: retq
403 %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>
404 ret <8 x double> %shuffle
405}
406
Chandler Carruthbb525e32015-02-04 10:46:53 +0000407define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) {
408; ALL-LABEL: shuffle_v8f64_00224466:
409; ALL: # BB#0:
410; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
411; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
412; ALL-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
413; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
414; ALL-NEXT: retq
415 %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>
Chandler Carruth24e3b692014-09-28 23:53:10 +0000416 ret <8 x double> %shuffle
417}
418
419define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000420; ALL-LABEL: shuffle_v8f64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000421; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000422; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000423; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000424; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000425; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000426; ALL-NEXT: retq
427 %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>
428 ret <8 x double> %shuffle
429}
430
431define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000432; ALL-LABEL: shuffle_v8f64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000433; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000434; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000435; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000436; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000437; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000438; ALL-NEXT: retq
439 %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>
440 ret <8 x double> %shuffle
441}
442
443define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000444; ALL-LABEL: shuffle_v8f64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000445; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000446; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000447; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000448; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000449; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000450; ALL-NEXT: retq
451 %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>
452 ret <8 x double> %shuffle
453}
454
455define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000456; ALL-LABEL: shuffle_v8f64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000457; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000458; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000459; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000460; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000461; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000462; ALL-NEXT: retq
463 %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>
464 ret <8 x double> %shuffle
465}
466
467define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000468; ALL-LABEL: shuffle_v8f64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000469; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000470; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000471; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000472; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000473; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
474; ALL-NEXT: retq
475 %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>
476 ret <8 x double> %shuffle
477}
478
479define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000480; ALL-LABEL: shuffle_v8f64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000481; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000482; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000483; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000484; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000485; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
486; ALL-NEXT: retq
487 %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>
488 ret <8 x double> %shuffle
489}
490
491define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000492; ALL-LABEL: shuffle_v8f64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000493; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000494; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000495; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000496; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000497; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000498; ALL-NEXT: retq
499 %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>
500 ret <8 x double> %shuffle
501}
502
503define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000504; ALL-LABEL: shuffle_v8f64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000505; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000506; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000507; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000508; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000509; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
510; ALL-NEXT: retq
511 %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>
512 ret <8 x double> %shuffle
513}
514
515define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000516; ALL-LABEL: shuffle_v8f64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000517; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000518; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000519; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000520; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000521; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000522; ALL-NEXT: retq
523 %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>
524 ret <8 x double> %shuffle
525}
526
527define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000528; ALL-LABEL: shuffle_v8f64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000529; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000530; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000531; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000532; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000533; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000534; ALL-NEXT: retq
535 %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>
536 ret <8 x double> %shuffle
537}
538
539define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000540; ALL-LABEL: shuffle_v8f64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000541; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000542; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000543; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000544; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000545; ALL-NEXT: retq
546 %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>
547 ret <8 x double> %shuffle
548}
549
550define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000551; ALL-LABEL: shuffle_v8f64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000552; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000553; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000554; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000555; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000556; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
557; ALL-NEXT: retq
558 %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>
559 ret <8 x double> %shuffle
560}
561
Chandler Carruthbb525e32015-02-04 10:46:53 +0000562define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) {
563; ALL-LABEL: shuffle_v8f64_00226644:
564; ALL: # BB#0:
565; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
566; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
567; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
568; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000569; ALL-NEXT: retq
570 %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>
571 ret <8 x double> %shuffle
572}
573
574define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000575; ALL-LABEL: shuffle_v8f64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000576; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000577; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000578; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000579; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000580; ALL-NEXT: retq
581 %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>
582 ret <8 x double> %shuffle
583}
584
585define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000586; ALL-LABEL: shuffle_v8f64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000587; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000588; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000589; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000590; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000591; ALL-NEXT: retq
592 %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>
593 ret <8 x double> %shuffle
594}
595
596define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000597; ALL-LABEL: shuffle_v8f64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000598; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000599; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000600; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000601; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
602; ALL-NEXT: retq
603 %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>
604 ret <8 x double> %shuffle
605}
606
607define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000608; ALL-LABEL: shuffle_v8f64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000609; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000610; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000611; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000612; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000613; ALL-NEXT: retq
614 %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>
615 ret <8 x double> %shuffle
616}
617
Chandler Carruthbb525e32015-02-04 10:46:53 +0000618define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) {
619; ALL-LABEL: shuffle_v8f64_002u6u44:
620; ALL: # BB#0:
621; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
622; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
623; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,0,0]
624; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000625; ALL-NEXT: retq
626 %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>
627 ret <8 x double> %shuffle
628}
629
630define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000631; ALL-LABEL: shuffle_v8f64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000632; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000633; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carruthbb525e32015-02-04 10:46:53 +0000634; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000635; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000636; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
637; ALL-NEXT: retq
638 %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>
639 ret <8 x double> %shuffle
640}
641
642define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000643; ALL-LABEL: shuffle_v8f64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000644; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000645; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000646; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000647; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
648; ALL-NEXT: retq
649 %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>
650 ret <8 x double> %shuffle
651}
652
653define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000654; ALL-LABEL: shuffle_v8f64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000655; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000656; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000657; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000658; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000659; ALL-NEXT: retq
660 %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>
661 ret <8 x double> %shuffle
662}
663
664define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000665; ALL-LABEL: shuffle_v8f64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000666; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000667; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000668; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000669; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
670; ALL-NEXT: retq
671 %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>
672 ret <8 x double> %shuffle
673}
674
675define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) {
Chandler Carruthbb525e32015-02-04 10:46:53 +0000676; ALL-LABEL: shuffle_v8f64_uuu3uu66:
677; ALL: # BB#0:
678; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
679; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm1[0,0,2,2]
680; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
681; ALL-NEXT: retq
682 %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>
Chandler Carruth24e3b692014-09-28 23:53:10 +0000683 ret <8 x double> %shuffle
684}
685
686define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000687; ALL-LABEL: shuffle_v8f64_c348cda0:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000688; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000689; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000690; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[0,1],ymm2[0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000691; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000692; ALL-NEXT: vbroadcastsd %xmm1, %ymm4
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000693; ALL-NEXT: vblendpd {{.*#+}} ymm4 = ymm3[0,1,2],ymm4[3]
694; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm4[0],ymm2[1,2],ymm4[3]
695; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm3[0,1],ymm1[2],ymm3[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000696; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000697; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000698; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000699; ALL-NEXT: retq
700 %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>
701 ret <8 x double> %shuffle
702}
703
704define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000705; ALL-LABEL: shuffle_v8f64_f511235a:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000706; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000707; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[2,3,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000708; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
709; ALL-NEXT: vpermpd {{.*#+}} ymm4 = ymm3[0,1,1,3]
710; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1],ymm4[2],ymm2[3]
711; ALL-NEXT: vmovddup {{.*#+}} ymm4 = ymm1[0,0,2,2]
712; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1,2],ymm4[3]
713; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,1]
714; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm3[1],ymm0[2,3]
715; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000716; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthf3e88062014-10-03 22:43:17 +0000717; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000718; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000719; ALL-NEXT: retq
720 %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>
721 ret <8 x double> %shuffle
722}
723
724define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000725; ALL-LABEL: shuffle_v8i64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000726; ALL: # BB#0:
Robert Khasanovdd09a8f2014-10-28 12:28:51 +0000727; ALL-NEXT: vpbroadcastq %xmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000728; ALL-NEXT: retq
729 %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>
730 ret <8 x i64> %shuffle
731}
732
733define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000734; ALL-LABEL: shuffle_v8i64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000735; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000736; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000737; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000738; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000739; ALL-NEXT: retq
740 %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>
741 ret <8 x i64> %shuffle
742}
743
744define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000745; ALL-LABEL: shuffle_v8i64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000746; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000747; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000748; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000749; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000750; ALL-NEXT: retq
751 %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>
752 ret <8 x i64> %shuffle
753}
754
755define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000756; ALL-LABEL: shuffle_v8i64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000757; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000758; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000759; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000760; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
761; ALL-NEXT: retq
762 %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>
763 ret <8 x i64> %shuffle
764}
765
766define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000767; ALL-LABEL: shuffle_v8i64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000768; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000769; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000770; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
771; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
772; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000773; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
774; ALL-NEXT: retq
775 %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>
776 ret <8 x i64> %shuffle
777}
778
779define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000780; ALL-LABEL: shuffle_v8i64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000781; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000782; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000783; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000784; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
785; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000786; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
787; ALL-NEXT: retq
788 %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>
789 ret <8 x i64> %shuffle
790}
791
792define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000793; ALL-LABEL: shuffle_v8i64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000794; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000795; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000796; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000797; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
798; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000799; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
800; ALL-NEXT: retq
801 %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>
802 ret <8 x i64> %shuffle
803}
804
805define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000806; ALL-LABEL: shuffle_v8i64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000807; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000808; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000809; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000810; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000811; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm0[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000812; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
813; ALL-NEXT: retq
814 %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>
815 ret <8 x i64> %shuffle
816}
817
818define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000819; ALL-LABEL: shuffle_v8i64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000820; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000821; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000822; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1
823; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
824; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000825; ALL-NEXT: retq
826 %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>
827 ret <8 x i64> %shuffle
828}
829
830define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000831; ALL-LABEL: shuffle_v8i64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000832; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000833; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,1,1]
834; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000835; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000836; ALL-NEXT: retq
837 %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>
838 ret <8 x i64> %shuffle
839}
840
841define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000842; ALL-LABEL: shuffle_v8i64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000843; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000844; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000845; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000846; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
847; ALL-NEXT: retq
848 %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>
849 ret <8 x i64> %shuffle
850}
851
852define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000853; ALL-LABEL: shuffle_v8i64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000854; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000855; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
856; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000857; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
858; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000859; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
860; ALL-NEXT: retq
861 %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>
862 ret <8 x i64> %shuffle
863}
864
865define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000866; ALL-LABEL: shuffle_v8i64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000867; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000868; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000869; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000870; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000871; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
872; ALL-NEXT: retq
873 %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>
874 ret <8 x i64> %shuffle
875}
876
877define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000878; ALL-LABEL: shuffle_v8i64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000879; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000880; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000881; ALL-NEXT: vinserti128 $1, %xmm2, %ymm2, %ymm2
Chandler Carruthbb525e32015-02-04 10:46:53 +0000882; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000883; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000884; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3],ymm2[4,5],ymm3[6,7]
885; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000886; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000887; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000888; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
889; ALL-NEXT: retq
890 %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>
891 ret <8 x i64> %shuffle
892}
893
894define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000895; ALL-LABEL: shuffle_v8i64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000896; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000897; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
898; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000899; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000900; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000901; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000902; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000903; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
904; ALL-NEXT: retq
905 %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>
906 ret <8 x i64> %shuffle
907}
908
909define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000910; ALL-LABEL: shuffle_v8i64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000911; ALL: # BB#0:
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000912; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000913; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000914; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
915; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000916; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000917; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
918; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000919; ALL-NEXT: retq
920 %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>
921 ret <8 x i64> %shuffle
922}
923
924define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000925; ALL-LABEL: shuffle_v8i64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000926; ALL: # BB#0:
Chandler Carruthd2b19bc2014-11-21 13:56:05 +0000927; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm2
928; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
929; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
930; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
931; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
932; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
933; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000934; ALL-NEXT: retq
935 %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>
936 ret <8 x i64> %shuffle
937}
938
939define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000940; ALL-LABEL: shuffle_v8i64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000941; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000942; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000943; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000944; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000945; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,1,1,3]
946; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
947; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
948; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
949; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000950; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
951; ALL-NEXT: retq
952 %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>
953 ret <8 x i64> %shuffle
954}
955
956define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000957; ALL-LABEL: shuffle_v8i64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000958; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000959; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000960; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000961; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000962; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[2,1,3,3]
963; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
964; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
965; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,3,3]
966; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000967; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
968; ALL-NEXT: retq
969 %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>
970 ret <8 x i64> %shuffle
971}
972
973define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000974; ALL-LABEL: shuffle_v8i64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000975; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000976; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,2,2,3]
977; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
978; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
979; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
980; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
981; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000982; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
983; ALL-NEXT: retq
984 %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>
985 ret <8 x i64> %shuffle
986}
987
988define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000989; ALL-LABEL: shuffle_v8i64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000990; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000991; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm0[2,3,2,3,6,7,6,7]
992; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm1[0,2,3,3]
993; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3,4,5,6,7]
994; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,1,1]
995; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000996; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
997; ALL-NEXT: retq
998 %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>
999 ret <8 x i64> %shuffle
1000}
1001
1002define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001003; ALL-LABEL: shuffle_v8i64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001004; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001005; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001006; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
1007; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
1008; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1009; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001010; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1011; ALL-NEXT: retq
1012 %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>
1013 ret <8 x i64> %shuffle
1014}
1015
1016define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001017; ALL-LABEL: shuffle_v8i64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001018; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001019; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001020; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm0[2,3,2,3,6,7,6,7]
1021; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7]
1022; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001023; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1024; ALL-NEXT: retq
1025 %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>
1026 ret <8 x i64> %shuffle
1027}
1028
1029define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001030; ALL-LABEL: shuffle_v8i64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001031; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001032; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001033; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001034; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001035; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001036; ALL-NEXT: retq
1037 %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>
1038 ret <8 x i64> %shuffle
1039}
1040
1041define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001042; ALL-LABEL: shuffle_v8i64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001043; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001044; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001045; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001046; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001047; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001048; ALL-NEXT: retq
1049 %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>
1050 ret <8 x i64> %shuffle
1051}
1052
1053define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001054; ALL-LABEL: shuffle_v8i64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001055; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001056; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001057; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001058; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001059; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001060; ALL-NEXT: retq
1061 %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>
1062 ret <8 x i64> %shuffle
1063}
1064
1065define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001066; ALL-LABEL: shuffle_v8i64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001067; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001068; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001069; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001070; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001071; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001072; ALL-NEXT: retq
1073 %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>
1074 ret <8 x i64> %shuffle
1075}
1076
1077define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001078; ALL-LABEL: shuffle_v8i64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001079; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001080; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001081; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001082; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001083; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001084; ALL-NEXT: retq
1085 %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>
1086 ret <8 x i64> %shuffle
1087}
1088
1089define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001090; ALL-LABEL: shuffle_v8i64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001091; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001092; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001093; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001094; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001095; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001096; ALL-NEXT: retq
1097 %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>
1098 ret <8 x i64> %shuffle
1099}
1100
1101define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001102; ALL-LABEL: shuffle_v8i64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001103; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001104; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001105; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001106; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001107; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001108; ALL-NEXT: retq
1109 %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>
1110 ret <8 x i64> %shuffle
1111}
1112
1113define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001114; ALL-LABEL: shuffle_v8i64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001115; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001116; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001117; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001118; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001119; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001120; ALL-NEXT: retq
1121 %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>
1122 ret <8 x i64> %shuffle
1123}
1124
1125define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001126; ALL-LABEL: shuffle_v8i64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001127; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001128; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001129; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001130; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001131; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001132; ALL-NEXT: retq
1133 %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>
1134 ret <8 x i64> %shuffle
1135}
1136
1137define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001138; ALL-LABEL: shuffle_v8i64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001139; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001140; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001141; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001142; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001143; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001144; ALL-NEXT: retq
1145 %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>
1146 ret <8 x i64> %shuffle
1147}
1148
1149define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001150; ALL-LABEL: shuffle_v8i64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001151; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001152; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001153; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001154; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001155; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001156; ALL-NEXT: retq
1157 %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>
1158 ret <8 x i64> %shuffle
1159}
1160
1161define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001162; ALL-LABEL: shuffle_v8i64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001163; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001164; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001165; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001166; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001167; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001168; ALL-NEXT: retq
1169 %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>
1170 ret <8 x i64> %shuffle
1171}
1172
1173define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001174; ALL-LABEL: shuffle_v8i64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001175; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001176; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001177; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001178; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001179; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001180; ALL-NEXT: retq
1181 %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>
1182 ret <8 x i64> %shuffle
1183}
1184
1185define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001186; ALL-LABEL: shuffle_v8i64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001187; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001188; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001189; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001190; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001191; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1192; ALL-NEXT: retq
1193 %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>
1194 ret <8 x i64> %shuffle
1195}
1196
1197define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001198; ALL-LABEL: shuffle_v8i64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001199; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001200; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001201; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001202; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001203; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1204; ALL-NEXT: retq
1205 %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>
1206 ret <8 x i64> %shuffle
1207}
1208
1209define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001210; ALL-LABEL: shuffle_v8i64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001211; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001212; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001213; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001214; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001215; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001216; ALL-NEXT: retq
1217 %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>
1218 ret <8 x i64> %shuffle
1219}
1220
1221define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001222; ALL-LABEL: shuffle_v8i64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001223; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001224; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001225; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001226; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001227; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1228; ALL-NEXT: retq
1229 %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>
1230 ret <8 x i64> %shuffle
1231}
1232
1233define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001234; ALL-LABEL: shuffle_v8i64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001235; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001236; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001237; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001238; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001239; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001240; ALL-NEXT: retq
1241 %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>
1242 ret <8 x i64> %shuffle
1243}
1244
1245define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001246; ALL-LABEL: shuffle_v8i64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001247; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001248; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001249; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001250; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001251; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001252; ALL-NEXT: retq
1253 %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>
1254 ret <8 x i64> %shuffle
1255}
1256
1257define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001258; ALL-LABEL: shuffle_v8i64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001259; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001260; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001261; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001262; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001263; ALL-NEXT: retq
1264 %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>
1265 ret <8 x i64> %shuffle
1266}
1267
1268define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001269; ALL-LABEL: shuffle_v8i64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001270; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001271; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001272; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001273; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001274; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1275; ALL-NEXT: retq
1276 %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>
1277 ret <8 x i64> %shuffle
1278}
1279
1280define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001281; ALL-LABEL: shuffle_v8i64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001282; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001283; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001284; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001285; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001286; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001287; ALL-NEXT: retq
1288 %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>
1289 ret <8 x i64> %shuffle
1290}
1291
1292define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001293; ALL-LABEL: shuffle_v8i64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001294; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001295; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001296; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001297; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001298; ALL-NEXT: retq
1299 %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>
1300 ret <8 x i64> %shuffle
1301}
1302
1303define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001304; ALL-LABEL: shuffle_v8i64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001305; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001306; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001307; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001308; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001309; ALL-NEXT: retq
1310 %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>
1311 ret <8 x i64> %shuffle
1312}
1313
1314define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001315; ALL-LABEL: shuffle_v8i64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001316; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001317; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001318; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001319; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1320; ALL-NEXT: retq
1321 %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>
1322 ret <8 x i64> %shuffle
1323}
1324
1325define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001326; ALL-LABEL: shuffle_v8i64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001327; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001328; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001329; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001330; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001331; ALL-NEXT: retq
1332 %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>
1333 ret <8 x i64> %shuffle
1334}
1335
1336define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001337; ALL-LABEL: shuffle_v8i64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001338; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001339; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001340; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001341; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001342; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001343; ALL-NEXT: retq
1344 %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>
1345 ret <8 x i64> %shuffle
1346}
1347
1348define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001349; ALL-LABEL: shuffle_v8i64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001350; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001351; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carruthbb525e32015-02-04 10:46:53 +00001352; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001353; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001354; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1355; ALL-NEXT: retq
1356 %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>
1357 ret <8 x i64> %shuffle
1358}
1359
1360define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001361; ALL-LABEL: shuffle_v8i64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001362; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001363; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001364; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001365; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1366; ALL-NEXT: retq
1367 %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>
1368 ret <8 x i64> %shuffle
1369}
1370
1371define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001372; ALL-LABEL: shuffle_v8i64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001373; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001374; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001375; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001376; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001377; ALL-NEXT: retq
1378 %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>
1379 ret <8 x i64> %shuffle
1380}
1381
1382define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001383; ALL-LABEL: shuffle_v8i64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001384; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001385; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001386; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001387; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1388; ALL-NEXT: retq
1389 %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>
1390 ret <8 x i64> %shuffle
1391}
1392
1393define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001394; ALL-LABEL: shuffle_v8i64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001395; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001396; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001397; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001398; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001399; ALL-NEXT: retq
1400 %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>
1401 ret <8 x i64> %shuffle
1402}
1403
1404define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001405; ALL-LABEL: shuffle_v8i64_6caa87e5:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001406; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001407; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001408; ALL-NEXT: vperm2i128 {{.*#+}} ymm2 = ymm0[0,1,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001409; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001410; ALL-NEXT: vpblendd {{.*#+}} ymm4 = ymm1[0,1,2,3],ymm3[4,5],ymm1[6,7]
1411; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm4[0,1],ymm2[2,3],ymm4[4,5],ymm2[6,7]
1412; ALL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
Chandler Carruthce5a26b2014-11-21 14:53:03 +00001413; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm3[0,1,2,3],ymm1[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001414; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001415; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001416; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001417; ALL-NEXT: retq
1418 %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>
1419 ret <8 x i64> %shuffle
1420}
Adam Nemete5dbcb72015-01-13 22:20:18 +00001421
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001422define <8 x double> @shuffle_v8f64_082a4c6e(<8 x double> %a, <8 x double> %b) {
1423; ALL-LABEL: shuffle_v8f64_082a4c6e:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001424; ALL: # BB#0:
1425; ALL-NEXT: vunpcklpd {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[2],zmm1[2],zmm0[4],zmm1[4],zmm0[6],zmm1[6]
1426; ALL-NEXT: retq
1427 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32><i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
1428 ret <8 x double> %shuffle
1429}
1430
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001431define <8 x i64> @shuffle_v8i64_082a4c6e(<8 x i64> %a, <8 x i64> %b) {
1432; ALL-LABEL: shuffle_v8i64_082a4c6e:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001433; ALL: # BB#0:
1434; ALL-NEXT: vpunpcklqdq {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[2],zmm1[2],zmm0[4],zmm1[4],zmm0[6],zmm1[6]
1435; ALL-NEXT: retq
1436 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32><i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>
1437 ret <8 x i64> %shuffle
1438}
1439
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001440define <8 x double> @shuffle_v8f64_193b5d7f(<8 x double> %a, <8 x double> %b) {
1441; ALL-LABEL: shuffle_v8f64_193b5d7f:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001442; ALL: # BB#0:
1443; ALL-NEXT: vunpckhpd {{.*#+}} zmm0 = zmm0[1],zmm1[1],zmm0[3],zmm1[3],zmm0[5],zmm1[5],zmm0[7],zmm1[7]
1444; ALL-NEXT: retq
1445 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32><i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
1446 ret <8 x double> %shuffle
1447}
1448
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001449define <8 x i64> @shuffle_v8i64_193b5d7f(<8 x i64> %a, <8 x i64> %b) {
1450; ALL-LABEL: shuffle_v8i64_193b5d7f:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001451; ALL: # BB#0:
1452; ALL-NEXT: vpunpckhqdq {{.*#+}} zmm0 = zmm0[1],zmm1[1],zmm0[3],zmm1[3],zmm0[5],zmm1[5],zmm0[7],zmm1[7]
1453; ALL-NEXT: retq
1454 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32><i32 1, i32 9, i32 3, i32 11, i32 5, i32 13, i32 7, i32 15>
1455 ret <8 x i64> %shuffle
1456}