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