Add inline(always) to rt functions

This commit is contained in:
Deadbeef 2022-09-01 18:53:17 +08:00
parent 58c8823e31
commit 65b685e82d
2 changed files with 4 additions and 0 deletions

View File

@ -1034,6 +1034,7 @@ impl f32 {
}
}
#[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491
fn rt_f32_to_u32(x: f32) -> u32 {
// SAFETY: `u32` is a plain old datatype so we can always... uh...
// ...look, just pretend you forgot what you just read.
@ -1125,6 +1126,7 @@ impl f32 {
}
}
#[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491
fn rt_u32_to_f32(x: u32) -> f32 {
// SAFETY: `u32` is a plain old datatype so we can always... uh...
// ...look, just pretend you forgot what you just read.

View File

@ -1027,6 +1027,7 @@ impl f64 {
}
}
#[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491
fn rt_f64_to_u64(rt: f64) -> u64 {
// SAFETY: `u64` is a plain old datatype so we can always... uh...
// ...look, just pretend you forgot what you just read.
@ -1123,6 +1124,7 @@ impl f64 {
}
}
#[inline(always)] // See https://github.com/rust-lang/compiler-builtins/issues/491
fn rt_u64_to_f64(rt: u64) -> f64 {
// SAFETY: `u64` is a plain old datatype so we can always... uh...
// ...look, just pretend you forgot what you just read.