OSDN Git Service

Add some tests for (conv (load x)) -> (load (conv*)x) xform.
[android-x86/external-llvm.git] / test / CodeGen / ARM / fptoint.ll
1 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrs
2 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | not grep fmrrd
3
4 @i = weak global i32 0          ; <i32*> [#uses=2]
5 @u = weak global i32 0          ; <i32*> [#uses=2]
6
7 define i32 @foo1(float *%x) {
8         %tmp1 = load float* %x
9         %tmp2 = bitcast float %tmp1 to i32
10         ret i32 %tmp2
11 }
12
13 define i64 @foo2(double *%x) {
14         %tmp1 = load double* %x
15         %tmp2 = bitcast double %tmp1 to i64
16         ret i64 %tmp2
17 }
18
19 define void @foo5(float %x) {
20         %tmp1 = fptosi float %x to i32
21         store i32 %tmp1, i32* @i
22         ret void
23 }
24
25 define void @foo6(float %x) {
26         %tmp1 = fptoui float %x to i32
27         store i32 %tmp1, i32* @u
28         ret void
29 }
30
31 define void @foo7(double %x) {
32         %tmp1 = fptosi double %x to i32
33         store i32 %tmp1, i32* @i
34         ret void
35 }
36
37 define void @foo8(double %x) {
38         %tmp1 = fptoui double %x to i32
39         store i32 %tmp1, i32* @u
40         ret void
41 }