1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=SSE,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse3 | FileCheck %s --check-prefixes=SSE,SSE3
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefixes=SSE,SSSE3
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE,SSE41
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2,+fast-variable-crosslane-shuffle,+fast-variable-perlane-shuffle | FileCheck %s --check-prefixes=AVX,AVX2
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2,+fast-variable-perlane-shuffle | FileCheck %s --check-prefixes=AVX,AVX2
11 define <2 x double> @insert_v2f64_z1(<2 x double> %a) {
12 ; SSE2-LABEL: insert_v2f64_z1:
14 ; SSE2-NEXT: xorpd %xmm1, %xmm1
15 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
18 ; SSE3-LABEL: insert_v2f64_z1:
20 ; SSE3-NEXT: xorpd %xmm1, %xmm1
21 ; SSE3-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
24 ; SSSE3-LABEL: insert_v2f64_z1:
26 ; SSSE3-NEXT: xorpd %xmm1, %xmm1
27 ; SSSE3-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
30 ; SSE41-LABEL: insert_v2f64_z1:
32 ; SSE41-NEXT: xorps %xmm1, %xmm1
33 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
36 ; AVX-LABEL: insert_v2f64_z1:
38 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
39 ; AVX-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
41 %1 = insertelement <2 x double> %a, double 0.0, i32 0
45 define <4 x double> @insert_v4f64_0zz3(<4 x double> %a) {
46 ; SSE2-LABEL: insert_v4f64_0zz3:
48 ; SSE2-NEXT: movq {{.*#+}} xmm0 = xmm0[0],zero
49 ; SSE2-NEXT: xorpd %xmm2, %xmm2
50 ; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
53 ; SSE3-LABEL: insert_v4f64_0zz3:
55 ; SSE3-NEXT: movq {{.*#+}} xmm0 = xmm0[0],zero
56 ; SSE3-NEXT: xorpd %xmm2, %xmm2
57 ; SSE3-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
60 ; SSSE3-LABEL: insert_v4f64_0zz3:
62 ; SSSE3-NEXT: movq {{.*#+}} xmm0 = xmm0[0],zero
63 ; SSSE3-NEXT: xorpd %xmm2, %xmm2
64 ; SSSE3-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
67 ; SSE41-LABEL: insert_v4f64_0zz3:
69 ; SSE41-NEXT: movq {{.*#+}} xmm0 = xmm0[0],zero
70 ; SSE41-NEXT: xorps %xmm2, %xmm2
71 ; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm2[0,1],xmm1[2,3]
74 ; AVX-LABEL: insert_v4f64_0zz3:
76 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
77 ; AVX-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1],ymm1[2,3,4,5],ymm0[6,7]
79 %1 = insertelement <4 x double> %a, double 0.0, i32 1
80 %2 = insertelement <4 x double> %1, double 0.0, i32 2
84 define <2 x i64> @insert_v2i64_z1(<2 x i64> %a) {
85 ; SSE2-LABEL: insert_v2i64_z1:
87 ; SSE2-NEXT: xorpd %xmm1, %xmm1
88 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
91 ; SSE3-LABEL: insert_v2i64_z1:
93 ; SSE3-NEXT: xorpd %xmm1, %xmm1
94 ; SSE3-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
97 ; SSSE3-LABEL: insert_v2i64_z1:
99 ; SSSE3-NEXT: xorpd %xmm1, %xmm1
100 ; SSSE3-NEXT: movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
103 ; SSE41-LABEL: insert_v2i64_z1:
105 ; SSE41-NEXT: xorps %xmm1, %xmm1
106 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
109 ; AVX-LABEL: insert_v2i64_z1:
111 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
112 ; AVX-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
114 %1 = insertelement <2 x i64> %a, i64 0, i32 0
118 define <4 x i64> @insert_v4i64_01z3(<4 x i64> %a) {
119 ; SSE2-LABEL: insert_v4i64_01z3:
121 ; SSE2-NEXT: xorpd %xmm2, %xmm2
122 ; SSE2-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
125 ; SSE3-LABEL: insert_v4i64_01z3:
127 ; SSE3-NEXT: xorpd %xmm2, %xmm2
128 ; SSE3-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
131 ; SSSE3-LABEL: insert_v4i64_01z3:
133 ; SSSE3-NEXT: xorpd %xmm2, %xmm2
134 ; SSSE3-NEXT: movsd {{.*#+}} xmm1 = xmm2[0],xmm1[1]
137 ; SSE41-LABEL: insert_v4i64_01z3:
139 ; SSE41-NEXT: xorps %xmm2, %xmm2
140 ; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm2[0,1],xmm1[2,3]
143 ; AVX-LABEL: insert_v4i64_01z3:
145 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
146 ; AVX-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
148 %1 = insertelement <4 x i64> %a, i64 0, i32 2
152 define <4 x float> @insert_v4f32_01z3(<4 x float> %a) {
153 ; SSE2-LABEL: insert_v4f32_01z3:
155 ; SSE2-NEXT: xorps %xmm1, %xmm1
156 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
157 ; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
160 ; SSE3-LABEL: insert_v4f32_01z3:
162 ; SSE3-NEXT: xorps %xmm1, %xmm1
163 ; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
164 ; SSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
167 ; SSSE3-LABEL: insert_v4f32_01z3:
169 ; SSSE3-NEXT: xorps %xmm1, %xmm1
170 ; SSSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
171 ; SSSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
174 ; SSE41-LABEL: insert_v4f32_01z3:
176 ; SSE41-NEXT: xorps %xmm1, %xmm1
177 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
180 ; AVX-LABEL: insert_v4f32_01z3:
182 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
183 ; AVX-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
185 %1 = insertelement <4 x float> %a, float 0.0, i32 2
189 define <8 x float> @insert_v8f32_z12345z7(<8 x float> %a) {
190 ; SSE2-LABEL: insert_v8f32_z12345z7:
192 ; SSE2-NEXT: xorps %xmm2, %xmm2
193 ; SSE2-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
194 ; SSE2-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
195 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
198 ; SSE3-LABEL: insert_v8f32_z12345z7:
200 ; SSE3-NEXT: xorps %xmm2, %xmm2
201 ; SSE3-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
202 ; SSE3-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
203 ; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
206 ; SSSE3-LABEL: insert_v8f32_z12345z7:
208 ; SSSE3-NEXT: xorps %xmm2, %xmm2
209 ; SSSE3-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
210 ; SSSE3-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
211 ; SSSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
214 ; SSE41-LABEL: insert_v8f32_z12345z7:
216 ; SSE41-NEXT: xorps %xmm2, %xmm2
217 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
218 ; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm1[0,1],xmm2[2],xmm1[3]
221 ; AVX-LABEL: insert_v8f32_z12345z7:
223 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
224 ; AVX-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5],ymm1[6],ymm0[7]
226 %1 = insertelement <8 x float> %a, float 0.0, i32 0
227 %2 = insertelement <8 x float> %1, float 0.0, i32 6
231 define <4 x i32> @insert_v4i32_01z3(<4 x i32> %a) {
232 ; SSE2-LABEL: insert_v4i32_01z3:
234 ; SSE2-NEXT: xorps %xmm1, %xmm1
235 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
236 ; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
239 ; SSE3-LABEL: insert_v4i32_01z3:
241 ; SSE3-NEXT: xorps %xmm1, %xmm1
242 ; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
243 ; SSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
246 ; SSSE3-LABEL: insert_v4i32_01z3:
248 ; SSSE3-NEXT: xorps %xmm1, %xmm1
249 ; SSSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
250 ; SSSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
253 ; SSE41-LABEL: insert_v4i32_01z3:
255 ; SSE41-NEXT: xorps %xmm1, %xmm1
256 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
259 ; AVX-LABEL: insert_v4i32_01z3:
261 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
262 ; AVX-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
264 %1 = insertelement <4 x i32> %a, i32 0, i32 2
268 define <8 x i32> @insert_v8i32_z12345z7(<8 x i32> %a) {
269 ; SSE2-LABEL: insert_v8i32_z12345z7:
271 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
272 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
275 ; SSE3-LABEL: insert_v8i32_z12345z7:
277 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
278 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
281 ; SSSE3-LABEL: insert_v8i32_z12345z7:
283 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
284 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
287 ; SSE41-LABEL: insert_v8i32_z12345z7:
289 ; SSE41-NEXT: xorps %xmm2, %xmm2
290 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
291 ; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm1[0,1],xmm2[2],xmm1[3]
294 ; AVX-LABEL: insert_v8i32_z12345z7:
296 ; AVX-NEXT: vxorps %xmm1, %xmm1, %xmm1
297 ; AVX-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5],ymm1[6],ymm0[7]
299 %1 = insertelement <8 x i32> %a, i32 0, i32 0
300 %2 = insertelement <8 x i32> %1, i32 0, i32 6
304 define <8 x i16> @insert_v8i16_z12345z7(<8 x i16> %a) {
305 ; SSE2-LABEL: insert_v8i16_z12345z7:
307 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
310 ; SSE3-LABEL: insert_v8i16_z12345z7:
312 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
315 ; SSSE3-LABEL: insert_v8i16_z12345z7:
317 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
320 ; SSE41-LABEL: insert_v8i16_z12345z7:
322 ; SSE41-NEXT: pxor %xmm1, %xmm1
323 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
326 ; AVX-LABEL: insert_v8i16_z12345z7:
328 ; AVX-NEXT: vpxor %xmm1, %xmm1, %xmm1
329 ; AVX-NEXT: vpblendw {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
331 %1 = insertelement <8 x i16> %a, i16 0, i32 0
332 %2 = insertelement <8 x i16> %1, i16 0, i32 6
336 define <16 x i16> @insert_v16i16_z12345z789ABCDEz(<16 x i16> %a) {
337 ; SSE2-LABEL: insert_v16i16_z12345z789ABCDEz:
339 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
340 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
343 ; SSE3-LABEL: insert_v16i16_z12345z789ABCDEz:
345 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
346 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
349 ; SSSE3-LABEL: insert_v16i16_z12345z789ABCDEz:
351 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
352 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
355 ; SSE41-LABEL: insert_v16i16_z12345z789ABCDEz:
357 ; SSE41-NEXT: pxor %xmm2, %xmm2
358 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3,4,5],xmm2[6],xmm0[7]
359 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3,4,5,6],xmm2[7]
362 ; AVX-LABEL: insert_v16i16_z12345z789ABCDEz:
364 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
366 %1 = insertelement <16 x i16> %a, i16 0, i32 0
367 %2 = insertelement <16 x i16> %1, i16 0, i32 6
368 %3 = insertelement <16 x i16> %2, i16 0, i32 15
372 define <16 x i8> @insert_v16i8_z123456789ABCDEz(<16 x i8> %a) {
373 ; SSE-LABEL: insert_v16i8_z123456789ABCDEz:
375 ; SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
378 ; AVX-LABEL: insert_v16i8_z123456789ABCDEz:
380 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
382 %1 = insertelement <16 x i8> %a, i8 0, i32 0
383 %2 = insertelement <16 x i8> %1, i8 0, i32 15
387 define <32 x i8> @insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz(<32 x i8> %a) {
388 ; SSE2-LABEL: insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz:
390 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
391 ; SSE2-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
394 ; SSE3-LABEL: insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz:
396 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
397 ; SSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
400 ; SSSE3-LABEL: insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz:
402 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
403 ; SSSE3-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
406 ; SSE41-LABEL: insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz:
408 ; SSE41-NEXT: pxor %xmm2, %xmm2
409 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3,4,5,6],xmm2[7]
410 ; SSE41-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
413 ; AVX-LABEL: insert_v32i8_z123456789ABCDEzGHIJKLMNOPQRSTzz:
415 ; AVX-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
417 %1 = insertelement <32 x i8> %a, i8 0, i32 0
418 %2 = insertelement <32 x i8> %1, i8 0, i32 15
419 %3 = insertelement <32 x i8> %2, i8 0, i32 30
420 %4 = insertelement <32 x i8> %3, i8 0, i32 31
424 define <4 x i32> @PR41512(i32 %x, i32 %y) {
425 ; SSE-LABEL: PR41512:
427 ; SSE-NEXT: movd %edi, %xmm0
428 ; SSE-NEXT: movd %esi, %xmm1
429 ; SSE-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
432 ; AVX-LABEL: PR41512:
434 ; AVX-NEXT: vmovd %edi, %xmm0
435 ; AVX-NEXT: vmovd %esi, %xmm1
436 ; AVX-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
438 %ins1 = insertelement <4 x i32> <i32 undef, i32 0, i32 undef, i32 undef>, i32 %x, i32 0
439 %ins2 = insertelement <4 x i32> <i32 undef, i32 0, i32 undef, i32 undef>, i32 %y, i32 0
440 %r = shufflevector <4 x i32> %ins1, <4 x i32> %ins2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
444 define <4 x i64> @PR41512_v4i64(i64 %x, i64 %y) {
445 ; SSE-LABEL: PR41512_v4i64:
447 ; SSE-NEXT: movq %rdi, %xmm0
448 ; SSE-NEXT: movq %rsi, %xmm1
451 ; AVX1-LABEL: PR41512_v4i64:
453 ; AVX1-NEXT: vmovq %rdi, %xmm0
454 ; AVX1-NEXT: vmovq %rsi, %xmm1
455 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
458 ; AVX2-LABEL: PR41512_v4i64:
460 ; AVX2-NEXT: vmovq %rdi, %xmm0
461 ; AVX2-NEXT: vmovq %rsi, %xmm1
462 ; AVX2-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
464 %ins1 = insertelement <4 x i64> <i64 undef, i64 0, i64 undef, i64 undef>, i64 %x, i32 0
465 %ins2 = insertelement <4 x i64> <i64 undef, i64 0, i64 undef, i64 undef>, i64 %y, i32 0
466 %r = shufflevector <4 x i64> %ins1, <4 x i64> %ins2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
470 define <8 x float> @PR41512_v8f32(float %x, float %y) {
471 ; SSE2-LABEL: PR41512_v8f32:
473 ; SSE2-NEXT: xorps %xmm2, %xmm2
474 ; SSE2-NEXT: xorps %xmm3, %xmm3
475 ; SSE2-NEXT: movss {{.*#+}} xmm3 = xmm0[0],xmm3[1,2,3]
476 ; SSE2-NEXT: movss {{.*#+}} xmm2 = xmm1[0],xmm2[1,2,3]
477 ; SSE2-NEXT: movaps %xmm3, %xmm0
478 ; SSE2-NEXT: movaps %xmm2, %xmm1
481 ; SSE3-LABEL: PR41512_v8f32:
483 ; SSE3-NEXT: xorps %xmm2, %xmm2
484 ; SSE3-NEXT: xorps %xmm3, %xmm3
485 ; SSE3-NEXT: movss {{.*#+}} xmm3 = xmm0[0],xmm3[1,2,3]
486 ; SSE3-NEXT: movss {{.*#+}} xmm2 = xmm1[0],xmm2[1,2,3]
487 ; SSE3-NEXT: movaps %xmm3, %xmm0
488 ; SSE3-NEXT: movaps %xmm2, %xmm1
491 ; SSSE3-LABEL: PR41512_v8f32:
493 ; SSSE3-NEXT: xorps %xmm2, %xmm2
494 ; SSSE3-NEXT: xorps %xmm3, %xmm3
495 ; SSSE3-NEXT: movss {{.*#+}} xmm3 = xmm0[0],xmm3[1,2,3]
496 ; SSSE3-NEXT: movss {{.*#+}} xmm2 = xmm1[0],xmm2[1,2,3]
497 ; SSSE3-NEXT: movaps %xmm3, %xmm0
498 ; SSSE3-NEXT: movaps %xmm2, %xmm1
501 ; SSE41-LABEL: PR41512_v8f32:
503 ; SSE41-NEXT: xorps %xmm2, %xmm2
504 ; SSE41-NEXT: blendps {{.*#+}} xmm0 = xmm0[0],xmm2[1,2,3]
505 ; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm1[0],xmm2[1,2,3]
508 ; AVX-LABEL: PR41512_v8f32:
510 ; AVX-NEXT: vxorps %xmm2, %xmm2, %xmm2
511 ; AVX-NEXT: vblendps {{.*#+}} xmm1 = xmm1[0],xmm2[1,2,3]
512 ; AVX-NEXT: vblendps {{.*#+}} xmm0 = xmm0[0],xmm2[1,2,3]
513 ; AVX-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
515 %ins1 = insertelement <8 x float> zeroinitializer, float %x, i32 0
516 %ins2 = insertelement <8 x float> zeroinitializer, float %y, i32 0
517 %r = shufflevector <8 x float> %ins1, <8 x float> %ins2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 10, i32 11>
521 define <4 x i32> @PR41512_loads(ptr %p1, ptr %p2) {
522 ; SSE-LABEL: PR41512_loads:
524 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
525 ; SSE-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
526 ; SSE-NEXT: movlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
529 ; AVX-LABEL: PR41512_loads:
531 ; AVX-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
532 ; AVX-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
533 ; AVX-NEXT: vmovlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]
535 %x = load i32, ptr %p1
536 %y = load i32, ptr %p2
537 %ins1 = insertelement <4 x i32> <i32 undef, i32 0, i32 undef, i32 undef>, i32 %x, i32 0
538 %ins2 = insertelement <4 x i32> <i32 undef, i32 0, i32 undef, i32 undef>, i32 %y, i32 0
539 %r = shufflevector <4 x i32> %ins1, <4 x i32> %ins2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>