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: movshdup {{.*#+}} xmm1 = xmm0[1,1,3,3]
9 ; X64-NEXT: addss %xmm0, %xmm1
10 ; X64-NEXT: movss %xmm1, (%rdi)
15 ; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
16 ; X32-NEXT: movshdup {{.*#+}} xmm1 = xmm0[1,1,3,3]
17 ; X32-NEXT: addss %xmm0, %xmm1
18 ; X32-NEXT: movss %xmm1, (%eax)
20 %a = extractelement <2 x float> %Q, i32 0
21 %b = extractelement <2 x float> %Q, i32 1
22 %c = fadd float %a, %b
23 store float %c, float* %P2
27 define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind {
30 ; X64-NEXT: addps %xmm1, %xmm0
35 ; X32-NEXT: addps %xmm1, %xmm0
37 %Z = fadd <2 x float> %Q, %R
41 define <2 x float> @test3(<4 x float> %A) nounwind {
44 ; X64-NEXT: addps %xmm0, %xmm0
49 ; X32-NEXT: addps %xmm0, %xmm0
51 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
52 %C = fadd <2 x float> %B, %B
56 define <2 x float> @test4(<2 x float> %A) nounwind {
59 ; X64-NEXT: addps %xmm0, %xmm0
64 ; X32-NEXT: addps %xmm0, %xmm0
66 %C = fadd <2 x float> %A, %A
70 define <4 x float> @test5(<4 x float> %A) nounwind {
73 ; X64-NEXT: addps %xmm0, %xmm0
74 ; X64-NEXT: addps %xmm0, %xmm0
79 ; X32-NEXT: addps %xmm0, %xmm0
80 ; X32-NEXT: addps %xmm0, %xmm0
82 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
83 %C = fadd <2 x float> %B, %B
87 %D = fadd <2 x float> %C, %C
88 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>