@@ -80,6 +80,18 @@ intrinsics! {
80
80
int_to_float!( i, i32 , f64 )
81
81
}
82
82
83
+ #[ use_c_shim_if( all( target_arch = "x86" , not( target_env = "msvc" ) ) ) ]
84
+ #[ arm_aeabi_alias = __aeabi_l2f]
85
+ pub extern "C" fn __floatdisf( i: i64 ) -> f32 {
86
+ // On x86_64 LLVM will use native instructions for this conversion, we
87
+ // can just do it directly
88
+ if cfg!( target_arch = "x86_64" ) {
89
+ i as f32
90
+ } else {
91
+ int_to_float!( i, i64 , f32 )
92
+ }
93
+ }
94
+
83
95
#[ use_c_shim_if( all( target_arch = "x86" , not( target_env = "msvc" ) ) ) ]
84
96
#[ arm_aeabi_alias = __aeabi_l2d]
85
97
pub extern "C" fn __floatdidf( i: i64 ) -> f64 {
@@ -112,6 +124,14 @@ intrinsics! {
112
124
int_to_float!( i, u32 , f64 )
113
125
}
114
126
127
+ #[ use_c_shim_if( all( not( target_env = "msvc" ) ,
128
+ any( target_arch = "x86" ,
129
+ all( not( windows) , target_arch = "x86_64" ) ) ) ) ]
130
+ #[ arm_aeabi_alias = __aeabi_ul2f]
131
+ pub extern "C" fn __floatundisf( i: u64 ) -> f32 {
132
+ int_to_float!( i, u64 , f32 )
133
+ }
134
+
115
135
#[ use_c_shim_if( all( not( target_env = "msvc" ) ,
116
136
any( target_arch = "x86" ,
117
137
all( not( windows) , target_arch = "x86_64" ) ) ) ) ]
0 commit comments