From 65b685e82d26600ac8b468ef58954526163dfdf2 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Thu, 1 Sep 2022 18:53:17 +0800 Subject: [PATCH] Add `inline(always)` to rt functions --- library/core/src/num/f32.rs | 2 ++ library/core/src/num/f64.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs index 6983d83808db8..c83b928efc18d 100644 --- a/library/core/src/num/f32.rs +++ b/library/core/src/num/f32.rs @@ -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. diff --git a/library/core/src/num/f64.rs b/library/core/src/num/f64.rs index ce64afc0bd892..28d23f733debd 100644 --- a/library/core/src/num/f64.rs +++ b/library/core/src/num/f64.rs @@ -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.