llvm.org GIT mirror llvm / 22b377c
[X86][SSE] Check vec_set BUILD_VECTOR tests on both 32 and 64-bit targets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302683 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim 2 years ago
10 changed file(s) with 204 addition(s) and 99 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,-sse4.1 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X64
23
34 define <4 x float> @test1(float %a) nounwind {
4 ; CHECK-LABEL: test1:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
7 ; CHECK-NEXT: retl
5 ; X86-LABEL: test1:
6 ; X86: # BB#0:
7 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
8 ; X86-NEXT: retl
9 ;
10 ; X64-LABEL: test1:
11 ; X64: # BB#0:
12 ; X64-NEXT: xorps %xmm1, %xmm1
13 ; X64-NEXT: movss {{.*#+}} xmm1 = xmm0[0],xmm1[1,2,3]
14 ; X64-NEXT: movaps %xmm1, %xmm0
15 ; X64-NEXT: retq
816 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 0
917 %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 1
1018 %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 2
1321 }
1422
1523 define <2 x i64> @test(i32 %a) nounwind {
16 ; CHECK-LABEL: test:
17 ; CHECK: # BB#0:
18 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
19 ; CHECK-NEXT: retl
24 ; X86-LABEL: test:
25 ; X86: # BB#0:
26 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
27 ; X86-NEXT: retl
28 ;
29 ; X64-LABEL: test:
30 ; X64: # BB#0:
31 ; X64-NEXT: movd %edi, %xmm0
32 ; X64-NEXT: retq
2033 %tmp = insertelement <4 x i32> zeroinitializer, i32 %a, i32 0
2134 %tmp6 = insertelement <4 x i32> %tmp, i32 0, i32 1
2235 %tmp8 = insertelement <4 x i32> %tmp6, i32 0, i32 2
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,+sse4.1 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,+sse4.1 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2,+sse4.1 | FileCheck %s --check-prefix=X64
23
34 define <4 x float> @test(float %a) {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: insertps {{.*#+}} xmm0 = zero,mem[0],zero,zero
7 ; CHECK-NEXT: retl
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: insertps {{.*#+}} xmm0 = zero,mem[0],zero,zero
8 ; X86-NEXT: retl
9 ;
10 ; X64-LABEL: test:
11 ; X64: # BB#0:
12 ; X64-NEXT: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero
13 ; X64-NEXT: retq
814 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1
915 %tmp5 = insertelement <4 x float> %tmp, float 0.000000e+00, i32 2
1016 %tmp6 = insertelement <4 x float> %tmp5, float 0.000000e+00, i32 3
1218 }
1319
1420 define <2 x i64> @test2(i32 %a) {
15 ; CHECK-LABEL: test2:
16 ; CHECK: # BB#0:
17 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
18 ; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,0,1]
19 ; CHECK-NEXT: retl
21 ; X86-LABEL: test2:
22 ; X86: # BB#0:
23 ; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
24 ; X86-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,0,1]
25 ; X86-NEXT: retl
26 ;
27 ; X64-LABEL: test2:
28 ; X64: # BB#0:
29 ; X64-NEXT: movd %edi, %xmm0
30 ; X64-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,0,1]
31 ; X64-NEXT: retq
2032 %tmp7 = insertelement <4 x i32> zeroinitializer, i32 %a, i32 2
2133 %tmp9 = insertelement <4 x i32> %tmp7, i32 0, i32 3
2234 %tmp10 = bitcast <4 x i32> %tmp9 to <2 x i64>
2436 }
2537
2638 define <4 x float> @test3(<4 x float> %A) {
27 ; CHECK-LABEL: test3:
28 ; CHECK: # BB#0:
29 ; CHECK-NEXT: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero
30 ; CHECK-NEXT: retl
39 ; X86-LABEL: test3:
40 ; X86: # BB#0:
41 ; X86-NEXT: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero
42 ; X86-NEXT: retl
43 ;
44 ; X64-LABEL: test3:
45 ; X64: # BB#0:
46 ; X64-NEXT: insertps {{.*#+}} xmm0 = zero,xmm0[0],zero,zero
47 ; X64-NEXT: retq
3148 %tmp0 = extractelement <4 x float> %A, i32 0
3249 %tmp1 = insertelement <4 x float> , float %tmp0, i32 1
3350 %tmp2 = insertelement <4 x float> %tmp1, float 0.000000e+00, i32 2
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
23
34 define <2 x i64> @test(i16 %a) nounwind {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: pxor %xmm0, %xmm0
7 ; CHECK-NEXT: pinsrw $3, {{[0-9]+}}(%esp), %xmm0
8 ; CHECK-NEXT: retl
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: pxor %xmm0, %xmm0
8 ; X86-NEXT: pinsrw $3, {{[0-9]+}}(%esp), %xmm0
9 ; X86-NEXT: retl
10 ;
11 ; X64-LABEL: test:
12 ; X64: # BB#0:
13 ; X64-NEXT: pxor %xmm0, %xmm0
14 ; X64-NEXT: pinsrw $3, %edi, %xmm0
15 ; X64-NEXT: retq
916 %tmp10 = insertelement <8 x i16> zeroinitializer, i16 %a, i32 3
1017 %tmp12 = insertelement <8 x i16> %tmp10, i16 0, i32 4
1118 %tmp14 = insertelement <8 x i16> %tmp12, i16 0, i32 5
1623 }
1724
1825 define <2 x i64> @test2(i8 %a) nounwind {
19 ; CHECK-LABEL: test2:
20 ; CHECK: # BB#0:
21 ; CHECK-NEXT: movzbl {{[0-9]+}}(%esp), %eax
22 ; CHECK-NEXT: pxor %xmm0, %xmm0
23 ; CHECK-NEXT: pinsrw $5, %eax, %xmm0
24 ; CHECK-NEXT: retl
26 ; X86-LABEL: test2:
27 ; X86: # BB#0:
28 ; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
29 ; X86-NEXT: pxor %xmm0, %xmm0
30 ; X86-NEXT: pinsrw $5, %eax, %xmm0
31 ; X86-NEXT: retl
32 ;
33 ; X64-LABEL: test2:
34 ; X64: # BB#0:
35 ; X64-NEXT: movzbl %dil, %eax
36 ; X64-NEXT: pxor %xmm0, %xmm0
37 ; X64-NEXT: pinsrw $5, %eax, %xmm0
38 ; X64-NEXT: retq
2539 %tmp24 = insertelement <16 x i8> zeroinitializer, i8 %a, i32 10
2640 %tmp26 = insertelement <16 x i8> %tmp24, i8 0, i32 11
2741 %tmp28 = insertelement <16 x i8> %tmp26, i8 0, i32 12
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,+sse4.1 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,+sse4.1 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2,+sse4.1 | FileCheck %s --check-prefix=X64
23
34 define <4 x float> @test(float %a, float %b, float %c) nounwind {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
7 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
8 ; CHECK-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,0],xmm1[0,1]
9 ; CHECK-NEXT: retl
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
8 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
9 ; X86-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,0],xmm1[0,1]
10 ; X86-NEXT: retl
11 ;
12 ; X64-LABEL: test:
13 ; X64: # BB#0:
14 ; X64-NEXT: unpcklps {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
15 ; X64-NEXT: xorps %xmm2, %xmm2
16 ; X64-NEXT: blendps {{.*#+}} xmm0 = xmm0[0],xmm2[1,2,3]
17 ; X64-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,0],xmm1[0,1]
18 ; X64-NEXT: retq
1019 %tmp = insertelement <4 x float> zeroinitializer, float %a, i32 1
1120 %tmp8 = insertelement <4 x float> %tmp, float %b, i32 2
1221 %tmp10 = insertelement <4 x float> %tmp8, float %c, i32 3
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
23
34 define <2 x i64> @test(<2 x i64>* %p) nounwind {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
7 ; CHECK-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
8 ; CHECK-NEXT: retl
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
8 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
9 ; X86-NEXT: retl
10 ;
11 ; X64-LABEL: test:
12 ; X64: # BB#0:
13 ; X64-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
14 ; X64-NEXT: retq
915 %tmp = bitcast <2 x i64>* %p to double*
1016 %tmp.upgrd.1 = load double, double* %tmp
1117 %tmp.upgrd.2 = insertelement <2 x double> undef, double %tmp.upgrd.1, i32 0
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X64
23
34 define <2 x i64> @test(i64 %i) nounwind {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movq %rdi, %xmm0
7 ; CHECK-NEXT: retq
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
8 ; X86-NEXT: retl
9 ;
10 ; X64-LABEL: test:
11 ; X64: # BB#0:
12 ; X64-NEXT: movq %rdi, %xmm0
13 ; X64-NEXT: retq
814 %tmp10 = insertelement <2 x i64> undef, i64 %i, i32 0
915 %tmp11 = insertelement <2 x i64> %tmp10, i64 0, i32 1
1016 ret <2 x i64> %tmp11
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
23
34 define <2 x i64> @test1() nounwind {
4 ; CHECK-LABEL: test1:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movl $1, %eax
7 ; CHECK-NEXT: movd %eax, %xmm0
8 ; CHECK-NEXT: retl
5 ; X86-LABEL: test1:
6 ; X86: # BB#0:
7 ; X86-NEXT: movl $1, %eax
8 ; X86-NEXT: movd %eax, %xmm0
9 ; X86-NEXT: retl
10 ;
11 ; X64-LABEL: test1:
12 ; X64: # BB#0:
13 ; X64-NEXT: movl $1, %eax
14 ; X64-NEXT: movq %rax, %xmm0
15 ; X64-NEXT: retq
916 ret <2 x i64> < i64 1, i64 0 >
1017 }
1118
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64
23
34 ; These should both generate something like this:
45 ;_test3:
89 ; ret
910
1011 define <2 x i64> @test3(i64 %arg) nounwind {
11 ; CHECK-LABEL: test3:
12 ; CHECK: # BB#0:
13 ; CHECK-NEXT: movl $1234567, %eax # imm = 0x12D687
14 ; CHECK-NEXT: andl {{[0-9]+}}(%esp), %eax
15 ; CHECK-NEXT: movd %eax, %xmm0
16 ; CHECK-NEXT: retl
12 ; X86-LABEL: test3:
13 ; X86: # BB#0:
14 ; X86-NEXT: movl $1234567, %eax # imm = 0x12D687
15 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
16 ; X86-NEXT: movd %eax, %xmm0
17 ; X86-NEXT: retl
18 ;
19 ; X64-LABEL: test3:
20 ; X64: # BB#0:
21 ; X64-NEXT: andl $1234567, %edi # imm = 0x12D687
22 ; X64-NEXT: movq %rdi, %xmm0
23 ; X64-NEXT: retq
1724 %A = and i64 %arg, 1234567
1825 %B = insertelement <2 x i64> zeroinitializer, i64 %A, i32 0
1926 ret <2 x i64> %B
2027 }
2128
2229 define <2 x i64> @test2(i64 %arg) nounwind {
23 ; CHECK-LABEL: test2:
24 ; CHECK: # BB#0:
25 ; CHECK-NEXT: movl $1234567, %eax # imm = 0x12D687
26 ; CHECK-NEXT: andl {{[0-9]+}}(%esp), %eax
27 ; CHECK-NEXT: movd %eax, %xmm0
28 ; CHECK-NEXT: retl
30 ; X86-LABEL: test2:
31 ; X86: # BB#0:
32 ; X86-NEXT: movl $1234567, %eax # imm = 0x12D687
33 ; X86-NEXT: andl {{[0-9]+}}(%esp), %eax
34 ; X86-NEXT: movd %eax, %xmm0
35 ; X86-NEXT: retl
36 ;
37 ; X64-LABEL: test2:
38 ; X64: # BB#0:
39 ; X64-NEXT: andl $1234567, %edi # imm = 0x12D687
40 ; X64-NEXT: movq %rdi, %xmm0
41 ; X64-NEXT: retq
2942 %A = and i64 %arg, 1234567
3043 %B = insertelement <2 x i64> undef, i64 %A, i32 0
3144 ret <2 x i64> %B
3245 }
33
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-linux-gnu -mattr=+sse2,-avx | FileCheck %s --check-prefix=X32
1 ; RUN: llc < %s -mtriple=i386-linux-gnu -mattr=+sse2,-avx | FileCheck %s --check-prefix=X86
22 ; RUN: llc < %s -mtriple=x86_64-pc-linux -mattr=+sse2,-avx | FileCheck %s --check-prefix=X64
33
44 define <2 x i64> @t1(i64 %x) nounwind {
5 ; X32-LABEL: t1:
6 ; X32: # BB#0:
7 ; X32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
8 ; X32-NEXT: retl
5 ; X86-LABEL: t1:
6 ; X86: # BB#0:
7 ; X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
8 ; X86-NEXT: retl
99 ;
1010 ; X64-LABEL: t1:
1111 ; X64: # BB#0:
0 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,-sse4.1 | FileCheck %s
1 ; RUN: llc < %s -mtriple=i386-unknown -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X86
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2,-sse4.1 | FileCheck %s --check-prefix=X64
23
34 define void @test(<8 x i16>* %b, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7) nounwind {
4 ; CHECK-LABEL: test:
5 ; CHECK: # BB#0:
6 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
7 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
8 ; CHECK-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
9 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
10 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
11 ; CHECK-NEXT: movd {{.*#+}} xmm2 = mem[0],zero,zero,zero
12 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
13 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
14 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
15 ; CHECK-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
16 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
17 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
18 ; CHECK-NEXT: movd {{.*#+}} xmm3 = mem[0],zero,zero,zero
19 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
20 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1],xmm3[2],xmm1[2],xmm3[3],xmm1[3]
21 ; CHECK-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3]
22 ; CHECK-NEXT: movdqa %xmm3, (%eax)
23 ; CHECK-NEXT: retl
5 ; X86-LABEL: test:
6 ; X86: # BB#0:
7 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
8 ; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
9 ; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
10 ; X86-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
11 ; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
12 ; X86-NEXT: movd {{.*#+}} xmm2 = mem[0],zero,zero,zero
13 ; X86-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
14 ; X86-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
15 ; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
16 ; X86-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
17 ; X86-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
18 ; X86-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
19 ; X86-NEXT: movd {{.*#+}} xmm3 = mem[0],zero,zero,zero
20 ; X86-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
21 ; X86-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1],xmm3[2],xmm1[2],xmm3[3],xmm1[3]
22 ; X86-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3]
23 ; X86-NEXT: movdqa %xmm3, (%eax)
24 ; X86-NEXT: retl
25 ;
26 ; X64-LABEL: test:
27 ; X64: # BB#0:
28 ; X64-NEXT: movd %r8d, %xmm0
29 ; X64-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
30 ; X64-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
31 ; X64-NEXT: movd %edx, %xmm1
32 ; X64-NEXT: movd {{.*#+}} xmm2 = mem[0],zero,zero,zero
33 ; X64-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
34 ; X64-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
35 ; X64-NEXT: movd %ecx, %xmm0
36 ; X64-NEXT: movd {{.*#+}} xmm2 = mem[0],zero,zero,zero
37 ; X64-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1],xmm0[2],xmm2[2],xmm0[3],xmm2[3]
38 ; X64-NEXT: movd %r9d, %xmm2
39 ; X64-NEXT: movd %esi, %xmm3
40 ; X64-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1],xmm3[2],xmm2[2],xmm3[3],xmm2[3]
41 ; X64-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
42 ; X64-NEXT: punpcklwd {{.*#+}} xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1],xmm3[2],xmm1[2],xmm3[3],xmm1[3]
43 ; X64-NEXT: movdqa %xmm3, (%rdi)
44 ; X64-NEXT: retq
2445 %tmp = insertelement <8 x i16> zeroinitializer, i16 %a0, i32 0
2546 %tmp2 = insertelement <8 x i16> %tmp, i16 %a1, i32 1
2647 %tmp4 = insertelement <8 x i16> %tmp2, i16 %a2, i32 2