1 ; RUN: llc -mtriple=arm-eabi -float-abi=soft -mattr=+vfp2 %s -o - | FileCheck %s 2 3 define float @f(i32 %a) { 4 ;CHECK-LABEL: f: 5 ;CHECK: vmov 6 ;CHECK-NEXT: vcvt.f32.s32 7 ;CHECK-NEXT: vmov 8 entry: 9 %tmp = sitofp i32 %a to float ; <float> [#uses=1] 10 ret float %tmp 11 } 12 13 define double @g(i32 %a) { 14 ;CHECK-LABEL: g: 15 ;CHECK: vmov 16 ;CHECK-NEXT: vcvt.f64.s32 17 ;CHECK-NEXT: vmov 18 entry: 19 %tmp = sitofp i32 %a to double ; <double> [#uses=1] 20 ret double %tmp 21 } 22 23 define double @uint_to_double(i32 %a) { 24 ;CHECK-LABEL: uint_to_double: 25 ;CHECK: vmov 26 ;CHECK-NEXT: vcvt.f64.u32 27 ;CHECK-NEXT: vmov 28 entry: 29 %tmp = uitofp i32 %a to double ; <double> [#uses=1] 30 ret double %tmp 31 } 32 33 define float @uint_to_float(i32 %a) { 34 ;CHECK-LABEL: uint_to_float: 35 ;CHECK: vmov 36 ;CHECK-NEXT: vcvt.f32.u32 37 ;CHECK-NEXT: vmov 38 entry: 39 %tmp = uitofp i32 %a to float ; <float> [#uses=1] 40 ret float %tmp 41 } 42 43 define double @h(double* %v) { 44 ;CHECK-LABEL: h: 45 ;CHECK: vldr 46 ;CHECK-NEXT: vmov 47 entry: 48 %tmp = load double, double* %v ; <double> [#uses=1] 49 ret double %tmp 50 } 51 52 define float @h2() { 53 ;CHECK-LABEL: h2: 54 ;CHECK: mov r0, #1065353216 55 entry: 56 ret float 1.000000e+00 57 } 58 59 define double @f2(double %a) { 60 ;CHECK-LABEL: f2: 61 ;CHECK-NOT: vmov 62 ret double %a 63 } 64 65 define void @f3() { 66 ;CHECK-LABEL: f3: 67 ;CHECK-NOT: vmov 68 ;CHECK: f4 69 entry: 70 %tmp = call double @f5( ) ; <double> [#uses=1] 71 call void @f4( double %tmp ) 72 ret void 73 } 74 75 declare void @f4(double) 76 77 declare double @f5() 78 79