@@ -80,6 +80,18 @@ intrinsics! {
8080 int_to_float!( i, i32 , f64 )
8181 }
8282
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+
8395 #[ use_c_shim_if( all( target_arch = "x86" , not( target_env = "msvc" ) ) ) ]
8496 #[ arm_aeabi_alias = __aeabi_l2d]
8597 pub extern "C" fn __floatdidf( i: i64 ) -> f64 {
@@ -112,6 +124,14 @@ intrinsics! {
112124 int_to_float!( i, u32 , f64 )
113125 }
114126
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+
115135 #[ use_c_shim_if( all( not( target_env = "msvc" ) ,
116136 any( target_arch = "x86" ,
117137 all( not( windows) , target_arch = "x86_64" ) ) ) ) ]
0 commit comments