blob: 2f02f2fc08f44160f51455116e92926aa93a1cd4 [file] [log] [blame]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512f -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512F
2; RUN: llc < %s -mcpu=x86-64 -mattr=+avx512bw -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX512 --check-prefix=AVX512BW
3
4target triple = "x86_64-unknown-unknown"
5
6define <8 x double> @shuffle_v8f64_00000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00007; ALL-LABEL: shuffle_v8f64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +00008; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00009; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +000010; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000011; ALL-NEXT: retq
12 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
13 ret <8 x double> %shuffle
14}
15
16define <8 x double> @shuffle_v8f64_00000010(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000017; ALL-LABEL: shuffle_v8f64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +000018; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000019; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000020; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000021; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000022; ALL-NEXT: retq
23 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0>
24 ret <8 x double> %shuffle
25}
26
27define <8 x double> @shuffle_v8f64_00000200(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000028; ALL-LABEL: shuffle_v8f64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +000029; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000030; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000031; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +000032; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +000033; ALL-NEXT: retq
34 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0>
35 ret <8 x double> %shuffle
36}
37
38define <8 x double> @shuffle_v8f64_00003000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000039; ALL-LABEL: shuffle_v8f64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000040; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000041; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000042; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +000043; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
44; ALL-NEXT: retq
45 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 3, i32 0, i32 0, i32 0>
46 ret <8 x double> %shuffle
47}
48
49define <8 x double> @shuffle_v8f64_00040000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000050; ALL-LABEL: shuffle_v8f64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000051; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000052; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000053; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
54; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
55; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1,2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000056; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
57; ALL-NEXT: retq
58 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0>
59 ret <8 x double> %shuffle
60}
61
62define <8 x double> @shuffle_v8f64_00500000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000063; ALL-LABEL: shuffle_v8f64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000064; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000065; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000066; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000067; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
68; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000069; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
70; ALL-NEXT: retq
71 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0>
72 ret <8 x double> %shuffle
73}
74
75define <8 x double> @shuffle_v8f64_06000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000076; ALL-LABEL: shuffle_v8f64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000077; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000078; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000079; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000080; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
81; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm0[0],ymm1[1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000082; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
83; ALL-NEXT: retq
84 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 6, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
85 ret <8 x double> %shuffle
86}
87
88define <8 x double> @shuffle_v8f64_70000000(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +000089; ALL-LABEL: shuffle_v8f64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +000090; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +000091; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +000092; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +000093; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruthf3e88062014-10-03 22:43:17 +000094; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm1[0],ymm0[1,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +000095; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
96; ALL-NEXT: retq
97 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 7, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
98 ret <8 x double> %shuffle
99}
100
101define <8 x double> @shuffle_v8f64_01014545(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000102; ALL-LABEL: shuffle_v8f64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000103; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000104; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,1,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000105; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000106; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000107; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000108; ALL-NEXT: retq
109 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 0, i32 1, i32 4, i32 5, i32 4, i32 5>
110 ret <8 x double> %shuffle
111}
112
113define <8 x double> @shuffle_v8f64_00112233(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000114; ALL-LABEL: shuffle_v8f64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000115; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000116; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,1,1]
117; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000118; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000119; ALL-NEXT: retq
120 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
121 ret <8 x double> %shuffle
122}
123
124define <8 x double> @shuffle_v8f64_00001111(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000125; ALL-LABEL: shuffle_v8f64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000126; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000127; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000128; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000129; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
130; ALL-NEXT: retq
131 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1>
132 ret <8 x double> %shuffle
133}
134
135define <8 x double> @shuffle_v8f64_81a3c5e7(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000136; ALL-LABEL: shuffle_v8f64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000137; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000138; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
139; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000140; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
141; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1],ymm1[2],ymm0[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000142; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
143; ALL-NEXT: retq
144 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 8, i32 1, i32 10, i32 3, i32 12, i32 5, i32 14, i32 7>
145 ret <8 x double> %shuffle
146}
147
148define <8 x double> @shuffle_v8f64_08080808(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000149; ALL-LABEL: shuffle_v8f64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000150; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000151; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
152; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000153; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000154; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm0, %zmm0
155; ALL-NEXT: retq
156 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 0, i32 8, i32 0, i32 8>
157 ret <8 x double> %shuffle
158}
159
160define <8 x double> @shuffle_v8f64_08084c4c(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000161; ALL-LABEL: shuffle_v8f64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000162; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000163; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000164; ALL-NEXT: vbroadcastsd %xmm2, %ymm2
Chandler Carruthc7129272014-09-29 00:37:27 +0000165; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000166; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000167; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000168; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
169; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000170; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000171; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
172; ALL-NEXT: retq
173 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 0, i32 8, i32 4, i32 12, i32 4, i32 12>
174 ret <8 x double> %shuffle
175}
176
177define <8 x double> @shuffle_v8f64_8823cc67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000178; ALL-LABEL: shuffle_v8f64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000179; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000180; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
181; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000182; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000183; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000184; ALL-NEXT: vbroadcastsd %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000185; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000186; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
187; ALL-NEXT: retq
188 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 8, i32 8, i32 2, i32 3, i32 12, i32 12, i32 6, i32 7>
189 ret <8 x double> %shuffle
190}
191
192define <8 x double> @shuffle_v8f64_9832dc76(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000193; ALL-LABEL: shuffle_v8f64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000194; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000195; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000196; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm2[0,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000197; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000198; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
199; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
200; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,3,2]
201; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
202; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000203; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
204; ALL-NEXT: retq
205 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 9, i32 8, i32 3, i32 2, i32 13, i32 12, i32 7, i32 6>
206 ret <8 x double> %shuffle
207}
208
209define <8 x double> @shuffle_v8f64_9810dc54(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000210; ALL-LABEL: shuffle_v8f64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000211; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000212; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000213; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000214; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000215; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm3[1,0,2,2]
216; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3]
217; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,0]
218; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
219; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000220; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
221; ALL-NEXT: retq
222 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 9, i32 8, i32 1, i32 0, i32 13, i32 12, i32 5, i32 4>
223 ret <8 x double> %shuffle
224}
225
226define <8 x double> @shuffle_v8f64_08194c5d(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000227; ALL-LABEL: shuffle_v8f64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000228; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000229; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000230; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000231; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000232; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[0,1,1,3]
233; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
234; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
235; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
236; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000237; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
238; ALL-NEXT: retq
239 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
240 ret <8 x double> %shuffle
241}
242
243define <8 x double> @shuffle_v8f64_2a3b6e7f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000244; ALL-LABEL: shuffle_v8f64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000245; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000246; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000247; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000248; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000249; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm3[2,1,3,3]
250; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
251; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,2,2,3]
252; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,3,3]
253; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000254; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
255; ALL-NEXT: retq
256 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
257 ret <8 x double> %shuffle
258}
259
260define <8 x double> @shuffle_v8f64_08192a3b(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000261; ALL-LABEL: shuffle_v8f64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000262; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000263; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm1[0,2,2,3]
264; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
265; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
266; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,2,1]
267; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
268; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000269; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
270; ALL-NEXT: retq
271 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
272 ret <8 x double> %shuffle
273}
274
275define <8 x double> @shuffle_v8f64_08991abb(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000276; ALL-LABEL: shuffle_v8f64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000277; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000278; ALL-NEXT: vpermilpd {{.*#+}} ymm2 = ymm0[1,0,2,2]
279; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm1[0,2,3,3]
280; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0],ymm3[1,2,3]
281; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[0,0,1,1]
282; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
283; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000284; ALL-NEXT: retq
285 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 8, i32 9, i32 9, i32 1, i32 10, i32 11, i32 11>
286 ret <8 x double> %shuffle
287}
288
289define <8 x double> @shuffle_v8f64_091b2d3f(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000290; ALL-LABEL: shuffle_v8f64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000291; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000292; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000293; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm0[2,1,3,3]
294; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1],ymm3[2],ymm2[3]
295; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,3]
296; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1],ymm0[2],ymm1[3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000297; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
298; ALL-NEXT: retq
299 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 9, i32 1, i32 11, i32 2, i32 13, i32 3, i32 15>
300 ret <8 x double> %shuffle
301}
302
303define <8 x double> @shuffle_v8f64_09ab1def(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000304; ALL-LABEL: shuffle_v8f64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000305; ALL: # BB#0:
Chandler Carruthf3e88062014-10-03 22:43:17 +0000306; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm2
307; ALL-NEXT: vpermilpd {{.*#+}} ymm3 = ymm0[1,0,2,2]
308; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm3[0],ymm2[1,2,3]
309; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm1[1,2,3]
310; ALL-NEXT: vinsertf64x4 $1, %ymm2, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000311; ALL-NEXT: retq
312 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 9, i32 10, i32 11, i32 1, i32 13, i32 14, i32 15>
313 ret <8 x double> %shuffle
314}
315
316define <8 x double> @shuffle_v8f64_00014445(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000317; ALL-LABEL: shuffle_v8f64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000318; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000319; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000320; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000321; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000322; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000323; ALL-NEXT: retq
324 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
325 ret <8 x double> %shuffle
326}
327
328define <8 x double> @shuffle_v8f64_00204464(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000329; ALL-LABEL: shuffle_v8f64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000330; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000331; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000332; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000333; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000334; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000335; ALL-NEXT: retq
336 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
337 ret <8 x double> %shuffle
338}
339
340define <8 x double> @shuffle_v8f64_03004744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000341; ALL-LABEL: shuffle_v8f64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000342; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000343; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000344; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000345; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000346; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000347; ALL-NEXT: retq
348 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
349 ret <8 x double> %shuffle
350}
351
352define <8 x double> @shuffle_v8f64_10005444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000353; ALL-LABEL: shuffle_v8f64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000354; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000355; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000356; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000357; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000358; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000359; ALL-NEXT: retq
360 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
361 ret <8 x double> %shuffle
362}
363
364define <8 x double> @shuffle_v8f64_22006644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000365; ALL-LABEL: shuffle_v8f64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000366; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000367; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000368; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000369; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000370; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000371; ALL-NEXT: retq
372 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
373 ret <8 x double> %shuffle
374}
375
376define <8 x double> @shuffle_v8f64_33307774(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000377; ALL-LABEL: shuffle_v8f64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000378; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000379; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000380; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000381; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000382; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000383; ALL-NEXT: retq
384 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
385 ret <8 x double> %shuffle
386}
387
388define <8 x double> @shuffle_v8f64_32107654(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000389; ALL-LABEL: shuffle_v8f64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000390; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000391; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000392; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000393; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000394; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000395; ALL-NEXT: retq
396 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
397 ret <8 x double> %shuffle
398}
399
400define <8 x double> @shuffle_v8f64_00234467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000401; ALL-LABEL: shuffle_v8f64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000402; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000403; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000404; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000405; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000406; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000407; ALL-NEXT: retq
408 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
409 ret <8 x double> %shuffle
410}
411
412define <8 x double> @shuffle_v8f64_00224466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000413; ALL-LABEL: shuffle_v8f64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000414; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000415; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000416; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000417; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000418; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000419; ALL-NEXT: retq
420 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
421 ret <8 x double> %shuffle
422}
423
424define <8 x double> @shuffle_v8f64_10325476(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000425; ALL-LABEL: shuffle_v8f64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000426; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000427; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000428; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000429; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000430; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000431; ALL-NEXT: retq
432 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
433 ret <8 x double> %shuffle
434}
435
436define <8 x double> @shuffle_v8f64_11335577(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000437; ALL-LABEL: shuffle_v8f64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000438; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000439; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000440; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000441; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000442; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000443; ALL-NEXT: retq
444 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
445 ret <8 x double> %shuffle
446}
447
448define <8 x double> @shuffle_v8f64_10235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000449; ALL-LABEL: shuffle_v8f64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000450; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000451; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000452; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000453; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000454; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000455; ALL-NEXT: retq
456 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
457 ret <8 x double> %shuffle
458}
459
460define <8 x double> @shuffle_v8f64_10225466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000461; ALL-LABEL: shuffle_v8f64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000462; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000463; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000464; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000465; ALL-NEXT: vpermilpd {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000466; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000467; ALL-NEXT: retq
468 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 2, i32 5, i32 4, i32 6, i32 6>
469 ret <8 x double> %shuffle
470}
471
472define <8 x double> @shuffle_v8f64_00015444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000473; ALL-LABEL: shuffle_v8f64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000474; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000475; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000476; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000477; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000478; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
479; ALL-NEXT: retq
480 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
481 ret <8 x double> %shuffle
482}
483
484define <8 x double> @shuffle_v8f64_00204644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000485; ALL-LABEL: shuffle_v8f64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000486; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000487; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000488; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000489; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000490; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
491; ALL-NEXT: retq
492 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 6, i32 4, i32 4>
493 ret <8 x double> %shuffle
494}
495
496define <8 x double> @shuffle_v8f64_03004474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000497; ALL-LABEL: shuffle_v8f64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000498; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000499; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000500; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000501; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000502; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000503; ALL-NEXT: retq
504 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 4, i32 7, i32 4>
505 ret <8 x double> %shuffle
506}
507
508define <8 x double> @shuffle_v8f64_10004444(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000509; ALL-LABEL: shuffle_v8f64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000510; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000511; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000512; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000513; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000514; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
515; ALL-NEXT: retq
516 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4>
517 ret <8 x double> %shuffle
518}
519
520define <8 x double> @shuffle_v8f64_22006446(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000521; ALL-LABEL: shuffle_v8f64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000522; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000523; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000524; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000525; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000526; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000527; ALL-NEXT: retq
528 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
529 ret <8 x double> %shuffle
530}
531
532define <8 x double> @shuffle_v8f64_33307474(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000533; ALL-LABEL: shuffle_v8f64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000534; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000535; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000536; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000537; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000538; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000539; ALL-NEXT: retq
540 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 4, i32 7, i32 4>
541 ret <8 x double> %shuffle
542}
543
544define <8 x double> @shuffle_v8f64_32104567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000545; ALL-LABEL: shuffle_v8f64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000546; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000547; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000548; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
549; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000550; ALL-NEXT: retq
551 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 4, i32 5, i32 6, i32 7>
552 ret <8 x double> %shuffle
553}
554
555define <8 x double> @shuffle_v8f64_00236744(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000556; ALL-LABEL: shuffle_v8f64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000557; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000558; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000559; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000560; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000561; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
562; ALL-NEXT: retq
563 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 6, i32 7, i32 4, i32 4>
564 ret <8 x double> %shuffle
565}
566
567define <8 x double> @shuffle_v8f64_00226644(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000568; ALL-LABEL: shuffle_v8f64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000569; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000570; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000571; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000572; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000573; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000574; ALL-NEXT: retq
575 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 6, i32 6, i32 4, i32 4>
576 ret <8 x double> %shuffle
577}
578
579define <8 x double> @shuffle_v8f64_10324567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000580; ALL-LABEL: shuffle_v8f64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000581; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000582; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000583; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
584; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000585; ALL-NEXT: retq
586 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 6, i32 7>
587 ret <8 x double> %shuffle
588}
589
590define <8 x double> @shuffle_v8f64_11334567(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000591; ALL-LABEL: shuffle_v8f64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000592; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000593; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000594; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
595; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000596; ALL-NEXT: retq
597 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
598 ret <8 x double> %shuffle
599}
600
601define <8 x double> @shuffle_v8f64_01235467(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000602; ALL-LABEL: shuffle_v8f64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000603; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000604; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000605; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000606; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
607; ALL-NEXT: retq
608 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
609 ret <8 x double> %shuffle
610}
611
612define <8 x double> @shuffle_v8f64_01235466(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000613; ALL-LABEL: shuffle_v8f64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000614; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000615; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000616; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000617; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000618; ALL-NEXT: retq
619 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
620 ret <8 x double> %shuffle
621}
622
623define <8 x double> @shuffle_v8f64_002u6u44(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000624; ALL-LABEL: shuffle_v8f64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000625; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000626; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000627; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000628; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000629; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000630; ALL-NEXT: retq
631 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 undef, i32 6, i32 undef, i32 4, i32 4>
632 ret <8 x double> %shuffle
633}
634
635define <8 x double> @shuffle_v8f64_00uu66uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000636; ALL-LABEL: shuffle_v8f64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000637; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000638; ALL-NEXT: vbroadcastsd %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +0000639; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000640; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000641; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
642; ALL-NEXT: retq
643 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 0, i32 undef, i32 undef, i32 6, i32 6, i32 undef, i32 undef>
644 ret <8 x double> %shuffle
645}
646
647define <8 x double> @shuffle_v8f64_103245uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000648; ALL-LABEL: shuffle_v8f64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000649; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000650; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,0,3,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000651; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000652; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
653; ALL-NEXT: retq
654 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 4, i32 5, i32 undef, i32 undef>
655 ret <8 x double> %shuffle
656}
657
658define <8 x double> @shuffle_v8f64_1133uu67(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000659; ALL-LABEL: shuffle_v8f64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000660; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000661; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm0[1,1,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000662; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm0
663; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000664; ALL-NEXT: retq
665 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 undef, i32 undef, i32 6, i32 7>
666 ret <8 x double> %shuffle
667}
668
669define <8 x double> @shuffle_v8f64_0uu354uu(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000670; ALL-LABEL: shuffle_v8f64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000671; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000672; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000673; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000674; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
675; ALL-NEXT: retq
676 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 0, i32 undef, i32 undef, i32 3, i32 5, i32 4, i32 undef, i32 undef>
677 ret <8 x double> %shuffle
678}
679
680define <8 x double> @shuffle_v8f64_uuu3uu66(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000681; ALL-LABEL: shuffle_v8f64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000682; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000683; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000684; ALL-NEXT: vpermilpd {{.*#+}} ymm1 = ymm1[0,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +0000685; ALL-NEXT: vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000686; ALL-NEXT: retq
687 %shuffle = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 undef, i32 undef, i32 undef, i32 3, i32 undef, i32 undef, i32 6, i32 6>
688 ret <8 x double> %shuffle
689}
690
691define <8 x double> @shuffle_v8f64_c348cda0(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000692; ALL-LABEL: shuffle_v8f64_c348cda0:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000693; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000694; ALL-NEXT: vpermpd {{.*#+}} ymm2 = ymm0[0,3,2,3]
695; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm3
696; ALL-NEXT: vbroadcastsd %xmm3, %ymm3
697; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2],ymm2[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000698; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000699; ALL-NEXT: vbroadcastsd %xmm1, %ymm4
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000700; ALL-NEXT: vblendpd {{.*#+}} ymm4 = ymm3[0,1,2],ymm4[3]
701; ALL-NEXT: vblendpd {{.*#+}} ymm2 = ymm4[0],ymm2[1,2],ymm4[3]
702; ALL-NEXT: vblendpd {{.*#+}} ymm1 = ymm3[0,1],ymm1[2],ymm3[3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000703; ALL-NEXT: vbroadcastsd %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000704; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0,1,2],ymm0[3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000705; ALL-NEXT: vinsertf64x4 $1, %ymm0, %zmm2, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000706; ALL-NEXT: retq
707 %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>
708 ret <8 x double> %shuffle
709}
710
711define <8 x double> @shuffle_v8f64_f511235a(<8 x double> %a, <8 x double> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000712; ALL-LABEL: shuffle_v8f64_f511235a:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000713; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000714; ALL-NEXT: vextractf64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000715; ALL-NEXT: vpermpd {{.*#+}} ymm3 = ymm2[0,1,1,3]
716; ALL-NEXT: vpermpd {{.*#+}} ymm4 = ymm0[2,3,2,3]
717; ALL-NEXT: vblendpd {{.*#+}} ymm3 = ymm4[0,1],ymm3[2],ymm4[3]
718; ALL-NEXT: vpermilpd {{.*#+}} ymm4 = ymm1[0,0,2,2]
719; ALL-NEXT: vblendpd {{.*#+}} ymm3 = ymm3[0,1,2],ymm4[3]
720; ALL-NEXT: vpermpd {{.*#+}} ymm0 = ymm0[0,1,1,1]
721; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm0[0],ymm2[1],ymm0[2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000722; ALL-NEXT: vextractf64x4 $1, %zmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000723; ALL-NEXT: vpermpd {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthf3e88062014-10-03 22:43:17 +0000724; ALL-NEXT: vblendpd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000725; ALL-NEXT: vinsertf64x4 $1, %ymm3, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000726; ALL-NEXT: retq
727 %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>
728 ret <8 x double> %shuffle
729}
730
731define <8 x i64> @shuffle_v8i64_00000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000732; ALL-LABEL: shuffle_v8i64_00000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000733; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000734; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruthc7129272014-09-29 00:37:27 +0000735; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000736; ALL-NEXT: retq
737 %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>
738 ret <8 x i64> %shuffle
739}
740
741define <8 x i64> @shuffle_v8i64_00000010(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000742; ALL-LABEL: shuffle_v8i64_00000010:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000743; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000744; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000745; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000746; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000747; ALL-NEXT: retq
748 %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>
749 ret <8 x i64> %shuffle
750}
751
752define <8 x i64> @shuffle_v8i64_00000200(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000753; ALL-LABEL: shuffle_v8i64_00000200:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000754; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000755; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000756; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000757; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000758; ALL-NEXT: retq
759 %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>
760 ret <8 x i64> %shuffle
761}
762
763define <8 x i64> @shuffle_v8i64_00003000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000764; ALL-LABEL: shuffle_v8i64_00003000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000765; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000766; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000767; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000768; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
769; ALL-NEXT: retq
770 %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>
771 ret <8 x i64> %shuffle
772}
773
774define <8 x i64> @shuffle_v8i64_00040000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000775; ALL-LABEL: shuffle_v8i64_00040000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000776; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000777; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000778; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
779; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
780; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3,4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000781; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
782; ALL-NEXT: retq
783 %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>
784 ret <8 x i64> %shuffle
785}
786
787define <8 x i64> @shuffle_v8i64_00500000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000788; ALL-LABEL: shuffle_v8i64_00500000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000789; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000790; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000791; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,1,1,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000792; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
793; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000794; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
795; ALL-NEXT: retq
796 %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>
797 ret <8 x i64> %shuffle
798}
799
800define <8 x i64> @shuffle_v8i64_06000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000801; ALL-LABEL: shuffle_v8i64_06000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000802; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000803; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000804; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000805; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
806; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm0[0,1],ymm1[2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000807; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
808; ALL-NEXT: retq
809 %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>
810 ret <8 x i64> %shuffle
811}
812
813define <8 x i64> @shuffle_v8i64_70000000(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000814; ALL-LABEL: shuffle_v8i64_70000000:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000815; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000816; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000817; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[3,1,2,3]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000818; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000819; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm0[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000820; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
821; ALL-NEXT: retq
822 %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>
823 ret <8 x i64> %shuffle
824}
825
826define <8 x i64> @shuffle_v8i64_01014545(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000827; ALL-LABEL: shuffle_v8i64_01014545:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000828; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000829; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,1,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000830; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000831; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000832; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000833; ALL-NEXT: retq
834 %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>
835 ret <8 x i64> %shuffle
836}
837
838define <8 x i64> @shuffle_v8i64_00112233(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000839; ALL-LABEL: shuffle_v8i64_00112233:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000840; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000841; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,1,1]
842; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,3,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000843; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +0000844; ALL-NEXT: retq
845 %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>
846 ret <8 x i64> %shuffle
847}
848
849define <8 x i64> @shuffle_v8i64_00001111(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000850; ALL-LABEL: shuffle_v8i64_00001111:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000851; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000852; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000853; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,1,1,1]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000854; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
855; ALL-NEXT: retq
856 %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>
857 ret <8 x i64> %shuffle
858}
859
860define <8 x i64> @shuffle_v8i64_81a3c5e7(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000861; ALL-LABEL: shuffle_v8i64_81a3c5e7:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000862; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000863; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
864; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000865; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
866; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1],ymm0[2,3],ymm1[4,5],ymm0[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000867; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
868; ALL-NEXT: retq
869 %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>
870 ret <8 x i64> %shuffle
871}
872
873define <8 x i64> @shuffle_v8i64_08080808(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000874; ALL-LABEL: shuffle_v8i64_08080808:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000875; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000876; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
877; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000878; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000879; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm0, %zmm0
880; ALL-NEXT: retq
881 %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>
882 ret <8 x i64> %shuffle
883}
884
885define <8 x i64> @shuffle_v8i64_08084c4c(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000886; ALL-LABEL: shuffle_v8i64_08084c4c:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000887; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000888; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000889; ALL-NEXT: vpbroadcastq %xmm2, %ymm2
Chandler Carruthc7129272014-09-29 00:37:27 +0000890; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000891; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000892; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000893; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
894; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000895; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000896; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
897; ALL-NEXT: retq
898 %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>
899 ret <8 x i64> %shuffle
900}
901
902define <8 x i64> @shuffle_v8i64_8823cc67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000903; ALL-LABEL: shuffle_v8i64_8823cc67:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000904; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000905; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
906; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000907; ALL-NEXT: vpbroadcastq %xmm3, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000908; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +0000909; ALL-NEXT: vpbroadcastq %xmm1, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000910; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000911; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
912; ALL-NEXT: retq
913 %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>
914 ret <8 x i64> %shuffle
915}
916
917define <8 x i64> @shuffle_v8i64_9832dc76(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000918; ALL-LABEL: shuffle_v8i64_9832dc76:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000919; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000920; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000921; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm2[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +0000922; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000923; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
924; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
925; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
926; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
927; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000928; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
929; ALL-NEXT: retq
930 %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>
931 ret <8 x i64> %shuffle
932}
933
934define <8 x i64> @shuffle_v8i64_9810dc54(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000935; ALL-LABEL: shuffle_v8i64_9810dc54:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000936; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000937; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000938; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,1,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +0000939; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000940; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm3[2,3,0,1,6,7,4,5]
941; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1,2,3],ymm2[4,5,6,7]
942; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,0]
943; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
944; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000945; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
946; ALL-NEXT: retq
947 %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>
948 ret <8 x i64> %shuffle
949}
950
951define <8 x i64> @shuffle_v8i64_08194c5d(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000952; ALL-LABEL: shuffle_v8i64_08194c5d:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000953; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000954; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000955; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,0,2,1]
Chandler Carruthc7129272014-09-29 00:37:27 +0000956; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000957; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[0,1,1,3]
958; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
959; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
960; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
961; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000962; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
963; ALL-NEXT: retq
964 %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>
965 ret <8 x i64> %shuffle
966}
967
968define <8 x i64> @shuffle_v8i64_2a3b6e7f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000969; ALL-LABEL: shuffle_v8i64_2a3b6e7f:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000970; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +0000971; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000972; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm2[0,2,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +0000973; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm3
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000974; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm3[2,1,3,3]
975; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
976; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,2,2,3]
977; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,3,3]
978; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000979; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
980; ALL-NEXT: retq
981 %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>
982 ret <8 x i64> %shuffle
983}
984
985define <8 x i64> @shuffle_v8i64_08192a3b(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000986; ALL-LABEL: shuffle_v8i64_08192a3b:
Chandler Carruth24e3b692014-09-28 23:53:10 +0000987; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +0000988; ALL-NEXT: vpermq {{.*#+}} ymm2 = ymm1[0,2,2,3]
989; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
990; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
991; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,2,1]
992; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
993; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +0000994; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
995; ALL-NEXT: retq
996 %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>
997 ret <8 x i64> %shuffle
998}
999
1000define <8 x i64> @shuffle_v8i64_08991abb(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001001; ALL-LABEL: shuffle_v8i64_08991abb:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001002; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001003; ALL-NEXT: vpshufd {{.*#+}} ymm2 = ymm0[2,3,2,3,6,7,6,7]
1004; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm1[0,2,3,3]
1005; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm2[0,1],ymm3[2,3,4,5,6,7]
1006; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[0,0,1,1]
1007; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001008; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1009; ALL-NEXT: retq
1010 %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>
1011 ret <8 x i64> %shuffle
1012}
1013
1014define <8 x i64> @shuffle_v8i64_091b2d3f(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001015; ALL-LABEL: shuffle_v8i64_091b2d3f:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001016; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001017; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001018; ALL-NEXT: vpermq {{.*#+}} ymm3 = ymm0[2,1,3,3]
1019; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3],ymm3[4,5],ymm2[6,7]
1020; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,1,3]
1021; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3],ymm0[4,5],ymm1[6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001022; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1023; ALL-NEXT: retq
1024 %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>
1025 ret <8 x i64> %shuffle
1026}
1027
1028define <8 x i64> @shuffle_v8i64_09ab1def(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001029; ALL-LABEL: shuffle_v8i64_09ab1def:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001030; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001031; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001032; ALL-NEXT: vpshufd {{.*#+}} ymm3 = ymm0[2,3,2,3,6,7,6,7]
1033; ALL-NEXT: vpblendd {{.*#+}} ymm2 = ymm3[0,1],ymm2[2,3,4,5,6,7]
1034; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001035; ALL-NEXT: vinserti64x4 $1, %ymm2, %zmm0, %zmm0
1036; ALL-NEXT: retq
1037 %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>
1038 ret <8 x i64> %shuffle
1039}
1040
1041define <8 x i64> @shuffle_v8i64_00014445(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001042; ALL-LABEL: shuffle_v8i64_00014445:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001043; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001044; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001045; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001046; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001047; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001048; ALL-NEXT: retq
1049 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 4, i32 4, i32 4, i32 5>
1050 ret <8 x i64> %shuffle
1051}
1052
1053define <8 x i64> @shuffle_v8i64_00204464(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001054; ALL-LABEL: shuffle_v8i64_00204464:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001055; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001056; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001057; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001058; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001059; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001060; ALL-NEXT: retq
1061 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 0, i32 4, i32 4, i32 6, i32 4>
1062 ret <8 x i64> %shuffle
1063}
1064
1065define <8 x i64> @shuffle_v8i64_03004744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001066; ALL-LABEL: shuffle_v8i64_03004744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001067; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001068; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001069; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001070; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001071; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001072; ALL-NEXT: retq
1073 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 3, i32 0, i32 0, i32 4, i32 7, i32 4, i32 4>
1074 ret <8 x i64> %shuffle
1075}
1076
1077define <8 x i64> @shuffle_v8i64_10005444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001078; ALL-LABEL: shuffle_v8i64_10005444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001079; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001080; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001081; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001082; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001083; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001084; ALL-NEXT: retq
1085 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 0, i32 0, i32 5, i32 4, i32 4, i32 4>
1086 ret <8 x i64> %shuffle
1087}
1088
1089define <8 x i64> @shuffle_v8i64_22006644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001090; ALL-LABEL: shuffle_v8i64_22006644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001091; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001092; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001093; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001094; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001095; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001096; ALL-NEXT: retq
1097 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 6, i32 4, i32 4>
1098 ret <8 x i64> %shuffle
1099}
1100
1101define <8 x i64> @shuffle_v8i64_33307774(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001102; ALL-LABEL: shuffle_v8i64_33307774:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001103; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001104; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001105; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001106; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001107; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001108; ALL-NEXT: retq
1109 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 3, i32 3, i32 0, i32 7, i32 7, i32 7, i32 4>
1110 ret <8 x i64> %shuffle
1111}
1112
1113define <8 x i64> @shuffle_v8i64_32107654(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001114; ALL-LABEL: shuffle_v8i64_32107654:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001115; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001116; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001117; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001118; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001119; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001120; ALL-NEXT: retq
1121 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
1122 ret <8 x i64> %shuffle
1123}
1124
1125define <8 x i64> @shuffle_v8i64_00234467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001126; ALL-LABEL: shuffle_v8i64_00234467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001127; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001128; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001129; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001130; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001131; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001132; ALL-NEXT: retq
1133 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 3, i32 4, i32 4, i32 6, i32 7>
1134 ret <8 x i64> %shuffle
1135}
1136
1137define <8 x i64> @shuffle_v8i64_00224466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001138; ALL-LABEL: shuffle_v8i64_00224466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001139; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001140; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001141; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001142; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001143; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001144; ALL-NEXT: retq
1145 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 2, i32 2, i32 4, i32 4, i32 6, i32 6>
1146 ret <8 x i64> %shuffle
1147}
1148
1149define <8 x i64> @shuffle_v8i64_10325476(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001150; ALL-LABEL: shuffle_v8i64_10325476:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001151; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001152; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001153; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001154; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001155; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001156; ALL-NEXT: retq
1157 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
1158 ret <8 x i64> %shuffle
1159}
1160
1161define <8 x i64> @shuffle_v8i64_11335577(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001162; ALL-LABEL: shuffle_v8i64_11335577:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001163; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001164; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001165; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001166; ALL-NEXT: vpshufd {{.*#+}} ymm0 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001167; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001168; ALL-NEXT: retq
1169 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 1, i32 3, i32 3, i32 5, i32 5, i32 7, i32 7>
1170 ret <8 x i64> %shuffle
1171}
1172
1173define <8 x i64> @shuffle_v8i64_10235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001174; ALL-LABEL: shuffle_v8i64_10235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001175; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001176; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001177; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001178; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001179; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001180; ALL-NEXT: retq
1181 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 1, i32 0, i32 2, i32 3, i32 5, i32 4, i32 6, i32 7>
1182 ret <8 x i64> %shuffle
1183}
1184
1185define <8 x i64> @shuffle_v8i64_10225466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001186; ALL-LABEL: shuffle_v8i64_10225466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001187; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001188; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001189; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001190; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001191; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001192; ALL-NEXT: retq
1193 %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>
1194 ret <8 x i64> %shuffle
1195}
1196
1197define <8 x i64> @shuffle_v8i64_00015444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001198; ALL-LABEL: shuffle_v8i64_00015444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001199; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001200; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,0,1]
Chandler Carruthc7129272014-09-29 00:37:27 +00001201; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001202; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[1,0,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001203; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1204; ALL-NEXT: retq
1205 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 5, i32 4, i32 4, i32 4>
1206 ret <8 x i64> %shuffle
1207}
1208
1209define <8 x i64> @shuffle_v8i64_00204644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001210; ALL-LABEL: shuffle_v8i64_00204644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001211; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001212; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001213; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001214; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001215; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1216; ALL-NEXT: retq
1217 %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>
1218 ret <8 x i64> %shuffle
1219}
1220
1221define <8 x i64> @shuffle_v8i64_03004474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001222; ALL-LABEL: shuffle_v8i64_03004474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001223; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001224; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,3,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001225; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001226; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001227; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001228; ALL-NEXT: retq
1229 %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>
1230 ret <8 x i64> %shuffle
1231}
1232
1233define <8 x i64> @shuffle_v8i64_10004444(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001234; ALL-LABEL: shuffle_v8i64_10004444:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001235; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001236; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[1,0,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001237; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001238; ALL-NEXT: vpbroadcastq %xmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001239; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1240; ALL-NEXT: retq
1241 %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>
1242 ret <8 x i64> %shuffle
1243}
1244
1245define <8 x i64> @shuffle_v8i64_22006446(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001246; ALL-LABEL: shuffle_v8i64_22006446:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001247; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001248; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001249; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001250; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,0,0,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001251; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001252; ALL-NEXT: retq
1253 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 2, i32 0, i32 0, i32 6, i32 4, i32 4, i32 6>
1254 ret <8 x i64> %shuffle
1255}
1256
1257define <8 x i64> @shuffle_v8i64_33307474(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001258; ALL-LABEL: shuffle_v8i64_33307474:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001259; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001260; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,3,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001261; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001262; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[3,0,3,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001263; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001264; ALL-NEXT: retq
1265 %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>
1266 ret <8 x i64> %shuffle
1267}
1268
1269define <8 x i64> @shuffle_v8i64_32104567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001270; ALL-LABEL: shuffle_v8i64_32104567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001271; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001272; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[3,2,1,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001273; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1274; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001275; ALL-NEXT: retq
1276 %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>
1277 ret <8 x i64> %shuffle
1278}
1279
1280define <8 x i64> @shuffle_v8i64_00236744(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001281; ALL-LABEL: shuffle_v8i64_00236744:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001282; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001283; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm0[0,0,2,3]
Chandler Carruthc7129272014-09-29 00:37:27 +00001284; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001285; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,3,0,0]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001286; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1287; ALL-NEXT: retq
1288 %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>
1289 ret <8 x i64> %shuffle
1290}
1291
1292define <8 x i64> @shuffle_v8i64_00226644(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001293; ALL-LABEL: shuffle_v8i64_00226644:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001294; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001295; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001296; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001297; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001298; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001299; ALL-NEXT: retq
1300 %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>
1301 ret <8 x i64> %shuffle
1302}
1303
1304define <8 x i64> @shuffle_v8i64_10324567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001305; ALL-LABEL: shuffle_v8i64_10324567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001306; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001307; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001308; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1309; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001310; ALL-NEXT: retq
1311 %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>
1312 ret <8 x i64> %shuffle
1313}
1314
1315define <8 x i64> @shuffle_v8i64_11334567(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001316; ALL-LABEL: shuffle_v8i64_11334567:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001317; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001318; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001319; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1320; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001321; ALL-NEXT: retq
1322 %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>
1323 ret <8 x i64> %shuffle
1324}
1325
1326define <8 x i64> @shuffle_v8i64_01235467(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001327; ALL-LABEL: shuffle_v8i64_01235467:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001328; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001329; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001330; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001331; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1332; ALL-NEXT: retq
1333 %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>
1334 ret <8 x i64> %shuffle
1335}
1336
1337define <8 x i64> @shuffle_v8i64_01235466(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001338; ALL-LABEL: shuffle_v8i64_01235466:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001339; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001340; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001341; ALL-NEXT: vpermq {{.*#+}} ymm1 = ymm1[1,0,2,2]
Chandler Carruthc7129272014-09-29 00:37:27 +00001342; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001343; ALL-NEXT: retq
1344 %shuffle = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 5, i32 4, i32 6, i32 6>
1345 ret <8 x i64> %shuffle
1346}
1347
1348define <8 x i64> @shuffle_v8i64_002u6u44(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001349; ALL-LABEL: shuffle_v8i64_002u6u44:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001350; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001351; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001352; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001353; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,0,0]
Chandler Carruthc7129272014-09-29 00:37:27 +00001354; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001355; ALL-NEXT: retq
1356 %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>
1357 ret <8 x i64> %shuffle
1358}
1359
1360define <8 x i64> @shuffle_v8i64_00uu66uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001361; ALL-LABEL: shuffle_v8i64_00uu66uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001362; ALL: # BB#0:
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001363; ALL-NEXT: vpbroadcastq %xmm0, %ymm1
Chandler Carruthc7129272014-09-29 00:37:27 +00001364; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001365; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,2,2,3]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001366; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1367; ALL-NEXT: retq
1368 %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>
1369 ret <8 x i64> %shuffle
1370}
1371
1372define <8 x i64> @shuffle_v8i64_103245uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001373; ALL-LABEL: shuffle_v8i64_103245uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001374; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001375; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,0,1,6,7,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001376; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001377; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
1378; ALL-NEXT: retq
1379 %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>
1380 ret <8 x i64> %shuffle
1381}
1382
1383define <8 x i64> @shuffle_v8i64_1133uu67(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001384; ALL-LABEL: shuffle_v8i64_1133uu67:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001385; ALL: # BB#0:
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001386; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm0[2,3,2,3,6,7,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001387; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
1388; ALL-NEXT: vinserti64x4 $1, %ymm0, %zmm1, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001389; ALL-NEXT: retq
1390 %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>
1391 ret <8 x i64> %shuffle
1392}
1393
1394define <8 x i64> @shuffle_v8i64_0uu354uu(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001395; ALL-LABEL: shuffle_v8i64_0uu354uu:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001396; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001397; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001398; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[2,3,0,1,6,7,4,5]
Chandler Carruth24e3b692014-09-28 23:53:10 +00001399; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
1400; ALL-NEXT: retq
1401 %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>
1402 ret <8 x i64> %shuffle
1403}
1404
1405define <8 x i64> @shuffle_v8i64_uuu3uu66(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001406; ALL-LABEL: shuffle_v8i64_uuu3uu66:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001407; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001408; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm1
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001409; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthc7129272014-09-29 00:37:27 +00001410; ALL-NEXT: vinserti64x4 $1, %ymm1, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001411; ALL-NEXT: retq
1412 %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>
1413 ret <8 x i64> %shuffle
1414}
1415
1416define <8 x i64> @shuffle_v8i64_6caa87e5(<8 x i64> %a, <8 x i64> %b) {
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001417; ALL-LABEL: shuffle_v8i64_6caa87e5:
Chandler Carruth24e3b692014-09-28 23:53:10 +00001418; ALL: # BB#0:
Chandler Carruthc7129272014-09-29 00:37:27 +00001419; ALL-NEXT: vextracti64x4 $1, %zmm1, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001420; ALL-NEXT: vpblendd {{.*#+}} ymm3 = ymm1[0,1,2,3],ymm2[4,5],ymm1[6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001421; ALL-NEXT: vextracti64x4 $1, %zmm0, %ymm0
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001422; ALL-NEXT: vpermq {{.*#+}} ymm4 = ymm0[0,3,2,1]
1423; ALL-NEXT: vpblendd {{.*#+}} ymm3 = ymm3[0,1],ymm4[2,3],ymm3[4,5],ymm4[6,7]
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001424; ALL-NEXT: vpshufd {{.*#+}} ymm1 = ymm1[0,1,0,1,4,5,4,5]
Chandler Carruthb9d3fa12014-10-01 00:41:21 +00001425; ALL-NEXT: vpbroadcastq %xmm2, %ymm2
Chandler Carrutha41dceb2014-09-30 22:04:45 +00001426; ALL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1],ymm2[2,3],ymm1[4,5,6,7]
1427; ALL-NEXT: vpermq {{.*#+}} ymm0 = ymm0[2,1,2,3]
1428; ALL-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5,6,7]
Chandler Carruthc7129272014-09-29 00:37:27 +00001429; ALL-NEXT: vinserti64x4 $1, %ymm3, %zmm0, %zmm0
Chandler Carruth24e3b692014-09-28 23:53:10 +00001430; ALL-NEXT: retq
1431 %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>
1432 ret <8 x i64> %shuffle
1433}