1 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=penryn -o - | FileCheck %s --check-prefix=X64
2 ; RUN: llc < %s -mcpu=yonah -march=x86 -mtriple=i386-linux-gnu -o - | FileCheck %s --check-prefix=X32
5 define void @test1(<2 x float> %Q, float *%P2) nounwind {
8 ; X64-NEXT: movaps %xmm0, %xmm1
9 ; X64-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,2,3]
10 ; X64-NEXT: addss %xmm0, %xmm1
11 ; X64-NEXT: movss %xmm1, (%rdi)
16 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
17 ; X32-NEXT: movaps %xmm0, %xmm1
18 ; X32-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,2,3]
19 ; X32-NEXT: addss %xmm0, %xmm1
20 ; X32-NEXT: movss %xmm1, (%eax)
22 %a = extractelement <2 x float> %Q, i32 0
23 %b = extractelement <2 x float> %Q, i32 1
24 %c = fadd float %a, %b
25 store float %c, float* %P2
29 define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind {
32 ; X64-NEXT: addps %xmm1, %xmm0
37 ; X32-NEXT: addps %xmm1, %xmm0
39 %Z = fadd <2 x float> %Q, %R
43 define <2 x float> @test3(<4 x float> %A) nounwind {
46 ; X64-NEXT: addps %xmm0, %xmm0
51 ; X32-NEXT: addps %xmm0, %xmm0
53 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
54 %C = fadd <2 x float> %B, %B
58 define <2 x float> @test4(<2 x float> %A) nounwind {
61 ; X64-NEXT: addps %xmm0, %xmm0
66 ; X32-NEXT: addps %xmm0, %xmm0
68 %C = fadd <2 x float> %A, %A
72 define <4 x float> @test5(<4 x float> %A) nounwind {
75 ; X64-NEXT: addps %xmm0, %xmm0
76 ; X64-NEXT: addps %xmm0, %xmm0
81 ; X32-NEXT: addps %xmm0, %xmm0
82 ; X32-NEXT: addps %xmm0, %xmm0
84 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
85 %C = fadd <2 x float> %B, %B
89 %D = fadd <2 x float> %C, %C
90 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>