blob: 9c4b773a6190904fb7826db61daa195682cd5325 [file] [log] [blame]
Chris Lattner11b3d162010-07-05 05:52:56 +00001; RUN: llc < %s -march=x86-64 -mcpu=penryn -asm-verbose=0 -o - | FileCheck %s -check-prefix=X64
Chris Lattner4fd1ab32010-07-05 03:56:55 +00002; RUN: llc < %s -mcpu=yonah -march=x86 -asm-verbose=0 -o - | FileCheck %s -check-prefix=X32
Chris Lattnere35d9842010-07-04 22:57:10 +00003
4; PR7518
5define void @test1(<2 x float> %Q, float *%P2) nounwind {
6 %a = extractelement <2 x float> %Q, i32 0
7 %b = extractelement <2 x float> %Q, i32 1
8 %c = fadd float %a, %b
9
10 store float %c, float* %P2
11 ret void
Chris Lattnerf172ecd2010-07-04 23:07:25 +000012; X64: test1:
13; X64-NEXT: addss %xmm1, %xmm0
14; X64-NEXT: movss %xmm0, (%rdi)
15; X64-NEXT: ret
16
17; X32: test1:
18; X32-NEXT: movss 4(%esp), %xmm0
19; X32-NEXT: addss 8(%esp), %xmm0
20; X32-NEXT: movl 12(%esp), %eax
21; X32-NEXT: movss %xmm0, (%eax)
22; X32-NEXT: ret
Chris Lattnere35d9842010-07-04 22:57:10 +000023}
24
Chris Lattner11b3d162010-07-05 05:52:56 +000025
26define <2 x float> @test2(<2 x float> %Q, <2 x float> %R, <2 x float> *%P) nounwind {
27 %Z = fadd <2 x float> %Q, %R
28 ret <2 x float> %Z
29
30; X64: test2:
31; X64-NEXT: insertps $0
32; X64-NEXT: insertps $16
33; X64-NEXT: insertps $0
34; X64-NEXT: insertps $16
35; X64-NEXT: addps
36; X64-NEXT: movaps
37; X64-NEXT: pshufd
38; X64-NEXT: ret
39}