1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE2
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+sse3 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE3
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+sse4.1 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE41
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+avx -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=AVX1
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-unknown"
9 define <4 x i32> @shuffle_v4i32_0001(<4 x i32> %a, <4 x i32> %b) {
10 ; ALL-LABEL: @shuffle_v4i32_0001
11 ; ALL: pshufd {{.*}} # xmm0 = xmm0[0,0,0,1]
13 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
14 ret <4 x i32> %shuffle
16 define <4 x i32> @shuffle_v4i32_0020(<4 x i32> %a, <4 x i32> %b) {
17 ; ALL-LABEL: @shuffle_v4i32_0020
18 ; ALL: pshufd {{.*}} # xmm0 = xmm0[0,0,2,0]
20 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 0>
21 ret <4 x i32> %shuffle
23 define <4 x i32> @shuffle_v4i32_0112(<4 x i32> %a, <4 x i32> %b) {
24 ; ALL-LABEL: @shuffle_v4i32_0112
25 ; ALL: pshufd {{.*}} # xmm0 = xmm0[0,1,1,2]
27 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 1, i32 2>
28 ret <4 x i32> %shuffle
30 define <4 x i32> @shuffle_v4i32_0300(<4 x i32> %a, <4 x i32> %b) {
31 ; ALL-LABEL: @shuffle_v4i32_0300
32 ; ALL: pshufd {{.*}} # xmm0 = xmm0[0,3,0,0]
34 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 3, i32 0, i32 0>
35 ret <4 x i32> %shuffle
37 define <4 x i32> @shuffle_v4i32_1000(<4 x i32> %a, <4 x i32> %b) {
38 ; ALL-LABEL: @shuffle_v4i32_1000
39 ; ALL: pshufd {{.*}} # xmm0 = xmm0[1,0,0,0]
41 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
42 ret <4 x i32> %shuffle
44 define <4 x i32> @shuffle_v4i32_2200(<4 x i32> %a, <4 x i32> %b) {
45 ; ALL-LABEL: @shuffle_v4i32_2200
46 ; ALL: pshufd {{.*}} # xmm0 = xmm0[2,2,0,0]
48 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 2, i32 2, i32 0, i32 0>
49 ret <4 x i32> %shuffle
51 define <4 x i32> @shuffle_v4i32_3330(<4 x i32> %a, <4 x i32> %b) {
52 ; ALL-LABEL: @shuffle_v4i32_3330
53 ; ALL: pshufd {{.*}} # xmm0 = xmm0[3,3,3,0]
55 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 0>
56 ret <4 x i32> %shuffle
58 define <4 x i32> @shuffle_v4i32_3210(<4 x i32> %a, <4 x i32> %b) {
59 ; ALL-LABEL: @shuffle_v4i32_3210
60 ; ALL: pshufd {{.*}} # xmm0 = xmm0[3,2,1,0]
62 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
63 ret <4 x i32> %shuffle
66 define <4 x i32> @shuffle_v4i32_2121(<4 x i32> %a, <4 x i32> %b) {
67 ; ALL-LABEL: @shuffle_v4i32_2121
68 ; ALL: pshufd {{.*}} # xmm0 = xmm0[2,1,2,1]
70 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 2, i32 1, i32 2, i32 1>
71 ret <4 x i32> %shuffle
74 define <4 x float> @shuffle_v4f32_0001(<4 x float> %a, <4 x float> %b) {
75 ; ALL-LABEL: @shuffle_v4f32_0001
76 ; ALL: shufps {{.*}} # xmm0 = xmm0[0,0,0,1]
78 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
79 ret <4 x float> %shuffle
81 define <4 x float> @shuffle_v4f32_0020(<4 x float> %a, <4 x float> %b) {
82 ; ALL-LABEL: @shuffle_v4f32_0020
83 ; ALL: shufps {{.*}} # xmm0 = xmm0[0,0,2,0]
85 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 0>
86 ret <4 x float> %shuffle
88 define <4 x float> @shuffle_v4f32_0300(<4 x float> %a, <4 x float> %b) {
89 ; ALL-LABEL: @shuffle_v4f32_0300
90 ; ALL: shufps {{.*}} # xmm0 = xmm0[0,3,0,0]
92 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 3, i32 0, i32 0>
93 ret <4 x float> %shuffle
95 define <4 x float> @shuffle_v4f32_1000(<4 x float> %a, <4 x float> %b) {
96 ; ALL-LABEL: @shuffle_v4f32_1000
97 ; ALL: shufps {{.*}} # xmm0 = xmm0[1,0,0,0]
99 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
100 ret <4 x float> %shuffle
102 define <4 x float> @shuffle_v4f32_2200(<4 x float> %a, <4 x float> %b) {
103 ; ALL-LABEL: @shuffle_v4f32_2200
104 ; ALL: shufps {{.*}} # xmm0 = xmm0[2,2,0,0]
106 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 2, i32 2, i32 0, i32 0>
107 ret <4 x float> %shuffle
109 define <4 x float> @shuffle_v4f32_3330(<4 x float> %a, <4 x float> %b) {
110 ; ALL-LABEL: @shuffle_v4f32_3330
111 ; ALL: shufps {{.*}} # xmm0 = xmm0[3,3,3,0]
113 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 3, i32 3, i32 3, i32 0>
114 ret <4 x float> %shuffle
116 define <4 x float> @shuffle_v4f32_3210(<4 x float> %a, <4 x float> %b) {
117 ; ALL-LABEL: @shuffle_v4f32_3210
118 ; ALL: shufps {{.*}} # xmm0 = xmm0[3,2,1,0]
120 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
121 ret <4 x float> %shuffle
123 define <4 x float> @shuffle_v4f32_0011(<4 x float> %a, <4 x float> %b) {
124 ; ALL-LABEL: @shuffle_v4f32_0011
125 ; ALL: unpcklps {{.*}} # xmm0 = xmm0[0,0,1,1]
127 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
128 ret <4 x float> %shuffle
130 define <4 x float> @shuffle_v4f32_2233(<4 x float> %a, <4 x float> %b) {
131 ; ALL-LABEL: @shuffle_v4f32_2233
132 ; ALL: unpckhps {{.*}} # xmm0 = xmm0[2,2,3,3]
134 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 2, i32 2, i32 3, i32 3>
135 ret <4 x float> %shuffle
137 define <4 x float> @shuffle_v4f32_0022(<4 x float> %a, <4 x float> %b) {
138 ; SSE2-LABEL: @shuffle_v4f32_0022
139 ; SSE2: shufps {{.*}} # xmm0 = xmm0[0,0,2,2]
142 ; SSE3-LABEL: @shuffle_v4f32_0022
143 ; SSE3: movsldup {{.*}} # xmm0 = xmm0[0,0,2,2]
146 ; SSE41-LABEL: @shuffle_v4f32_0022
147 ; SSE41: movsldup {{.*}} # xmm0 = xmm0[0,0,2,2]
150 ; AVX1-LABEL: @shuffle_v4f32_0022
151 ; AVX1: vmovsldup {{.*}} # xmm0 = xmm0[0,0,2,2]
153 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 0, i32 2, i32 2>
154 ret <4 x float> %shuffle
156 define <4 x float> @shuffle_v4f32_1133(<4 x float> %a, <4 x float> %b) {
157 ; SSE2-LABEL: @shuffle_v4f32_1133
158 ; SSE2: shufps {{.*}} # xmm0 = xmm0[1,1,3,3]
161 ; SSE3-LABEL: @shuffle_v4f32_1133
162 ; SSE3: movshdup {{.*}} # xmm0 = xmm0[1,1,3,3]
165 ; SSE41-LABEL: @shuffle_v4f32_1133
166 ; SSE41: movshdup {{.*}} # xmm0 = xmm0[1,1,3,3]
169 ; AVX1-LABEL: @shuffle_v4f32_1133
170 ; AVX1: vmovshdup {{.*}} # xmm0 = xmm0[1,1,3,3]
172 %shuffle = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 1, i32 1, i32 3, i32 3>
173 ret <4 x float> %shuffle
176 define <4 x i32> @shuffle_v4i32_0124(<4 x i32> %a, <4 x i32> %b) {
177 ; SSE2-LABEL: @shuffle_v4i32_0124
178 ; SSE2: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[2,0]
179 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[0,1],xmm1[2,0]
182 ; SSE3-LABEL: @shuffle_v4i32_0124
183 ; SSE3: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[2,0]
184 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[0,1],xmm1[2,0]
187 ; SSE41-LABEL: @shuffle_v4i32_0124
188 ; SSE41: insertps {{.*}} # xmm0 = xmm0[0,1,2],xmm1[0]
191 ; AVX1-LABEL: @shuffle_v4i32_0124
192 ; AVX1: vinsertps {{.*}} # xmm0 = xmm0[0,1,2],xmm1[0]
194 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
195 ret <4 x i32> %shuffle
197 define <4 x i32> @shuffle_v4i32_0142(<4 x i32> %a, <4 x i32> %b) {
198 ; ALL-LABEL: @shuffle_v4i32_0142
199 ; ALL: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[2,0]
200 ; ALL-NEXT: shufps {{.*}} # xmm0 = xmm0[0,1],xmm1[0,2]
202 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 2>
203 ret <4 x i32> %shuffle
205 define <4 x i32> @shuffle_v4i32_0412(<4 x i32> %a, <4 x i32> %b) {
206 ; SSE2-LABEL: @shuffle_v4i32_0412
207 ; SSE2: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
208 ; SSE2-NEXT: shufps {{.*}} # xmm1 = xmm1[2,0],xmm0[1,2]
209 ; SSE2-NEXT: movaps %xmm1, %xmm0
212 ; SSE3-LABEL: @shuffle_v4i32_0412
213 ; SSE3: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
214 ; SSE3-NEXT: shufps {{.*}} # xmm1 = xmm1[2,0],xmm0[1,2]
215 ; SSE3-NEXT: movaps %xmm1, %xmm0
218 ; SSE41-LABEL: @shuffle_v4i32_0412
219 ; SSE41: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
220 ; SSE41-NEXT: shufps {{.*}} # xmm1 = xmm1[2,0],xmm0[1,2]
221 ; SSE41-NEXT: movaps %xmm1, %xmm0
224 ; AVX1-LABEL: @shuffle_v4i32_0412
225 ; AVX1: vshufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
226 ; AVX1-NEXT: vshufps {{.*}} # xmm0 = xmm1[2,0],xmm0[1,2]
228 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 4, i32 1, i32 2>
229 ret <4 x i32> %shuffle
231 define <4 x i32> @shuffle_v4i32_4012(<4 x i32> %a, <4 x i32> %b) {
232 ; SSE2-LABEL: @shuffle_v4i32_4012
233 ; SSE2: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
234 ; SSE2-NEXT: shufps {{.*}} # xmm1 = xmm1[0,2],xmm0[1,2]
235 ; SSE2-NEXT: movaps %xmm1, %xmm0
238 ; SSE3-LABEL: @shuffle_v4i32_4012
239 ; SSE3: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
240 ; SSE3-NEXT: shufps {{.*}} # xmm1 = xmm1[0,2],xmm0[1,2]
241 ; SSE3-NEXT: movaps %xmm1, %xmm0
244 ; SSE41-LABEL: @shuffle_v4i32_4012
245 ; SSE41: shufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
246 ; SSE41-NEXT: shufps {{.*}} # xmm1 = xmm1[0,2],xmm0[1,2]
247 ; SSE41-NEXT: movaps %xmm1, %xmm0
250 ; AVX1-LABEL: @shuffle_v4i32_4012
251 ; AVX1: vshufps {{.*}} # xmm1 = xmm1[0,0],xmm0[0,0]
252 ; AVX1-NEXT: vshufps {{.*}} # xmm0 = xmm1[0,2],xmm0[1,2]
254 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 0, i32 1, i32 2>
255 ret <4 x i32> %shuffle
257 define <4 x i32> @shuffle_v4i32_0145(<4 x i32> %a, <4 x i32> %b) {
258 ; ALL-LABEL: @shuffle_v4i32_0145
259 ; ALL: punpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0]
261 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
262 ret <4 x i32> %shuffle
264 define <4 x i32> @shuffle_v4i32_0451(<4 x i32> %a, <4 x i32> %b) {
265 ; ALL-LABEL: @shuffle_v4i32_0451
266 ; ALL: shufps {{.*}} # xmm0 = xmm0[0,1],xmm1[0,1]
267 ; ALL-NEXT: shufps {{.*}} # xmm0 = xmm0[0,2,3,1]
269 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 4, i32 5, i32 1>
270 ret <4 x i32> %shuffle
272 define <4 x i32> @shuffle_v4i32_4501(<4 x i32> %a, <4 x i32> %b) {
273 ; SSE2-LABEL: @shuffle_v4i32_4501
274 ; SSE2: punpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0]
275 ; SSE2-NEXT: movdqa %xmm1, %xmm0
278 ; SSE3-LABEL: @shuffle_v4i32_4501
279 ; SSE3: punpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0]
280 ; SSE3-NEXT: movdqa %xmm1, %xmm0
283 ; SSE41-LABEL: @shuffle_v4i32_4501
284 ; SSE41: punpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0]
285 ; SSE41-NEXT: movdqa %xmm1, %xmm0
288 ; AVX1-LABEL: @shuffle_v4i32_4501
289 ; AVX1: punpcklqdq {{.*}} # xmm0 = xmm1[0],xmm0[0]
291 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 5, i32 0, i32 1>
292 ret <4 x i32> %shuffle
294 define <4 x i32> @shuffle_v4i32_4015(<4 x i32> %a, <4 x i32> %b) {
295 ; ALL-LABEL: @shuffle_v4i32_4015
296 ; ALL: shufps {{.*}} # xmm0 = xmm0[0,1],xmm1[0,1]
297 ; ALL-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0,1,3]
299 %shuffle = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 0, i32 1, i32 5>
300 ret <4 x i32> %shuffle
303 define <4 x float> @shuffle_v4f32_4zzz(<4 x float> %a) {
304 ; SSE2-LABEL: @shuffle_v4f32_4zzz
305 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
306 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][1,0]
307 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[0,2],[[X]][2,3]
310 ; SSE3-LABEL: @shuffle_v4f32_4zzz
311 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
312 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][1,0]
313 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[0,2],[[X]][2,3]
316 ; SSE41-LABEL: @shuffle_v4f32_4zzz
317 ; SSE41: xorps %[[X:xmm[0-9]+]], %[[X]]
318 ; SSE41-NEXT: blendps {{.*}} # [[X]] = xmm0[0],[[X]][1,2,3]
319 ; SSE41-NEXT: movaps %[[X]], %xmm0
322 ; AVX1-LABEL: @shuffle_v4f32_4zzz
323 ; AVX1: vxorps %[[X:xmm[0-9]+]], %[[X]]
324 ; AVX1-NEXT: vblendps {{.*}} # xmm0 = xmm0[0],[[X]][1,2,3]
326 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
327 ret <4 x float> %shuffle
330 define <4 x float> @shuffle_v4f32_z4zz(<4 x float> %a) {
331 ; SSE2-LABEL: @shuffle_v4f32_z4zz
332 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
333 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][2,0]
334 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][3,0]
337 ; SSE3-LABEL: @shuffle_v4f32_z4zz
338 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
339 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][2,0]
340 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][3,0]
343 ; SSE41-LABEL: @shuffle_v4f32_z4zz
344 ; SSE41: insertps {{.*}} # xmm0 = zero,xmm0[0],zero,zero
347 ; AVX1-LABEL: @shuffle_v4f32_z4zz
348 ; AVX1: vinsertps {{.*}} # xmm0 = zero,xmm0[0],zero,zero
350 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 2, i32 4, i32 3, i32 0>
351 ret <4 x float> %shuffle
354 define <4 x float> @shuffle_v4f32_zz4z(<4 x float> %a) {
355 ; SSE2-LABEL: @shuffle_v4f32_zz4z
356 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
357 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][0,0]
358 ; SSE2-NEXT: shufps {{.*}} # [[X]] = [[X]][0,0],xmm0[0,2]
359 ; SSE2-NEXT: movaps %[[X]], %xmm0
362 ; SSE3-LABEL: @shuffle_v4f32_zz4z
363 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
364 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[0,0],[[X]][0,0]
365 ; SSE3-NEXT: shufps {{.*}} # [[X]] = [[X]][0,0],xmm0[0,2]
366 ; SSE3-NEXT: movaps %[[X]], %xmm0
369 ; SSE41-LABEL: @shuffle_v4f32_zz4z
370 ; SSE41: insertps {{.*}} # xmm0 = zero,zero,xmm0[0],zero
373 ; AVX1-LABEL: @shuffle_v4f32_zz4z
374 ; AVX1: vinsertps {{.*}} # xmm0 = zero,zero,xmm0[0],zero
376 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 0, i32 0, i32 4, i32 0>
377 ret <4 x float> %shuffle
380 define <4 x float> @shuffle_v4f32_zuu4(<4 x float> %a) {
381 ; SSE2-LABEL: @shuffle_v4f32_zuu4
382 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
383 ; SSE2-NEXT: shufps {{.*}} # [[X]] = [[X]][0,1],xmm0[2,0]
384 ; SSE2-NEXT: movaps %[[X]], %xmm0
387 ; SSE3-LABEL: @shuffle_v4f32_zuu4
388 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
389 ; SSE3-NEXT: shufps {{.*}} # [[X]] = [[X]][0,1],xmm0[2,0]
390 ; SSE3-NEXT: movaps %[[X]], %xmm0
393 ; SSE41-LABEL: @shuffle_v4f32_zuu4
394 ; SSE41: insertps {{.*}} # xmm0 = zero,zero,zero,xmm0[0]
397 ; AVX1-LABEL: @shuffle_v4f32_zuu4
398 ; AVX1: vinsertps {{.*}} # xmm0 = zero,zero,zero,xmm0[0]
400 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 0, i32 undef, i32 undef, i32 4>
401 ret <4 x float> %shuffle
404 define <4 x float> @shuffle_v4f32_zzz7(<4 x float> %a) {
405 ; SSE2-LABEL: @shuffle_v4f32_zzz7
406 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
407 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[3,0],[[X]][2,0]
408 ; SSE2-NEXT: shufps {{.*}} # [[X]] = [[X]][0,1],xmm0[2,0]
409 ; SSE2-NEXT: movaps %[[X]], %xmm0
412 ; SSE3-LABEL: @shuffle_v4f32_zzz7
413 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
414 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[3,0],[[X]][2,0]
415 ; SSE3-NEXT: shufps {{.*}} # [[X]] = [[X]][0,1],xmm0[2,0]
416 ; SSE3-NEXT: movaps %[[X]], %xmm0
419 ; SSE41-LABEL: @shuffle_v4f32_zzz7
420 ; SSE41: xorps %[[X:xmm[0-9]+]], %[[X]]
421 ; SSE41-NEXT: blendps {{.*}} # [[X]] = [[X]][0,1,2],xmm0[3]
422 ; SSE41-NEXT: movaps %[[X]], %xmm0
425 ; AVX1-LABEL: @shuffle_v4f32_zzz7
426 ; AVX1: vxorps %[[X:xmm[0-9]+]], %[[X]]
427 ; AVX1-NEXT: vblendps {{.*}} # xmm0 = [[X]][0,1,2],xmm0[3]
429 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
430 ret <4 x float> %shuffle
433 define <4 x float> @shuffle_v4f32_z6zz(<4 x float> %a) {
434 ; SSE2-LABEL: @shuffle_v4f32_z6zz
435 ; SSE2: xorps %[[X:xmm[0-9]+]], %[[X]]
436 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][0,0]
437 ; SSE2-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][2,3]
440 ; SSE3-LABEL: @shuffle_v4f32_z6zz
441 ; SSE3: xorps %[[X:xmm[0-9]+]], %[[X]]
442 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][0,0]
443 ; SSE3-NEXT: shufps {{.*}} # xmm0 = xmm0[2,0],[[X]][2,3]
446 ; SSE41-LABEL: @shuffle_v4f32_z6zz
447 ; SSE41: insertps {{.*}} # xmm0 = zero,xmm0[2],zero,zero
450 ; AVX1-LABEL: @shuffle_v4f32_z6zz
451 ; AVX1: vinsertps {{.*}} # xmm0 = zero,xmm0[2],zero,zero
453 %shuffle = shufflevector <4 x float> zeroinitializer, <4 x float> %a, <4 x i32> <i32 0, i32 6, i32 2, i32 3>
454 ret <4 x float> %shuffle
457 define <4 x i32> @shuffle_v4i32_4zzz(i32 %i) {
458 ; ALL-LABEL: @shuffle_v4i32_4zzz
459 ; ALL: movd {{.*}}, %xmm0
461 %a = insertelement <4 x i32> undef, i32 %i, i32 0
462 %shuffle = shufflevector <4 x i32> zeroinitializer, <4 x i32> %a, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
463 ret <4 x i32> %shuffle
466 define <4 x i32> @shuffle_v4i32_z4zz(i32 %i) {
467 ; ALL-LABEL: @shuffle_v4i32_z4zz
468 ; ALL: movd {{.*}}, %xmm0
469 ; ALL-NEXT: pshufd {{.*}} # xmm0 = xmm0[1,0,1,1]
471 %a = insertelement <4 x i32> undef, i32 %i, i32 0
472 %shuffle = shufflevector <4 x i32> zeroinitializer, <4 x i32> %a, <4 x i32> <i32 2, i32 4, i32 3, i32 0>
473 ret <4 x i32> %shuffle
476 define <4 x i32> @shuffle_v4i32_zz4z(i32 %i) {
477 ; ALL-LABEL: @shuffle_v4i32_zz4z
478 ; ALL: movd {{.*}}, %xmm0
479 ; ALL-NEXT: pshufd {{.*}} # xmm0 = xmm0[1,1,0,1]
481 %a = insertelement <4 x i32> undef, i32 %i, i32 0
482 %shuffle = shufflevector <4 x i32> zeroinitializer, <4 x i32> %a, <4 x i32> <i32 0, i32 0, i32 4, i32 0>
483 ret <4 x i32> %shuffle
486 define <4 x i32> @shuffle_v4i32_zuu4(i32 %i) {
487 ; ALL-LABEL: @shuffle_v4i32_zuu4
488 ; ALL: movd {{.*}}, %xmm0
489 ; ALL-NEXT: pshufd {{.*}} # xmm0 = xmm0[1,1,1,0]
491 %a = insertelement <4 x i32> undef, i32 %i, i32 0
492 %shuffle = shufflevector <4 x i32> zeroinitializer, <4 x i32> %a, <4 x i32> <i32 0, i32 undef, i32 undef, i32 4>
493 ret <4 x i32> %shuffle
496 define <4 x i32> @shuffle_v4i32_z6zz(i32 %i) {
497 ; ALL-LABEL: @shuffle_v4i32_z6zz
498 ; ALL: movd {{.*}}, %xmm0
499 ; ALL-NEXT: pshufd {{.*}} # xmm0 = xmm0[1,0,1,1]
501 %a = insertelement <4 x i32> undef, i32 %i, i32 2
502 %shuffle = shufflevector <4 x i32> zeroinitializer, <4 x i32> %a, <4 x i32> <i32 0, i32 6, i32 2, i32 3>
503 ret <4 x i32> %shuffle