1 ; RUN: llc < %s -march=arm -mattr=+vfp2 -disable-post-ra | FileCheck %s
2 ; RUN: llc < %s -march=arm -mattr=+vfp2 -disable-post-ra -regalloc=basic | FileCheck %s
4 define void @test(float* %P, double* %D) {
5 %A = load float* %P ; <float> [#uses=1]
6 %B = load double* %D ; <double> [#uses=1]
7 store float %A, float* %P
8 store double %B, double* %D
12 declare float @fabsf(float)
14 declare double @fabs(double)
16 define void @test_abs(float* %P, double* %D) {
18 %a = load float* %P ; <float> [#uses=1]
20 %b = call float @fabsf( float %a ) ; <float> [#uses=1]
21 store float %b, float* %P
22 %A = load double* %D ; <double> [#uses=1]
24 %B = call double @fabs( double %A ) ; <double> [#uses=1]
25 store double %B, double* %D
29 define void @test_add(float* %P, double* %D) {
31 %a = load float* %P ; <float> [#uses=2]
32 %b = fadd float %a, %a ; <float> [#uses=1]
33 store float %b, float* %P
34 %A = load double* %D ; <double> [#uses=2]
35 %B = fadd double %A, %A ; <double> [#uses=1]
36 store double %B, double* %D
40 define void @test_ext_round(float* %P, double* %D) {
41 ;CHECK: test_ext_round:
42 %a = load float* %P ; <float> [#uses=1]
45 %b = fpext float %a to double ; <double> [#uses=1]
46 %A = load double* %D ; <double> [#uses=1]
47 %B = fptrunc double %A to float ; <float> [#uses=1]
48 store double %b, double* %D
49 store float %B, float* %P
53 define void @test_fma(float* %P1, float* %P2, float* %P3) {
55 %a1 = load float* %P1 ; <float> [#uses=1]
56 %a2 = load float* %P2 ; <float> [#uses=1]
57 %a3 = load float* %P3 ; <float> [#uses=1]
59 %X = fmul float %a1, %a2 ; <float> [#uses=1]
60 %Y = fsub float %X, %a3 ; <float> [#uses=1]
61 store float %Y, float* %P1
65 define i32 @test_ftoi(float* %P1) {
67 %a1 = load float* %P1 ; <float> [#uses=1]
69 %b1 = fptosi float %a1 to i32 ; <i32> [#uses=1]
73 define i32 @test_ftou(float* %P1) {
75 %a1 = load float* %P1 ; <float> [#uses=1]
77 %b1 = fptoui float %a1 to i32 ; <i32> [#uses=1]
81 define i32 @test_dtoi(double* %P1) {
83 %a1 = load double* %P1 ; <double> [#uses=1]
85 %b1 = fptosi double %a1 to i32 ; <i32> [#uses=1]
89 define i32 @test_dtou(double* %P1) {
91 %a1 = load double* %P1 ; <double> [#uses=1]
93 %b1 = fptoui double %a1 to i32 ; <i32> [#uses=1]
97 define void @test_utod(double* %P1, i32 %X) {
100 %b1 = uitofp i32 %X to double ; <double> [#uses=1]
101 store double %b1, double* %P1
105 define void @test_utod2(double* %P1, i8 %X) {
108 %b1 = uitofp i8 %X to double ; <double> [#uses=1]
109 store double %b1, double* %P1
113 define void @test_cmp(float* %glob, i32 %X) {
116 %tmp = load float* %glob ; <float> [#uses=2]
117 %tmp3 = getelementptr float* %glob, i32 2 ; <float*> [#uses=1]
118 %tmp4 = load float* %tmp3 ; <float> [#uses=2]
119 %tmp.upgrd.1 = fcmp oeq float %tmp, %tmp4 ; <i1> [#uses=1]
120 %tmp5 = fcmp uno float %tmp, %tmp4 ; <i1> [#uses=1]
121 %tmp6 = or i1 %tmp.upgrd.1, %tmp5 ; <i1> [#uses=1]
124 br i1 %tmp6, label %cond_true, label %cond_false
126 cond_true: ; preds = %entry
127 %tmp.upgrd.2 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
130 cond_false: ; preds = %entry
131 %tmp7 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]
135 declare i1 @llvm.isunordered.f32(float, float)
137 declare i32 @bar(...)
139 declare i32 @baz(...)
141 define void @test_cmpfp0(float* %glob, i32 %X) {
144 %tmp = load float* %glob ; <float> [#uses=1]
146 %tmp.upgrd.3 = fcmp ogt float %tmp, 0.000000e+00 ; <i1> [#uses=1]
147 br i1 %tmp.upgrd.3, label %cond_true, label %cond_false
149 cond_true: ; preds = %entry
150 %tmp.upgrd.4 = tail call i32 (...)* @bar( ) ; <i32> [#uses=0]
153 cond_false: ; preds = %entry
154 %tmp1 = tail call i32 (...)* @baz( ) ; <i32> [#uses=0]