@@ -2731,110 +2731,112 @@ pub unsafe fn truncf128(_x: f128) -> f128 {
27312731 unreachable ! ( )
27322732}
27332733
2734- /// Returns the nearest integer to an `f16`. Changing the rounding mode is not possible in Rust,
2735- /// so this rounds half-way cases to the number with an even least significant digit.
2736- ///
2737- /// May raise an inexact floating-point exception if the argument is not an integer.
2738- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2739- /// cannot actually be utilized from Rust code.
2740- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf16` and `roundevenf16`.
2734+ /// Returns the nearest integer to an `f16`. Rounds half-way cases to the number with an even
2735+ /// least significant digit.
27412736///
27422737/// The stabilized version of this intrinsic is
27432738/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
27442739#[ rustc_intrinsic]
27452740#[ rustc_intrinsic_must_be_overridden]
27462741#[ rustc_nounwind]
2747- pub unsafe fn rintf16 ( _x : f16 ) -> f16 {
2742+ #[ cfg( not( bootstrap) ) ]
2743+ pub unsafe fn round_ties_even_f16 ( _x : f16 ) -> f16 {
27482744 unreachable ! ( )
27492745}
2750- /// Returns the nearest integer to an `f32`. Changing the rounding mode is not possible in Rust,
2751- /// so this rounds half-way cases to the number with an even least significant digit.
2752- ///
2753- /// May raise an inexact floating-point exception if the argument is not an integer.
2754- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2755- /// cannot actually be utilized from Rust code.
2756- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf32` and `roundevenf32`.
2746+
2747+ /// To be removed on next bootstrap bump.
2748+ #[ cfg( bootstrap) ]
2749+ pub unsafe fn round_ties_even_f16 ( x : f16 ) -> f16 {
2750+ #[ rustc_intrinsic]
2751+ #[ rustc_intrinsic_must_be_overridden]
2752+ #[ rustc_nounwind]
2753+ unsafe fn rintf16 ( _x : f16 ) -> f16 {
2754+ unreachable ! ( )
2755+ }
2756+
2757+ // SAFETY: this intrinsic isn't actually unsafe
2758+ unsafe { rintf16 ( x) }
2759+ }
2760+
2761+ /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
2762+ /// least significant digit.
27572763///
27582764/// The stabilized version of this intrinsic is
27592765/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
27602766#[ rustc_intrinsic]
27612767#[ rustc_intrinsic_must_be_overridden]
27622768#[ rustc_nounwind]
2763- pub unsafe fn rintf32 ( _x : f32 ) -> f32 {
2769+ #[ cfg( not( bootstrap) ) ]
2770+ pub unsafe fn round_ties_even_f32 ( _x : f32 ) -> f32 {
27642771 unreachable ! ( )
27652772}
2766- /// Returns the nearest integer to an `f64`. Changing the rounding mode is not possible in Rust,
2767- /// so this rounds half-way cases to the number with an even least significant digit.
2768- ///
2769- /// May raise an inexact floating-point exception if the argument is not an integer.
2770- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2771- /// cannot actually be utilized from Rust code.
2772- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf64` and `roundevenf64`.
2773+
2774+ /// To be removed on next bootstrap bump.
2775+ #[ cfg( bootstrap) ]
2776+ pub unsafe fn round_ties_even_f32 ( x : f32 ) -> f32 {
2777+ #[ rustc_intrinsic]
2778+ #[ rustc_intrinsic_must_be_overridden]
2779+ #[ rustc_nounwind]
2780+ unsafe fn rintf32 ( _x : f32 ) -> f32 {
2781+ unreachable ! ( )
2782+ }
2783+
2784+ // SAFETY: this intrinsic isn't actually unsafe
2785+ unsafe { rintf32 ( x) }
2786+ }
2787+
2788+ /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number with an even
2789+ /// least significant digit.
27732790///
27742791/// The stabilized version of this intrinsic is
27752792/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
27762793#[ rustc_intrinsic]
27772794#[ rustc_intrinsic_must_be_overridden]
27782795#[ rustc_nounwind]
2779- pub unsafe fn rintf64 ( _x : f64 ) -> f64 {
2796+ #[ cfg( not( bootstrap) ) ]
2797+ pub unsafe fn round_ties_even_f64 ( _x : f64 ) -> f64 {
27802798 unreachable ! ( )
27812799}
2782- /// Returns the nearest integer to an `f128`. Changing the rounding mode is not possible in Rust,
2783- /// so this rounds half-way cases to the number with an even least significant digit.
2784- ///
2785- /// May raise an inexact floating-point exception if the argument is not an integer.
2786- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2787- /// cannot actually be utilized from Rust code.
2788- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf128` and `roundevenf128`.
2800+
2801+ /// To be removed on next bootstrap bump.
2802+ #[ cfg( bootstrap) ]
2803+ pub unsafe fn round_ties_even_f64 ( x : f64 ) -> f64 {
2804+ #[ rustc_intrinsic]
2805+ #[ rustc_intrinsic_must_be_overridden]
2806+ #[ rustc_nounwind]
2807+ unsafe fn rintf64 ( _x : f64 ) -> f64 {
2808+ unreachable ! ( )
2809+ }
2810+
2811+ // SAFETY: this intrinsic isn't actually unsafe
2812+ unsafe { rintf64 ( x) }
2813+ }
2814+
2815+ /// Returns the nearest integer to an `f128`. Rounds half-way cases to the number with an even
2816+ /// least significant digit.
27892817///
27902818/// The stabilized version of this intrinsic is
27912819/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
27922820#[ rustc_intrinsic]
27932821#[ rustc_intrinsic_must_be_overridden]
27942822#[ rustc_nounwind]
2795- pub unsafe fn rintf128 ( _x : f128 ) -> f128 {
2823+ #[ cfg( not( bootstrap) ) ]
2824+ pub unsafe fn round_ties_even_f128 ( _x : f128 ) -> f128 {
27962825 unreachable ! ( )
27972826}
27982827
2799- /// Returns the nearest integer to an `f16`. Changing the rounding mode is not possible in Rust,
2800- /// so this rounds half-way cases to the number with an even least significant digit.
2801- ///
2802- /// This intrinsic does not have a stable counterpart.
2803- #[ rustc_intrinsic]
2804- #[ rustc_intrinsic_must_be_overridden]
2805- #[ rustc_nounwind]
2806- pub unsafe fn nearbyintf16 ( _x : f16 ) -> f16 {
2807- unreachable ! ( )
2808- }
2809- /// Returns the nearest integer to an `f32`. Changing the rounding mode is not possible in Rust,
2810- /// so this rounds half-way cases to the number with an even least significant digit.
2811- ///
2812- /// This intrinsic does not have a stable counterpart.
2813- #[ rustc_intrinsic]
2814- #[ rustc_intrinsic_must_be_overridden]
2815- #[ rustc_nounwind]
2816- pub unsafe fn nearbyintf32 ( _x : f32 ) -> f32 {
2817- unreachable ! ( )
2818- }
2819- /// Returns the nearest integer to an `f64`. Changing the rounding mode is not possible in Rust,
2820- /// so this rounds half-way cases to the number with an even least significant digit.
2821- ///
2822- /// This intrinsic does not have a stable counterpart.
2823- #[ rustc_intrinsic]
2824- #[ rustc_intrinsic_must_be_overridden]
2825- #[ rustc_nounwind]
2826- pub unsafe fn nearbyintf64 ( _x : f64 ) -> f64 {
2827- unreachable ! ( )
2828- }
2829- /// Returns the nearest integer to an `f128`. Changing the rounding mode is not possible in Rust,
2830- /// so this rounds half-way cases to the number with an even least significant digit.
2831- ///
2832- /// This intrinsic does not have a stable counterpart.
2833- #[ rustc_intrinsic]
2834- #[ rustc_intrinsic_must_be_overridden]
2835- #[ rustc_nounwind]
2836- pub unsafe fn nearbyintf128 ( _x : f128 ) -> f128 {
2837- unreachable ! ( )
2828+ /// To be removed on next bootstrap bump.
2829+ #[ cfg( bootstrap) ]
2830+ pub unsafe fn round_ties_even_f128 ( x : f128 ) -> f128 {
2831+ #[ rustc_intrinsic]
2832+ #[ rustc_intrinsic_must_be_overridden]
2833+ #[ rustc_nounwind]
2834+ unsafe fn rintf128 ( _x : f128 ) -> f128 {
2835+ unreachable ! ( )
2836+ }
2837+
2838+ // SAFETY: this intrinsic isn't actually unsafe
2839+ unsafe { rintf128 ( x) }
28382840}
28392841
28402842/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
@@ -2878,47 +2880,6 @@ pub unsafe fn roundf128(_x: f128) -> f128 {
28782880 unreachable ! ( )
28792881}
28802882
2881- /// Returns the nearest integer to an `f16`. Rounds half-way cases to the number
2882- /// with an even least significant digit.
2883- ///
2884- /// This intrinsic does not have a stable counterpart.
2885- #[ rustc_intrinsic]
2886- #[ rustc_intrinsic_must_be_overridden]
2887- #[ rustc_nounwind]
2888- pub unsafe fn roundevenf16 ( _x : f16 ) -> f16 {
2889- unreachable ! ( )
2890- }
2891- /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number
2892- /// with an even least significant digit.
2893- ///
2894- /// This intrinsic does not have a stable counterpart.
2895- #[ rustc_intrinsic]
2896- #[ rustc_intrinsic_must_be_overridden]
2897- #[ rustc_nounwind]
2898- pub unsafe fn roundevenf32 ( _x : f32 ) -> f32 {
2899- unreachable ! ( )
2900- }
2901- /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number
2902- /// with an even least significant digit.
2903- ///
2904- /// This intrinsic does not have a stable counterpart.
2905- #[ rustc_intrinsic]
2906- #[ rustc_intrinsic_must_be_overridden]
2907- #[ rustc_nounwind]
2908- pub unsafe fn roundevenf64 ( _x : f64 ) -> f64 {
2909- unreachable ! ( )
2910- }
2911- /// Returns the nearest integer to an `f128`. Rounds half-way cases to the number
2912- /// with an even least significant digit.
2913- ///
2914- /// This intrinsic does not have a stable counterpart.
2915- #[ rustc_intrinsic]
2916- #[ rustc_intrinsic_must_be_overridden]
2917- #[ rustc_nounwind]
2918- pub unsafe fn roundevenf128 ( _x : f128 ) -> f128 {
2919- unreachable ! ( )
2920- }
2921-
29222883/// Float addition that allows optimizations based on algebraic rules.
29232884/// May assume inputs are finite.
29242885///
0 commit comments