1 ; RUN: llc < %s -mtriple=x86_64-linux -mcpu=penryn -asm-verbose=0 -o - | FileCheck %s -check-prefix=X64
2 ; RUN: llc < %s -mtriple=x86_64-win32 -mcpu=penryn -asm-verbose=0 -o - | FileCheck %s -check-prefix=W64
3 ; RUN: llc < %s -mcpu=yonah -march=x86 -asm-verbose=0 -o - | FileCheck %s -check-prefix=X32
6 define void @test1(<2 x float> %Q, float *%P2) nounwind {
7 %a = extractelement <2 x float> %Q, i32 0
8 %b = extractelement <2 x float> %Q, i32 1
11 store float %c, float* %P2
14 ; X64-NEXT: pshufd $1, %xmm0, %xmm1
15 ; X64-NEXT: addss %xmm0, %xmm1
16 ; X64-NEXT: movss %xmm1, (%rdi)
20 ; W64-NEXT: movdqa (%rcx), %xmm0
21 ; W64-NEXT: pshufd $1, %xmm0, %xmm1
22 ; W64-NEXT: addss %xmm0, %xmm1
23 ; W64-NEXT: movss %xmm1, (%rdx)
27 ; X32-NEXT: pshufd $1, %xmm0, %xmm1
28 ; X32-NEXT: addss %xmm0, %xmm1
29 ; X32-NEXT: movl 4(%esp), %eax
30 ; X32-NEXT: movss %xmm1, (%eax)
35 define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind {
36 %Z = fadd <2 x float> %Q, %R
40 ; X64-NEXT: addps %xmm1, %xmm0
44 ; W64-NEXT: movaps (%rcx), %xmm0
45 ; W64-NEXT: addps (%rdx), %xmm0
49 ; X32: addps %xmm1, %xmm0
53 define <2 x float> @test3(<4 x float> %A) nounwind {
54 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
55 %C = fadd <2 x float> %B, %B
58 ; X64-NEXT: addps %xmm0, %xmm0
62 ; W64-NEXT: movaps (%rcx), %xmm0
63 ; W64-NEXT: addps %xmm0, %xmm0
67 ; X32-NEXT: addps %xmm0, %xmm0
71 define <2 x float> @test4(<2 x float> %A) nounwind {
72 %C = fadd <2 x float> %A, %A
75 ; X64-NEXT: addps %xmm0, %xmm0
79 ; W64-NEXT: movaps (%rcx), %xmm0
80 ; W64-NEXT: addps %xmm0, %xmm0
84 ; X32-NEXT: addps %xmm0, %xmm0
88 define <4 x float> @test5(<4 x float> %A) nounwind {
89 %B = shufflevector <4 x float> %A, <4 x float> undef, <2 x i32> <i32 0, i32 1>
90 %C = fadd <2 x float> %B, %B
94 %D = fadd <2 x float> %C, %C
95 %E = shufflevector <2 x float> %D, <2 x float> undef, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
99 ; X64-NEXT: addps %xmm0, %xmm0
100 ; X64-NEXT: addps %xmm0, %xmm0
104 ; W64-NEXT: movaps (%rcx), %xmm0
105 ; W64-NEXT: addps %xmm0, %xmm0
106 ; W64-NEXT: addps %xmm0, %xmm0
110 ; X32-NEXT: addps %xmm0, %xmm0
111 ; X32-NEXT: addps %xmm0, %xmm0