1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
22 define <16 x float> @test1(<16 x float> %a) nounwind {
23 %c = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32> <i32 2, i32 5, i32 undef, i32 undef, i32 7, i32 undef, i32 10, i32 1, i32 0, i32 5, i32 undef, i32 4, i32 7, i32 undef, i32 10, i32 1>
30 define <16 x i32> @test2(<16 x i32> %a) nounwind {
31 %c = shufflevector <16 x i32> %a, <16 x i32> undef, <16 x i32> <i32 2, i32 5, i32 undef, i32 undef, i32 7, i32 undef, i32 10, i32 1, i32 0, i32 5, i32 undef, i32 4, i32 7, i32 undef, i32 10, i32 1>
38 define <8 x i64> @test3(<8 x i64> %a) nounwind {
39 %c = shufflevector <8 x i64> %a, <8 x i64> undef, <8 x i32> <i32 2, i32 5, i32 1, i32 undef, i32 7, i32 undef, i32 3, i32 1>
46 define <8 x double> @test4(<8 x double> %a) nounwind {
47 %c = shufflevector <8 x double> %a, <8 x double> undef, <8 x i32> <i32 1, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
54 define <8 x double> @test5(<8 x double> %a, <8 x double> %b) nounwind {
55 %c = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 8, i32 0, i32 1, i32 6, i32 10, i32 4, i32 5>
62 define <8 x i64> @test6(<8 x i64> %a) nounwind {
63 %c = shufflevector <8 x i64> %a, <8 x i64> undef, <8 x i32> <i32 2, i32 3, i32 1, i32 0, i32 6, i32 7, i32 5, i32 4>
70 define <8 x i64> @test7(<8 x i64> %a, <8 x i64> %b) nounwind {
71 %c = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32> <i32 2, i32 8, i32 0, i32 1, i32 6, i32 10, i32 4, i32 5>
78 define <16 x i32> @test8(<16 x i32> %a, <16 x i32> %b) nounwind {
79 %c = shufflevector <16 x i32> %a, <16 x i32> %b, <16 x i32> <i32 15, i32 31, i32 14, i32 22, i32 13, i32 29, i32 4, i32 28, i32 11, i32 27, i32 10, i32 26, i32 9, i32 25, i32 8, i32 24>
86 define <16 x float> @test9(<16 x float> %a, <16 x float> %b) nounwind {
87 %c = shufflevector <16 x float> %a, <16 x float> %b, <16 x i32> <i32 15, i32 31, i32 14, i32 22, i32 13, i32 29, i32 4, i32 28, i32 11, i32 27, i32 10, i32 26, i32 9, i32 25, i32 8, i32 24>
91 ; CHECK-LABEL: test10:
94 define <16 x float> @test10(<16 x float> %a, <16 x float>* %b) nounwind {
95 %c = load <16 x float>* %b
96 %d = shufflevector <16 x float> %a, <16 x float> %c, <16 x i32> <i32 15, i32 31, i32 14, i32 22, i32 13, i32 29, i32 4, i32 28, i32 11, i32 27, i32 10, i32 26, i32 9, i32 25, i32 8, i32 24>
100 ; CHECK-LABEL: test11:
103 define <16 x i32> @test11(<16 x i32> %a, <16 x i32>* %b) nounwind {
104 %c = load <16 x i32>* %b
105 %d = shufflevector <16 x i32> %a, <16 x i32> %c, <16 x i32> <i32 15, i32 31, i32 14, i32 22, i32 13, i32 29, i32 4, i32 28, i32 11, i32 27, i32 10, i32 26, i32 9, i32 25, i32 8, i32 24>
109 ; CHECK-LABEL: test12
110 ; CHECK: vmovlhpsz %xmm
112 define <4 x i32> @test12(<4 x i32> %a, <4 x i32> %b) nounwind {
113 %c = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
117 ; CHECK-LABEL: test13
118 ; CHECK: vpermilps $-79, %zmm
120 define <16 x float> @test13(<16 x float> %a) {
121 %b = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32><i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14>
125 ; CHECK-LABEL: test14
126 ; CHECK: vpermilpd $-53, %zmm
128 define <8 x double> @test14(<8 x double> %a) {
129 %b = shufflevector <8 x double> %a, <8 x double> undef, <8 x i32><i32 1, i32 1, i32 2, i32 3, i32 4, i32 4, i32 7, i32 7>
133 ; CHECK-LABEL: test15
134 ; CHECK: vpshufd $-79, %zmm
136 define <16 x i32> @test15(<16 x i32> %a) {
137 %b = shufflevector <16 x i32> %a, <16 x i32> undef, <16 x i32><i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14>
140 ; CHECK-LABEL: test16
141 ; CHECK: valignq $2, %zmm0, %zmm1
143 define <8 x double> @test16(<8 x double> %a, <8 x double> %b) nounwind {
144 %c = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>
148 ; CHECK-LABEL: test17
149 ; CHECK: vshufpd $19, %zmm1, %zmm0
151 define <8 x double> @test17(<8 x double> %a, <8 x double> %b) nounwind {
152 %c = shufflevector <8 x double> %a, <8 x double> %b, <8 x i32> <i32 1, i32 9, i32 2, i32 10, i32 5, i32 undef, i32 undef, i32 undef>
156 ; CHECK-LABEL: test18
157 ; CHECK: vpunpckhdq %zmm
159 define <16 x i32> @test18(<16 x i32> %a, <16 x i32> %c) {
160 %b = shufflevector <16 x i32> %a, <16 x i32> %c, <16 x i32><i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15, i32 18, i32 26, i32 19, i32 27, i32 22, i32 30, i32 23, i32 31>
164 ; CHECK-LABEL: test19
165 ; CHECK: vpunpckldq %zmm
167 define <16 x i32> @test19(<16 x i32> %a, <16 x i32> %c) {
168 %b = shufflevector <16 x i32> %a, <16 x i32> %c, <16 x i32><i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13, i32 16, i32 24, i32 17, i32 25, i32 20, i32 28, i32 21, i32 29>
172 ; CHECK-LABEL: test20
173 ; CHECK: vpunpckhqdq %zmm
175 define <8 x i64> @test20(<8 x i64> %a, <8 x i64> %c) {
176 %b = shufflevector <8 x i64> %a, <8 x i64> %c, <8 x i32><i32 1, i32 5, i32 3, i32 7, i32 9, i32 13, i32 11, i32 15>
180 ; CHECK-LABEL: test21
181 ; CHECK: vunpcklps %zmm
183 define <16 x float> @test21(<16 x float> %a, <16 x float> %c) {
184 %b = shufflevector <16 x float> %a, <16 x float> %c, <16 x i32><i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13, i32 16, i32 24, i32 17, i32 25, i32 20, i32 28, i32 21, i32 29>
188 ; CHECK-LABEL: test22
189 ; CHECK: vmovhlpsz %xmm
191 define <4 x i32> @test22(<4 x i32> %a, <4 x i32> %b) nounwind {
192 %c = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 2, i32 3, i32 6, i32 7>
196 ; CHECK-LABEL: @test23
197 ; CHECK: vshufps $-112, %zmm
199 define <16 x float> @test23(<16 x float> %a, <16 x float> %c) {
200 %b = shufflevector <16 x float> %a, <16 x float> %c, <16 x i32><i32 0, i32 0, i32 17, i32 18, i32 4, i32 4, i32 21, i32 22, i32 8, i32 8, i32 25, i32 26, i32 12, i32 12, i32 29, i32 30>