1 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s
3 define void @test(float* %P, double* %D) {
4 %A = load float* %P ; <float> [#uses=1]
5 %B = load double* %D ; <double> [#uses=1]
6 store float %A, float* %P
7 store double %B, double* %D
11 declare float @fabsf(float)
13 declare double @fabs(double)
15 define void @test_abs(float* %P, double* %D) {
17 %a = load float* %P ; <float> [#uses=1]
19 %b = call float @fabsf( float %a ) ; <float> [#uses=1]
20 store float %b, float* %P
21 %A = load double* %D ; <double> [#uses=1]
23 %B = call double @fabs( double %A ) ; <double> [#uses=1]
24 store double %B, double* %D
28 define void @test_add(float* %P, double* %D) {
30 %a = load float* %P ; <float> [#uses=2]
31 %b = fadd float %a, %a ; <float> [#uses=1]
32 store float %b, float* %P
33 %A = load double* %D ; <double> [#uses=2]
34 %B = fadd double %A, %A ; <double> [#uses=1]
35 store double %B, double* %D
39 define void @test_ext_round(float* %P, double* %D) {
40 ;CHECK: test_ext_round:
41 %a = load float* %P ; <float> [#uses=1]
43 %b = fpext float %a to double ; <double> [#uses=1]
44 %A = load double* %D ; <double> [#uses=1]
46 %B = fptrunc double %A to float ; <float> [#uses=1]
47 store double %b, double* %D
48 store float %B, float* %P
52 define void @test_fma(float* %P1, float* %P2, float* %P3) {
54 %a1 = load float* %P1 ; <float> [#uses=1]
55 %a2 = load float* %P2 ; <float> [#uses=1]
56 %a3 = load float* %P3 ; <float> [#uses=1]
58 %X = fmul float %a1, %a2 ; <float> [#uses=1]
59 %Y = fsub float %X, %a3 ; <float> [#uses=1]
60 store float %Y, float* %P1
64 define i32 @test_ftoi(float* %P1) {
66 %a1 = load float* %P1 ; <float> [#uses=1]
68 %b1 = fptosi float %a1 to i32 ; <i32> [#uses=1]
72 define i32 @test_ftou(float* %P1) {
74 %a1 = load float* %P1 ; <float> [#uses=1]
76 %b1 = fptoui float %a1 to i32 ; <i32> [#uses=1]
80 define i32 @test_dtoi(double* %P1) {
82 %a1 = load double* %P1 ; <double> [#uses=1]
84 %b1 = fptosi double %a1 to i32 ; <i32> [#uses=1]
88 define i32 @test_dtou(double* %P1) {
90 %a1 = load double* %P1 ; <double> [#uses=1]
92 %b1 = fptoui double %a1 to i32 ; <i32> [#uses=1]
96 define void @test_utod(double* %P1, i32 %X) {
99 %b1 = uitofp i32 %X to double ; <double> [#uses=1]
100 store double %b1, double* %P1
104 define void @test_utod2(double* %P1, i8 %X) {
107 %b1 = uitofp i8 %X to double ; <double> [#uses=1]
108 store double %b1, double* %P1
112 define void @test_cmp(float* %glob, i32 %X) {
115 %tmp = load float* %glob ; <float> [#uses=2]
116 %tmp3 = getelementptr float* %glob, i32 2 ; <float*> [#uses=1]
117 %tmp4 = load float* %tmp3 ; <float> [#uses=2]
118 %tmp.upgrd.1 = fcmp oeq float %tmp, %tmp4 ; <i1> [#uses=1]
119 %tmp5 = fcmp uno float %tmp, %tmp4 ; <i1> [#uses=1]
120 %tmp6 = or i1 %tmp.upgrd.1, %tmp5 ; <i1> [#uses=1]
123 br i1 %tmp6, label %cond_true, label %cond_false
125 cond_true: ; preds = %entry
126 %tmp.upgrd.2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
129 cond_false: ; preds = %entry
130 %tmp7 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
134 declare i1 @llvm.isunordered.f32(float, float)
136 declare i32 @bar(...)
138 declare i32 @baz(...)
140 define void @test_cmpfp0(float* %glob, i32 %X) {
143 %tmp = load float* %glob ; <float> [#uses=1]
145 %tmp.upgrd.3 = fcmp ogt float %tmp, 0.000000e+00 ; <i1> [#uses=1]
146 br i1 %tmp.upgrd.3, label %cond_true, label %cond_false
148 cond_true: ; preds = %entry
149 %tmp.upgrd.4 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
152 cond_false: ; preds = %entry
153 %tmp1 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]