• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=stfiwx | FileCheck %s
2; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin8 -mattr=-stfiwx | FileCheck -check-prefix=CHECK-LS %s
3
4define void @test1(float %a, i32* %b) nounwind {
5; CHECK-LABEL: @test1
6; CHECK-LS-LABEL: @test1
7        %tmp.2 = fptosi float %a to i32         ; <i32> [#uses=1]
8        store i32 %tmp.2, i32* %b
9        ret void
10
11; CHECK-NOT: lwz
12; CHECK-NOT: stw
13; CHECK: stfiwx
14; CHECK: blr
15
16; CHECK-LS: lwz
17; CHECK-LS: stw
18; CHECK-LS-NOT: stfiwx
19; CHECK-LS: blr
20}
21
22define void @test2(float %a, i32* %b, i32 %i) nounwind {
23; CHECK-LABEL: @test2
24; CHECK-LS-LABEL: @test2
25        %tmp.2 = getelementptr i32, i32* %b, i32 1           ; <i32*> [#uses=1]
26        %tmp.5 = getelementptr i32, i32* %b, i32 %i          ; <i32*> [#uses=1]
27        %tmp.7 = fptosi float %a to i32         ; <i32> [#uses=3]
28        store i32 %tmp.7, i32* %tmp.5
29        store i32 %tmp.7, i32* %tmp.2
30        store i32 %tmp.7, i32* %b
31        ret void
32
33; CHECK-NOT: lwz
34; CHECK-NOT: stw
35; CHECK: stfiwx
36; CHECK: blr
37
38; CHECK-LS: lwz
39; CHECK-LS: stw
40; CHECK-LS-NOT: stfiwx
41; CHECK-LS: blr
42}
43
44