blob: 5ddec49c1bf6dc3db90babc0f0c0505f8809d1fd [file] [log] [blame]
Chandler Carrutheb206aa2015-02-20 03:59:35 +00001; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512f | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512F
2; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512bw | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512BW
Chandler Carruth24e3b692014-09-28 23:53:10 +00003
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 Carruthbf0fb062015-02-15 12:42:15 +000065; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0],ymm1[1],ymm0[2,3]
66; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000067; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
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 Carruthbf0fb062015-02-15 12:42:15 +000078; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2],ymm0[3]
79; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,0,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000080; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
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 Carruthbf0fb062015-02-15 12:42:15 +000091; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1,2],ymm1[3]
92; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,0,0,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000093; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
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 Carruthbf0fb062015-02-15 12:42:15 +0000273; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm1[0,0,1,1]
274; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm0[0],ymm2[1,2,3]
275; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2,3]
276; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,2,3,3]
277; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000278; ALL-NEXT: retq
279 %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>
280 ret <8 x double> %shuffle
281}
282
283define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000284; ALL-LABEL: shuffle_v8f64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000285; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000286; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000287; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
288; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
289; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
290; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000291; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
292; ALL-NEXT: retq
293 %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>
294 ret <8 x double> %shuffle
295}
296
297define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000298; ALL-LABEL: shuffle_v8f64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000299; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000300; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carruthf3e88062014-10-03 22:43:17 +0000301; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm0[1,0,2,2]
302; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1,2,3]
303; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
304; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000305; ALL-NEXT: retq
306 %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>
307 ret <8 x double> %shuffle
308}
309
310define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000311; ALL-LABEL: shuffle_v8f64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000312; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000313; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000314; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000315; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000316; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000317; ALL-NEXT: retq
318 %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>
319 ret <8 x double> %shuffle
320}
321
322define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000323; ALL-LABEL: shuffle_v8f64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000324; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000325; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000326; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000327; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000328; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000329; ALL-NEXT: retq
330 %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>
331 ret <8 x double> %shuffle
332}
333
334define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000335; ALL-LABEL: shuffle_v8f64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000336; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000337; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000338; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000339; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000340; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000341; ALL-NEXT: retq
342 %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>
343 ret <8 x double> %shuffle
344}
345
346define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000347; ALL-LABEL: shuffle_v8f64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000348; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000349; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000350; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000351; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000352; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000353; ALL-NEXT: retq
354 %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>
355 ret <8 x double> %shuffle
356}
357
358define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000359; ALL-LABEL: shuffle_v8f64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000360; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000361; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000362; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000363; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000364; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000365; ALL-NEXT: retq
366 %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>
367 ret <8 x double> %shuffle
368}
369
370define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000371; ALL-LABEL: shuffle_v8f64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000372; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000373; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000374; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000375; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000376; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000377; ALL-NEXT: retq
378 %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>
379 ret <8 x double> %shuffle
380}
381
382define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000383; ALL-LABEL: shuffle_v8f64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000384; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000385; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000386; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000387; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000388; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000389; ALL-NEXT: retq
390 %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>
391 ret <8 x double> %shuffle
392}
393
394define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000395; ALL-LABEL: shuffle_v8f64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000396; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000397; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000398; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000399; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000400; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000401; ALL-NEXT: retq
402 %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>
403 ret <8 x double> %shuffle
404}
405
Chandler Carruthbb525e32015-02-04 10:46:53 +0000406define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) {
407; ALL-LABEL: shuffle_v8f64_00224466:
408; ALL: # BB#0:
409; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
410; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
411; ALL-NEXT: vmovddup {{.*#+}} ymm0 = ymm0[0,0,2,2]
412; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
413; ALL-NEXT: retq
414 %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 +0000415 ret <8 x double> %shuffle
416}
417
418define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000419; ALL-LABEL: shuffle_v8f64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000420; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000421; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000422; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000423; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000424; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000425; ALL-NEXT: retq
426 %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>
427 ret <8 x double> %shuffle
428}
429
430define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000431; ALL-LABEL: shuffle_v8f64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000432; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000433; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000434; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000435; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000436; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000437; ALL-NEXT: retq
438 %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>
439 ret <8 x double> %shuffle
440}
441
442define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000443; ALL-LABEL: shuffle_v8f64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000444; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000445; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000446; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000447; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000448; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000449; ALL-NEXT: retq
450 %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>
451 ret <8 x double> %shuffle
452}
453
454define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000455; ALL-LABEL: shuffle_v8f64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000456; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000457; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000458; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000459; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000460; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000461; ALL-NEXT: retq
462 %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>
463 ret <8 x double> %shuffle
464}
465
466define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000467; ALL-LABEL: shuffle_v8f64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000468; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000469; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000470; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000471; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000472; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
473; ALL-NEXT: retq
474 %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>
475 ret <8 x double> %shuffle
476}
477
478define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000479; ALL-LABEL: shuffle_v8f64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000480; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000481; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000482; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000483; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000484; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
485; ALL-NEXT: retq
486 %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>
487 ret <8 x double> %shuffle
488}
489
490define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000491; ALL-LABEL: shuffle_v8f64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000492; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000493; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000494; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000495; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000496; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000497; ALL-NEXT: retq
498 %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>
499 ret <8 x double> %shuffle
500}
501
502define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000503; ALL-LABEL: shuffle_v8f64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000504; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000505; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000506; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000507; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000508; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
509; ALL-NEXT: retq
510 %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>
511 ret <8 x double> %shuffle
512}
513
514define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000515; ALL-LABEL: shuffle_v8f64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000516; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000517; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000518; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000519; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000520; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000521; ALL-NEXT: retq
522 %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>
523 ret <8 x double> %shuffle
524}
525
526define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000527; ALL-LABEL: shuffle_v8f64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000528; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000529; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000530; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000531; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000532; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000533; ALL-NEXT: retq
534 %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>
535 ret <8 x double> %shuffle
536}
537
538define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000539; ALL-LABEL: shuffle_v8f64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000540; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000541; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000542; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000543; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000544; ALL-NEXT: retq
545 %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>
546 ret <8 x double> %shuffle
547}
548
549define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000550; ALL-LABEL: shuffle_v8f64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000551; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000552; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000553; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000554; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000555; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
556; ALL-NEXT: retq
557 %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>
558 ret <8 x double> %shuffle
559}
560
Chandler Carruthbb525e32015-02-04 10:46:53 +0000561define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) {
562; ALL-LABEL: shuffle_v8f64_00226644:
563; ALL: # BB#0:
564; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
565; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
566; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
567; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000568; ALL-NEXT: retq
569 %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>
570 ret <8 x double> %shuffle
571}
572
573define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000574; ALL-LABEL: shuffle_v8f64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000575; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000576; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000577; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000578; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000579; ALL-NEXT: retq
580 %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>
581 ret <8 x double> %shuffle
582}
583
584define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000585; ALL-LABEL: shuffle_v8f64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000586; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000587; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000588; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000589; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000590; ALL-NEXT: retq
591 %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>
592 ret <8 x double> %shuffle
593}
594
595define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000596; ALL-LABEL: shuffle_v8f64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000597; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000598; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000599; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000600; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
601; ALL-NEXT: retq
602 %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>
603 ret <8 x double> %shuffle
604}
605
606define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000607; ALL-LABEL: shuffle_v8f64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000608; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000609; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000610; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000611; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000612; ALL-NEXT: retq
613 %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>
614 ret <8 x double> %shuffle
615}
616
Chandler Carruthbb525e32015-02-04 10:46:53 +0000617define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) {
618; ALL-LABEL: shuffle_v8f64_002u6u44:
619; ALL: # BB#0:
620; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm0[0,0,2,2]
621; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
622; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,0,0]
623; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000624; ALL-NEXT: retq
625 %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>
626 ret <8 x double> %shuffle
627}
628
629define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000630; ALL-LABEL: shuffle_v8f64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000631; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000632; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carruthbb525e32015-02-04 10:46:53 +0000633; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000634; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000635; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
636; ALL-NEXT: retq
637 %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>
638 ret <8 x double> %shuffle
639}
640
641define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000642; ALL-LABEL: shuffle_v8f64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000643; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000644; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000645; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000646; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
647; ALL-NEXT: retq
648 %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>
649 ret <8 x double> %shuffle
650}
651
652define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000653; ALL-LABEL: shuffle_v8f64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000654; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000655; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000656; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000657; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000658; ALL-NEXT: retq
659 %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>
660 ret <8 x double> %shuffle
661}
662
663define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000664; ALL-LABEL: shuffle_v8f64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000665; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000666; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000667; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000668; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
669; ALL-NEXT: retq
670 %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>
671 ret <8 x double> %shuffle
672}
673
674define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) {
Chandler Carruthbb525e32015-02-04 10:46:53 +0000675; ALL-LABEL: shuffle_v8f64_uuu3uu66:
676; ALL: # BB#0:
677; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
678; ALL-NEXT: vmovddup {{.*#+}} ymm1 = ymm1[0,0,2,2]
679; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
680; ALL-NEXT: retq
681 %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 +0000682 ret <8 x double> %shuffle
683}
684
685define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000686; ALL-LABEL: shuffle_v8f64_c348cda0:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000687; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000688; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000689; ALL-NEXT: vperm2f128 {{.*#+}} ymm2 = ymm0[0,1],ymm2[0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000690; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000691; ALL-NEXT: vbroadcastsd %xmm1, %ymm4
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000692; ALL-NEXT: vblendpd {{.*#+}} ymm4 = ymm3[0,1,2],ymm4[3]
693; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm4[0],ymm2[1,2],ymm4[3]
694; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm3[0,1],ymm1[2],ymm3[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000695; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000696; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000697; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000698; ALL-NEXT: retq
699 %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>
700 ret <8 x double> %shuffle
701}
702
703define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000704; ALL-LABEL: shuffle_v8f64_f511235a:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000705; ALL: # BB#0:
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000706; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
707; ALL-NEXT: vblendpd {{.*#+}} ymm3 = ymm0[0],ymm2[1],ymm0[2,3]
708; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[2,3,1,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000709; ALL-NEXT: vmovddup {{.*#+}} ymm4 = ymm1[0,0,2,2]
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000710; ALL-NEXT: vblendpd {{.*#+}} ymm3 = ymm3[0,1,2],ymm4[3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000711; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,1]
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000712; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm2[1],ymm0[2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000713; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000714; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthf3e88062014-10-03 22:43:17 +0000715; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3]
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000716; ALL-NEXT: vinsertf64x4 $1, %ymm3, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000717; ALL-NEXT: retq
718 %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>
719 ret <8 x double> %shuffle
720}
721
722define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000723; ALL-LABEL: shuffle_v8i64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000724; ALL: # BB#0:
Robert Khasanovdd09a8f2014-10-28 12:28:51 +0000725; ALL-NEXT: vpbroadcastq %xmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000726; ALL-NEXT: retq
727 %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>
728 ret <8 x i64> %shuffle
729}
730
731define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000732; ALL-LABEL: shuffle_v8i64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000733; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000734; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000735; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000736; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000737; ALL-NEXT: retq
738 %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>
739 ret <8 x i64> %shuffle
740}
741
742define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000743; ALL-LABEL: shuffle_v8i64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000744; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000745; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000746; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000747; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000748; ALL-NEXT: retq
749 %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>
750 ret <8 x i64> %shuffle
751}
752
753define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000754; ALL-LABEL: shuffle_v8i64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000755; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000756; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000757; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000758; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
759; ALL-NEXT: retq
760 %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>
761 ret <8 x i64> %shuffle
762}
763
764define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000765; ALL-LABEL: shuffle_v8i64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000766; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000767; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000768; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
769; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
770; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000771; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
772; ALL-NEXT: retq
773 %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>
774 ret <8 x i64> %shuffle
775}
776
777define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000778; ALL-LABEL: shuffle_v8i64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000779; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000780; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000781; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
782; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,1,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000783; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000784; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
785; ALL-NEXT: retq
786 %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>
787 ret <8 x i64> %shuffle
788}
789
790define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000791; ALL-LABEL: shuffle_v8i64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000792; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000793; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000794; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
795; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,0,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000796; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000797; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
798; ALL-NEXT: retq
799 %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>
800 ret <8 x i64> %shuffle
801}
802
803define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000804; ALL-LABEL: shuffle_v8i64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000805; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000806; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000807; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
808; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[3,0,0,0]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000809; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000810; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
811; ALL-NEXT: retq
812 %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>
813 ret <8 x i64> %shuffle
814}
815
816define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000817; ALL-LABEL: shuffle_v8i64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000818; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000819; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000820; ALL-NEXT: vinserti128 $1, %xmm1, %ymm1, %ymm1
821; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
822; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000823; ALL-NEXT: retq
824 %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>
825 ret <8 x i64> %shuffle
826}
827
828define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000829; ALL-LABEL: shuffle_v8i64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000830; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000831; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,1,1]
832; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000833; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000834; ALL-NEXT: retq
835 %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>
836 ret <8 x i64> %shuffle
837}
838
839define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000840; ALL-LABEL: shuffle_v8i64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000841; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000842; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000843; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000844; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
845; ALL-NEXT: retq
846 %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>
847 ret <8 x i64> %shuffle
848}
849
850define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000851; ALL-LABEL: shuffle_v8i64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000852; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000853; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
854; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000855; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
856; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000857; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
858; ALL-NEXT: retq
859 %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>
860 ret <8 x i64> %shuffle
861}
862
863define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000864; ALL-LABEL: shuffle_v8i64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000865; ALL: # BB#0:
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000866; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000867; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000868; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000869; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
870; ALL-NEXT: retq
871 %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>
872 ret <8 x i64> %shuffle
873}
874
875define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000876; ALL-LABEL: shuffle_v8i64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000877; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000878; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000879; ALL-NEXT: vinserti128 $1, %xmm2, %ymm2, %ymm2
Chandler Carruthbb525e32015-02-04 10:46:53 +0000880; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000881; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +0000882; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3],ymm2[4,5],ymm3[6,7]
883; ALL-NEXT: vinserti128 $1, %xmm0, %ymm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000884; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000885; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000886; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
887; ALL-NEXT: retq
888 %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>
889 ret <8 x i64> %shuffle
890}
891
892define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000893; ALL-LABEL: shuffle_v8i64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000894; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000895; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
896; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000897; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000898; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000899; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000900; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000901; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
902; ALL-NEXT: retq
903 %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>
904 ret <8 x i64> %shuffle
905}
906
907define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000908; ALL-LABEL: shuffle_v8i64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000909; ALL: # BB#0:
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000910; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000911; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000912; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
913; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000914; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruthce5a26b2014-11-21 14:53:03 +0000915; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
916; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000917; ALL-NEXT: retq
918 %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>
919 ret <8 x i64> %shuffle
920}
921
922define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000923; ALL-LABEL: shuffle_v8i64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000924; ALL: # BB#0:
Chandler Carruthd2b19bc2014-11-21 13:56:05 +0000925; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm2
926; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
927; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm1
928; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
929; ALL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
930; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
931; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000932; ALL-NEXT: retq
933 %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>
934 ret <8 x i64> %shuffle
935}
936
937define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000938; ALL-LABEL: shuffle_v8i64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000939; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000940; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000941; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000942; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000943; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,1,1,3]
944; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
945; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
946; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
947; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000948; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
949; ALL-NEXT: retq
950 %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>
951 ret <8 x i64> %shuffle
952}
953
954define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000955; ALL-LABEL: shuffle_v8i64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000956; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +0000957; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000958; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +0000959; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000960; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[2,1,3,3]
961; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
962; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
963; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,3,3]
964; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000965; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
966; ALL-NEXT: retq
967 %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>
968 ret <8 x i64> %shuffle
969}
970
971define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000972; ALL-LABEL: shuffle_v8i64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000973; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000974; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,2,2,3]
975; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
976; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
977; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
978; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
979; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000980; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
981; ALL-NEXT: retq
982 %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>
983 ret <8 x i64> %shuffle
984}
985
986define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000987; ALL-LABEL: shuffle_v8i64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000988; ALL: # BB#0:
Chandler Carruthbf0fb062015-02-15 12:42:15 +0000989; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,0,1,1]
990; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm0[0,1],ymm2[2,3,4,5,6,7]
991; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5,6,7]
992; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,2,3,3]
993; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000994; ALL-NEXT: retq
995 %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>
996 ret <8 x i64> %shuffle
997}
998
999define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001000; ALL-LABEL: shuffle_v8i64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001001; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001002; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001003; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
1004; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
1005; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1006; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001007; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1008; ALL-NEXT: retq
1009 %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>
1010 ret <8 x i64> %shuffle
1011}
1012
1013define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001014; ALL-LABEL: shuffle_v8i64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001015; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001016; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001017; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm0[2,3,2,3,6,7,6,7]
1018; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7]
1019; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001020; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1021; ALL-NEXT: retq
1022 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
1023 ret <8 x i64> %shuffle
1024}
1025
1026define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001027; ALL-LABEL: shuffle_v8i64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001028; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001029; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001030; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001031; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001032; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001033; ALL-NEXT: retq
1034 %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>
1035 ret <8 x i64> %shuffle
1036}
1037
1038define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001039; ALL-LABEL: shuffle_v8i64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001040; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001041; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001042; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001043; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001044; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001045; ALL-NEXT: retq
1046 %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>
1047 ret <8 x i64> %shuffle
1048}
1049
1050define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001051; ALL-LABEL: shuffle_v8i64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001052; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001053; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001054; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001055; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001056; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001057; ALL-NEXT: retq
1058 %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>
1059 ret <8 x i64> %shuffle
1060}
1061
1062define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001063; ALL-LABEL: shuffle_v8i64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001064; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001065; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001066; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001067; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001068; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001069; ALL-NEXT: retq
1070 %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>
1071 ret <8 x i64> %shuffle
1072}
1073
1074define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001075; ALL-LABEL: shuffle_v8i64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001076; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001077; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001078; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001079; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001080; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001081; ALL-NEXT: retq
1082 %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>
1083 ret <8 x i64> %shuffle
1084}
1085
1086define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001087; ALL-LABEL: shuffle_v8i64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001088; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001089; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001090; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001091; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001092; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001093; ALL-NEXT: retq
1094 %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>
1095 ret <8 x i64> %shuffle
1096}
1097
1098define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001099; ALL-LABEL: shuffle_v8i64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001100; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001101; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001102; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001103; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001104; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001105; ALL-NEXT: retq
1106 %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>
1107 ret <8 x i64> %shuffle
1108}
1109
1110define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001111; ALL-LABEL: shuffle_v8i64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001112; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001113; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001114; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001115; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001116; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001117; ALL-NEXT: retq
1118 %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>
1119 ret <8 x i64> %shuffle
1120}
1121
1122define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001123; ALL-LABEL: shuffle_v8i64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001124; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001125; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001126; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001127; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001128; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001129; ALL-NEXT: retq
1130 %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>
1131 ret <8 x i64> %shuffle
1132}
1133
1134define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001135; ALL-LABEL: shuffle_v8i64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001136; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001137; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001138; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001139; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001140; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001141; ALL-NEXT: retq
1142 %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>
1143 ret <8 x i64> %shuffle
1144}
1145
1146define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001147; ALL-LABEL: shuffle_v8i64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001148; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001149; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001150; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001151; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001152; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001153; ALL-NEXT: retq
1154 %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>
1155 ret <8 x i64> %shuffle
1156}
1157
1158define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001159; ALL-LABEL: shuffle_v8i64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001160; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001161; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001162; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001163; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001164; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001165; ALL-NEXT: retq
1166 %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>
1167 ret <8 x i64> %shuffle
1168}
1169
1170define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001171; ALL-LABEL: shuffle_v8i64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001172; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001173; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001174; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001175; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001176; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001177; ALL-NEXT: retq
1178 %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>
1179 ret <8 x i64> %shuffle
1180}
1181
1182define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001183; ALL-LABEL: shuffle_v8i64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001184; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001185; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001186; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001187; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001188; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1189; ALL-NEXT: retq
1190 %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>
1191 ret <8 x i64> %shuffle
1192}
1193
1194define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001195; ALL-LABEL: shuffle_v8i64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001196; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001197; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001198; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001199; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001200; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1201; ALL-NEXT: retq
1202 %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>
1203 ret <8 x i64> %shuffle
1204}
1205
1206define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001207; ALL-LABEL: shuffle_v8i64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001208; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001209; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001210; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001211; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001212; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001213; ALL-NEXT: retq
1214 %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>
1215 ret <8 x i64> %shuffle
1216}
1217
1218define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001219; ALL-LABEL: shuffle_v8i64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001220; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001221; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001222; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001223; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001224; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1225; ALL-NEXT: retq
1226 %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>
1227 ret <8 x i64> %shuffle
1228}
1229
1230define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001231; ALL-LABEL: shuffle_v8i64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001232; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001233; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001234; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001235; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001236; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001237; ALL-NEXT: retq
1238 %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>
1239 ret <8 x i64> %shuffle
1240}
1241
1242define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001243; ALL-LABEL: shuffle_v8i64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001244; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001245; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001246; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001247; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001248; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001249; ALL-NEXT: retq
1250 %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>
1251 ret <8 x i64> %shuffle
1252}
1253
1254define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001255; ALL-LABEL: shuffle_v8i64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001256; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001257; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001258; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001259; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001260; ALL-NEXT: retq
1261 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
1262 ret <8 x i64> %shuffle
1263}
1264
1265define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001266; ALL-LABEL: shuffle_v8i64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001267; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001268; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001269; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001270; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001271; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1272; ALL-NEXT: retq
1273 %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>
1274 ret <8 x i64> %shuffle
1275}
1276
1277define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001278; ALL-LABEL: shuffle_v8i64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001279; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001280; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001281; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001282; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001283; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001284; ALL-NEXT: retq
1285 %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>
1286 ret <8 x i64> %shuffle
1287}
1288
1289define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001290; ALL-LABEL: shuffle_v8i64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001291; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001292; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001293; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001294; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001295; ALL-NEXT: retq
1296 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
1297 ret <8 x i64> %shuffle
1298}
1299
1300define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001301; ALL-LABEL: shuffle_v8i64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001302; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001303; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001304; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001305; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001306; ALL-NEXT: retq
1307 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
1308 ret <8 x i64> %shuffle
1309}
1310
1311define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001312; ALL-LABEL: shuffle_v8i64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001313; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001314; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001315; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001316; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1317; ALL-NEXT: retq
1318 %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>
1319 ret <8 x i64> %shuffle
1320}
1321
1322define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001323; ALL-LABEL: shuffle_v8i64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001324; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001325; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001326; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001327; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001328; ALL-NEXT: retq
1329 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
1330 ret <8 x i64> %shuffle
1331}
1332
1333define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001334; ALL-LABEL: shuffle_v8i64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001335; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001336; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001337; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001338; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001339; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001340; ALL-NEXT: retq
1341 %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>
1342 ret <8 x i64> %shuffle
1343}
1344
1345define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001346; ALL-LABEL: shuffle_v8i64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001347; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001348; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carruthbb525e32015-02-04 10:46:53 +00001349; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001350; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001351; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1352; ALL-NEXT: retq
1353 %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>
1354 ret <8 x i64> %shuffle
1355}
1356
1357define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001358; ALL-LABEL: shuffle_v8i64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001359; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001360; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001361; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001362; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1363; ALL-NEXT: retq
1364 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
1365 ret <8 x i64> %shuffle
1366}
1367
1368define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001369; ALL-LABEL: shuffle_v8i64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001370; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001371; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001372; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +00001373; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001374; ALL-NEXT: retq
1375 %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>
1376 ret <8 x i64> %shuffle
1377}
1378
1379define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001380; ALL-LABEL: shuffle_v8i64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001381; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001382; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001383; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001384; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1385; ALL-NEXT: retq
1386 %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>
1387 ret <8 x i64> %shuffle
1388}
1389
1390define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001391; ALL-LABEL: shuffle_v8i64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001392; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001393; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001394; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001395; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001396; ALL-NEXT: retq
1397 %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>
1398 ret <8 x i64> %shuffle
1399}
1400
1401define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001402; ALL-LABEL: shuffle_v8i64_6caa87e5:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001403; ALL: # BB#0:
Chandler Carruthbb525e32015-02-04 10:46:53 +00001404; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001405; ALL-NEXT: vperm2i128 {{.*#+}} ymm2 = ymm0[0,1,0,1]
Chandler Carruthbb525e32015-02-04 10:46:53 +00001406; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001407; ALL-NEXT: vpblendd {{.*#+}} ymm4 = ymm1[0,1,2,3],ymm3[4,5],ymm1[6,7]
1408; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm4[0,1],ymm2[2,3],ymm4[4,5],ymm2[6,7]
1409; ALL-NEXT: vperm2i128 {{.*#+}} ymm0 = ymm0[2,3,0,1]
Chandler Carruthce5a26b2014-11-21 14:53:03 +00001410; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm3[0,1,2,3],ymm1[4,5,6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001411; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001412; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth9f4d9fa2014-10-05 11:41:36 +00001413; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001414; ALL-NEXT: retq
1415 %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>
1416 ret <8 x i64> %shuffle
1417}
Adam Nemete5dbcb72015-01-13 22:20:18 +00001418
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001419define <8 x double> @shuffle_v8f64_082a4c6e(<8 x double> %a, <8 x double> %b) {
1420; ALL-LABEL: shuffle_v8f64_082a4c6e:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001421; ALL: # BB#0:
1422; ALL-NEXT: vunpcklpd {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[2],zmm1[2],zmm0[4],zmm1[4],zmm0[6],zmm1[6]
1423; ALL-NEXT: retq
1424 %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>
1425 ret <8 x double> %shuffle
1426}
1427
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001428define <8 x i64> @shuffle_v8i64_082a4c6e(<8 x i64> %a, <8 x i64> %b) {
1429; ALL-LABEL: shuffle_v8i64_082a4c6e:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001430; ALL: # BB#0:
1431; ALL-NEXT: vpunpcklqdq {{.*#+}} zmm0 = zmm0[0],zmm1[0],zmm0[2],zmm1[2],zmm0[4],zmm1[4],zmm0[6],zmm1[6]
1432; ALL-NEXT: retq
1433 %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>
1434 ret <8 x i64> %shuffle
1435}
1436
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001437define <8 x double> @shuffle_v8f64_193b5d7f(<8 x double> %a, <8 x double> %b) {
1438; ALL-LABEL: shuffle_v8f64_193b5d7f:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001439; ALL: # BB#0:
1440; ALL-NEXT: vunpckhpd {{.*#+}} zmm0 = zmm0[1],zmm1[1],zmm0[3],zmm1[3],zmm0[5],zmm1[5],zmm0[7],zmm1[7]
1441; ALL-NEXT: retq
1442 %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>
1443 ret <8 x double> %shuffle
1444}
1445
Adam Nemetf07a0ba2015-01-13 22:40:15 +00001446define <8 x i64> @shuffle_v8i64_193b5d7f(<8 x i64> %a, <8 x i64> %b) {
1447; ALL-LABEL: shuffle_v8i64_193b5d7f:
Adam Nemete5dbcb72015-01-13 22:20:18 +00001448; ALL: # BB#0:
1449; ALL-NEXT: vpunpckhqdq {{.*#+}} zmm0 = zmm0[1],zmm1[1],zmm0[3],zmm1[3],zmm0[5],zmm1[5],zmm0[7],zmm1[7]
1450; ALL-NEXT: retq
1451 %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>
1452 ret <8 x i64> %shuffle
1453}