Deal with floatdidf on x86_64
Apparently LLVM will lower this down to just an instruction
This commit is contained in:
parent
5172f8c218
commit
a839d53a02
2
build.rs
2
build.rs
|
@ -4132,7 +4132,6 @@ mod c {
|
||||||
if target_arch == "x86_64" {
|
if target_arch == "x86_64" {
|
||||||
sources.extend(
|
sources.extend(
|
||||||
&[
|
&[
|
||||||
"x86_64/floatdidf.c",
|
|
||||||
"x86_64/floatdisf.c",
|
"x86_64/floatdisf.c",
|
||||||
"x86_64/floatdixf.c",
|
"x86_64/floatdixf.c",
|
||||||
],
|
],
|
||||||
|
@ -4148,7 +4147,6 @@ mod c {
|
||||||
&[
|
&[
|
||||||
"x86_64/chkstk.S",
|
"x86_64/chkstk.S",
|
||||||
"x86_64/chkstk2.S",
|
"x86_64/chkstk2.S",
|
||||||
"x86_64/floatdidf.c",
|
|
||||||
"x86_64/floatdisf.c",
|
"x86_64/floatdisf.c",
|
||||||
"x86_64/floatdixf.c",
|
"x86_64/floatdixf.c",
|
||||||
"x86_64/floatundidf.S",
|
"x86_64/floatundidf.S",
|
||||||
|
|
|
@ -78,13 +78,16 @@ intrinsics! {
|
||||||
int_to_float!(i, i32, f64)
|
int_to_float!(i, i32, f64)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[use_c_shim_if(any(
|
#[use_c_shim_if(all(target_arch = "x86", not(target_env = "msvc")))]
|
||||||
all(not(target_env = "msvc"), target_arch = "x86", target_arch = "x86_64"),
|
|
||||||
all(target_env = "msvc", target_arch = "x86_64"),
|
|
||||||
))]
|
|
||||||
pub extern "C" fn __floatdidf(i: i64) -> f64 {
|
pub extern "C" fn __floatdidf(i: i64) -> f64 {
|
||||||
|
// On x86_64 LLVM will use native instructions for this conversion, we
|
||||||
|
// can just do it directly
|
||||||
|
if cfg!(target_arch = "x86_64") {
|
||||||
|
i as f64
|
||||||
|
} else {
|
||||||
int_to_float!(i, i64, f64)
|
int_to_float!(i, i64, f64)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[unadjusted_on_win64]
|
#[unadjusted_on_win64]
|
||||||
pub extern "C" fn __floattisf(i: i128) -> f32 {
|
pub extern "C" fn __floattisf(i: i128) -> f32 {
|
||||||
|
|
Loading…
Reference in New Issue