1 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
2 ; RUN: grep fabs | count 2
3 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
4 ; RUN: grep fmscs | count 1
5 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
6 ; RUN: grep fcvt | count 2
7 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
8 ; RUN: grep fuito | count 2
9 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
10 ; RUN: grep fto.i | count 4
11 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
12 ; RUN: grep bmi | count 1
13 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
14 ; RUN: grep bgt | count 1
15 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | \
16 ; RUN: grep fcmpezs | count 1
18 define void @test(float* %P, double* %D) {
19 %A = load float* %P ; <float> [#uses=1]
20 %B = load double* %D ; <double> [#uses=1]
21 store float %A, float* %P
22 store double %B, double* %D
26 declare float @fabsf(float)
28 declare double @fabs(double)
30 define void @test_abs(float* %P, double* %D) {
31 %a = load float* %P ; <float> [#uses=1]
32 %b = call float @fabsf( float %a ) ; <float> [#uses=1]
33 store float %b, float* %P
34 %A = load double* %D ; <double> [#uses=1]
35 %B = call double @fabs( double %A ) ; <double> [#uses=1]
36 store double %B, double* %D
40 define void @test_add(float* %P, double* %D) {
41 %a = load float* %P ; <float> [#uses=2]
42 %b = fadd float %a, %a ; <float> [#uses=1]
43 store float %b, float* %P
44 %A = load double* %D ; <double> [#uses=2]
45 %B = fadd double %A, %A ; <double> [#uses=1]
46 store double %B, double* %D
50 define void @test_ext_round(float* %P, double* %D) {
51 %a = load float* %P ; <float> [#uses=1]
52 %b = fpext float %a to double ; <double> [#uses=1]
53 %A = load double* %D ; <double> [#uses=1]
54 %B = fptrunc double %A to float ; <float> [#uses=1]
55 store double %b, double* %D
56 store float %B, float* %P
60 define void @test_fma(float* %P1, float* %P2, float* %P3) {
61 %a1 = load float* %P1 ; <float> [#uses=1]
62 %a2 = load float* %P2 ; <float> [#uses=1]
63 %a3 = load float* %P3 ; <float> [#uses=1]
64 %X = fmul float %a1, %a2 ; <float> [#uses=1]
65 %Y = fsub float %X, %a3 ; <float> [#uses=1]
66 store float %Y, float* %P1
70 define i32 @test_ftoi(float* %P1) {
71 %a1 = load float* %P1 ; <float> [#uses=1]
72 %b1 = fptosi float %a1 to i32 ; <i32> [#uses=1]
76 define i32 @test_ftou(float* %P1) {
77 %a1 = load float* %P1 ; <float> [#uses=1]
78 %b1 = fptoui float %a1 to i32 ; <i32> [#uses=1]
82 define i32 @test_dtoi(double* %P1) {
83 %a1 = load double* %P1 ; <double> [#uses=1]
84 %b1 = fptosi double %a1 to i32 ; <i32> [#uses=1]
88 define i32 @test_dtou(double* %P1) {
89 %a1 = load double* %P1 ; <double> [#uses=1]
90 %b1 = fptoui double %a1 to i32 ; <i32> [#uses=1]
94 define void @test_utod(double* %P1, i32 %X) {
95 %b1 = uitofp i32 %X to double ; <double> [#uses=1]
96 store double %b1, double* %P1
100 define void @test_utod2(double* %P1, i8 %X) {
101 %b1 = uitofp i8 %X to double ; <double> [#uses=1]
102 store double %b1, double* %P1
106 define void @test_cmp(float* %glob, i32 %X) {
108 %tmp = load float* %glob ; <float> [#uses=2]
109 %tmp3 = getelementptr float* %glob, i32 2 ; <float*> [#uses=1]
110 %tmp4 = load float* %tmp3 ; <float> [#uses=2]
111 %tmp.upgrd.1 = fcmp oeq float %tmp, %tmp4 ; <i1> [#uses=1]
112 %tmp5 = fcmp uno float %tmp, %tmp4 ; <i1> [#uses=1]
113 %tmp6 = or i1 %tmp.upgrd.1, %tmp5 ; <i1> [#uses=1]
114 br i1 %tmp6, label %cond_true, label %cond_false
116 cond_true: ; preds = %entry
117 %tmp.upgrd.2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
120 cond_false: ; preds = %entry
121 %tmp7 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
125 declare i1 @llvm.isunordered.f32(float, float)
127 declare i32 @bar(...)
129 declare i32 @baz(...)
131 define void @test_cmpfp0(float* %glob, i32 %X) {
133 %tmp = load float* %glob ; <float> [#uses=1]
134 %tmp.upgrd.3 = fcmp ogt float %tmp, 0.000000e+00 ; <i1> [#uses=1]
135 br i1 %tmp.upgrd.3, label %cond_true, label %cond_false
137 cond_true: ; preds = %entry
138 %tmp.upgrd.4 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
141 cond_false: ; preds = %entry
142 %tmp1 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]