1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=penryn | FileCheck %s --check-prefixes=CHECK,X64
3 ; RUN: llc < %s -mtriple=i386-linux-gnu -mcpu=yonah | FileCheck %s --check-prefixes=CHECK,X86
6 define void @test1(<2 x float> %Q, ptr%P2) nounwind {
9 ; X64-NEXT: movshdup {{.*#+}} xmm1 = xmm0[1,1,3,3]
10 ; X64-NEXT: addss %xmm0, %xmm1
11 ; X64-NEXT: movss %xmm1, (%rdi)
16 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
17 ; X86-NEXT: movshdup {{.*#+}} xmm1 = xmm0[1,1,3,3]
18 ; X86-NEXT: addss %xmm0, %xmm1
19 ; X86-NEXT: movss %xmm1, (%eax)
21 %a = extractelement <2 x float> %Q, i32 0
22 %b = extractelement <2 x float> %Q, i32 1
23 %c = fadd float %a, %b
24 store float %c, ptr %P2
28 define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, ptr%P) nounwind {
31 ; CHECK-NEXT: addps %xmm1, %xmm0
32 ; CHECK-NEXT: ret{{[l|q]}}
33 %Z = fadd <2 x float> %Q, %R
37 define <2 x float> @test3(<4 x float> %A) nounwind {
40 ; CHECK-NEXT: addps %xmm0, %xmm0
41 ; CHECK-NEXT: ret{{[l|q]}}
42 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
43 %C = fadd <2 x float> %B, %B
47 define <2 x float> @test4(<2 x float> %A) nounwind {
50 ; CHECK-NEXT: addps %xmm0, %xmm0
51 ; CHECK-NEXT: ret{{[l|q]}}
52 %C = fadd <2 x float> %A, %A
56 define <4 x float> @test5(<4 x float> %A) nounwind {
59 ; CHECK-NEXT: addps %xmm0, %xmm0
60 ; CHECK-NEXT: addps %xmm0, %xmm0
61 ; CHECK-NEXT: ret{{[l|q]}}
62 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
63 %C = fadd <2 x float> %B, %B
67 %D = fadd <2 x float> %C, %C
68 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>