about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs2
-rw-r--r--library/core/src/intrinsics.rs13
-rw-r--r--library/std/src/f32.rs2
-rw-r--r--library/std/src/f64.rs2
4 files changed, 12 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
index 4851c3fdcb7..ff9447a7484 100644
--- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
+++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs
@@ -295,6 +295,8 @@ fn codegen_float_intrinsic_call<'tcx>(
         sym::ceilf64 => ("ceil", 1, fx.tcx.types.f64),
         sym::truncf32 => ("truncf", 1, fx.tcx.types.f32),
         sym::truncf64 => ("trunc", 1, fx.tcx.types.f64),
+        sym::rintf32 => ("rintf", 1, fx.tcx.types.f32),
+        sym::rintf64 => ("rint", 1, fx.tcx.types.f64),
         sym::roundf32 => ("roundf", 1, fx.tcx.types.f32),
         sym::roundf64 => ("round", 1, fx.tcx.types.f64),
         sym::roundevenf32 => ("roundevenf", 1, fx.tcx.types.f32),
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs
index e331dfff6fd..dd84e546a84 100644
--- a/library/core/src/intrinsics.rs
+++ b/library/core/src/intrinsics.rs
@@ -1588,9 +1588,15 @@ extern "rust-intrinsic" {
 
     /// Returns the nearest integer to an `f32`. May raise an inexact floating-point exception
     /// if the argument is not an integer.
+    ///
+    /// The stabilized version of this intrinsic is
+    /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
     pub fn rintf32(x: f32) -> f32;
     /// Returns the nearest integer to an `f64`. May raise an inexact floating-point exception
     /// if the argument is not an integer.
+    ///
+    /// The stabilized version of this intrinsic is
+    /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
     pub fn rintf64(x: f64) -> f64;
 
     /// Returns the nearest integer to an `f32`.
@@ -1616,16 +1622,13 @@ extern "rust-intrinsic" {
     /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number
     /// with an even least significant digit.
     ///
-    /// The stabilized version of this intrinsic is
-    /// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
+    /// This intrinsic does not have a stable counterpart.
     #[cfg(not(bootstrap))]
     pub fn roundevenf32(x: f32) -> f32;
-
     /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number
     /// with an even least significant digit.
     ///
-    /// The stabilized version of this intrinsic is
-    /// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
+    /// This intrinsic does not have a stable counterpart.
     #[cfg(not(bootstrap))]
     pub fn roundevenf64(x: f64) -> f64;
 
diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs
index d92eb45e96c..221ad469de9 100644
--- a/library/std/src/f32.rs
+++ b/library/std/src/f32.rs
@@ -119,7 +119,7 @@ impl f32 {
     #[unstable(feature = "round_ties_even", issue = "96710")]
     #[inline]
     pub fn round_ties_even(self) -> f32 {
-        unsafe { intrinsics::roundevenf32(self) }
+        unsafe { intrinsics::rintf32(self) }
     }
 
     /// Returns the integer part of `self`.
diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs
index 2e98495fad3..4663e00f9ed 100644
--- a/library/std/src/f64.rs
+++ b/library/std/src/f64.rs
@@ -119,7 +119,7 @@ impl f64 {
     #[unstable(feature = "round_ties_even", issue = "96710")]
     #[inline]
     pub fn round_ties_even(self) -> f64 {
-        unsafe { intrinsics::roundevenf64(self) }
+        unsafe { intrinsics::rintf64(self) }
     }
 
     /// Returns the integer part of `self`.