1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=i686 -mattr=+sse | FileCheck %s
3 ; RUN: llc < %s -mcpu=i686 -mattr=-sse 2>&1 | FileCheck --check-prefix NOSSE %s
5 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
6 target triple = "i386-unknown-linux-gnu"
7 @f = external dso_local global float
8 @d = external dso_local global double
10 define void @test() nounwind {
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: subl $12, %esp
14 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
15 ; CHECK-NEXT: movss %xmm0, (%esp)
16 ; CHECK-NEXT: calll foo1@PLT
19 ; CHECK-NEXT: fstpl (%esp)
20 ; CHECK-NEXT: calll foo2@PLT
22 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
23 ; CHECK-NEXT: movss %xmm0, (%esp)
24 ; CHECK-NEXT: calll foo3@PLT
27 ; CHECK-NEXT: fstpl (%esp)
28 ; CHECK-NEXT: calll foo4@PLT
30 ; CHECK-NEXT: addl $12, %esp
34 ; NOSSE: # %bb.0: # %entry
35 ; NOSSE-NEXT: subl $12, %esp
37 ; NOSSE-NEXT: fstps (%esp)
38 ; NOSSE-NEXT: calll foo1@PLT
41 ; NOSSE-NEXT: fstpl (%esp)
42 ; NOSSE-NEXT: calll foo2@PLT
45 ; NOSSE-NEXT: fstps (%esp)
46 ; NOSSE-NEXT: calll foo3@PLT
49 ; NOSSE-NEXT: fstpl (%esp)
50 ; NOSSE-NEXT: calll foo4@PLT
52 ; NOSSE-NEXT: addl $12, %esp
55 %0 = load float, ptr @f, align 4
56 %1 = tail call inreg float @foo1(float inreg %0) nounwind
57 store float %1, ptr @f, align 4
58 %2 = load double, ptr @d, align 8
59 %3 = tail call inreg double @foo2(double inreg %2) nounwind
60 store double %3, ptr @d, align 8
61 %4 = load float, ptr @f, align 4
62 %5 = tail call inreg float @foo3(float inreg %4) nounwind
63 store float %5, ptr @f, align 4
64 %6 = load double, ptr @d, align 8
65 %7 = tail call inreg double @foo4(double inreg %6) nounwind
66 store double %7, ptr @d, align 8
70 declare inreg float @foo1(float inreg)
72 declare inreg double @foo2(double inreg)
74 declare inreg float @foo3(float inreg)
76 declare inreg double @foo4(double inreg)