1 ; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - | FileCheck %s --check-prefix=CHECK-VFP
2 ; RUN: llc -mtriple=arm-apple-darwin %s -o - | FileCheck %s
3 ; RUN: llc -mtriple=armv8r-none-none-eabi %s -o - | FileCheck %s --check-prefix=CHECK-VFP
4 ; RUN: llc -mtriple=armv8r-none-none-eabi -mattr=-fp64 %s -o - | FileCheck %s --check-prefix=CHECK-VFP-SP
6 define float @f1(double %x) {
8 ;CHECK-VFP: vcvt.f32.f64
9 ;CHECK-VFP-SP-LABEL: f1:
10 ;CHECK-VFP-SP: bl __aeabi_d2f
14 %tmp1 = fptrunc double %x to float ; <float> [#uses=1]
18 define double @f2(float %x) {
20 ;CHECK-VFP: vcvt.f64.f32
21 ;CHECK-VFP-SP-LABEL: f2:
22 ;CHECK-VFP-SP: bl __aeabi_f2d
26 %tmp1 = fpext float %x to double ; <double> [#uses=1]
30 define i32 @f3(float %x) {
32 ;CHECK-VFP: vcvt.s32.f32
33 ;CHECK-VFP-SP-LABEL: f3:
34 ;CHECK-VFP-SP: vcvt.s32.f32
38 %tmp = fptosi float %x to i32 ; <i32> [#uses=1]
42 define i32 @f4(float %x) {
44 ;CHECK-VFP: vcvt.u32.f32
45 ;CHECK-VFP-SP-LABEL: f4:
46 ;CHECK-VFP-SP: vcvt.u32.f32
50 %tmp = fptoui float %x to i32 ; <i32> [#uses=1]
54 define i32 @f5(double %x) {
56 ;CHECK-VFP: vcvt.s32.f64
57 ;CHECK-VFP-SP-LABEL: f5:
58 ;CHECK-VFP-SP: bl __aeabi_d2iz
62 %tmp = fptosi double %x to i32 ; <i32> [#uses=1]
66 define i32 @f6(double %x) {
68 ;CHECK-VFP: vcvt.u32.f64
69 ;CHECK-VFP-SP-LABEL: f6:
70 ;CHECK-VFP-SP: bl __aeabi_d2uiz
74 %tmp = fptoui double %x to i32 ; <i32> [#uses=1]
78 define float @f7(i32 %a) {
80 ;CHECK-VFP: vcvt.f32.s32
81 ;CHECK-VFP-SP-LABEL: f7:
82 ;CHECK-VFP-SP: vcvt.f32.s32
86 %tmp = sitofp i32 %a to float ; <float> [#uses=1]
90 define double @f8(i32 %a) {
92 ;CHECK-VFP: vcvt.f64.s32
93 ;CHECK-VFP-SP-LABEL: f8:
94 ;CHECK-VFP-SP: bl __aeabi_i2d
98 %tmp = sitofp i32 %a to double ; <double> [#uses=1]
102 define float @f9(i32 %a) {
103 ;CHECK-VFP-LABEL: f9:
104 ;CHECK-VFP: vcvt.f32.u32
105 ;CHECK-VFP-SP-LABEL: f9:
106 ;CHECK-VFP-SP: vcvt.f32.u32
110 %tmp = uitofp i32 %a to float ; <float> [#uses=1]
114 define double @f10(i32 %a) {
115 ;CHECK-VFP-LABEL: f10:
116 ;CHECK-VFP: vcvt.f64.u32
117 ;CHECK-VFP-SP-LABEL: f10:
118 ;CHECK-VFP-SP: bl __aeabi_ui2d
122 %tmp = uitofp i32 %a to double ; <double> [#uses=1]