@@ -2739,110 +2739,112 @@ pub unsafe fn truncf128(_x: f128) -> f128 {
2739
2739
unreachable ! ( )
2740
2740
}
2741
2741
2742
- /// Returns the nearest integer to an `f16`. Changing the rounding mode is not possible in Rust,
2743
- /// so this rounds half-way cases to the number with an even least significant digit.
2744
- ///
2745
- /// May raise an inexact floating-point exception if the argument is not an integer.
2746
- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2747
- /// cannot actually be utilized from Rust code.
2748
- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf16` and `roundevenf16`.
2742
+ /// Returns the nearest integer to an `f16`. Rounds half-way cases to the number with an even
2743
+ /// least significant digit.
2749
2744
///
2750
2745
/// The stabilized version of this intrinsic is
2751
2746
/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
2752
2747
#[ rustc_intrinsic]
2753
2748
#[ rustc_intrinsic_must_be_overridden]
2754
2749
#[ rustc_nounwind]
2755
- pub unsafe fn rintf16 ( _x : f16 ) -> f16 {
2750
+ #[ cfg( not( bootstrap) ) ]
2751
+ pub unsafe fn round_ties_even_f16 ( _x : f16 ) -> f16 {
2756
2752
unreachable ! ( )
2757
2753
}
2758
- /// Returns the nearest integer to an `f32`. Changing the rounding mode is not possible in Rust,
2759
- /// so this rounds half-way cases to the number with an even least significant digit.
2760
- ///
2761
- /// May raise an inexact floating-point exception if the argument is not an integer.
2762
- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2763
- /// cannot actually be utilized from Rust code.
2764
- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf32` and `roundevenf32`.
2754
+
2755
+ /// To be removed on next bootstrap bump.
2756
+ #[ cfg( bootstrap) ]
2757
+ pub unsafe fn round_ties_even_f16 ( x : f16 ) -> f16 {
2758
+ #[ rustc_intrinsic]
2759
+ #[ rustc_intrinsic_must_be_overridden]
2760
+ #[ rustc_nounwind]
2761
+ unsafe fn rintf16 ( _x : f16 ) -> f16 {
2762
+ unreachable ! ( )
2763
+ }
2764
+
2765
+ // SAFETY: this intrinsic isn't actually unsafe
2766
+ unsafe { rintf16 ( x) }
2767
+ }
2768
+
2769
+ /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
2770
+ /// least significant digit.
2765
2771
///
2766
2772
/// The stabilized version of this intrinsic is
2767
2773
/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
2768
2774
#[ rustc_intrinsic]
2769
2775
#[ rustc_intrinsic_must_be_overridden]
2770
2776
#[ rustc_nounwind]
2771
- pub unsafe fn rintf32 ( _x : f32 ) -> f32 {
2777
+ #[ cfg( not( bootstrap) ) ]
2778
+ pub unsafe fn round_ties_even_f32 ( _x : f32 ) -> f32 {
2772
2779
unreachable ! ( )
2773
2780
}
2774
- /// Returns the nearest integer to an `f64`. Changing the rounding mode is not possible in Rust,
2775
- /// so this rounds half-way cases to the number with an even least significant digit.
2776
- ///
2777
- /// May raise an inexact floating-point exception if the argument is not an integer.
2778
- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2779
- /// cannot actually be utilized from Rust code.
2780
- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf64` and `roundevenf64`.
2781
+
2782
+ /// To be removed on next bootstrap bump.
2783
+ #[ cfg( bootstrap) ]
2784
+ pub unsafe fn round_ties_even_f32 ( x : f32 ) -> f32 {
2785
+ #[ rustc_intrinsic]
2786
+ #[ rustc_intrinsic_must_be_overridden]
2787
+ #[ rustc_nounwind]
2788
+ unsafe fn rintf32 ( _x : f32 ) -> f32 {
2789
+ unreachable ! ( )
2790
+ }
2791
+
2792
+ // SAFETY: this intrinsic isn't actually unsafe
2793
+ unsafe { rintf32 ( x) }
2794
+ }
2795
+
2796
+ /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number with an even
2797
+ /// least significant digit.
2781
2798
///
2782
2799
/// The stabilized version of this intrinsic is
2783
2800
/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
2784
2801
#[ rustc_intrinsic]
2785
2802
#[ rustc_intrinsic_must_be_overridden]
2786
2803
#[ rustc_nounwind]
2787
- pub unsafe fn rintf64 ( _x : f64 ) -> f64 {
2804
+ #[ cfg( not( bootstrap) ) ]
2805
+ pub unsafe fn round_ties_even_f64 ( _x : f64 ) -> f64 {
2788
2806
unreachable ! ( )
2789
2807
}
2790
- /// Returns the nearest integer to an `f128`. Changing the rounding mode is not possible in Rust,
2791
- /// so this rounds half-way cases to the number with an even least significant digit.
2792
- ///
2793
- /// May raise an inexact floating-point exception if the argument is not an integer.
2794
- /// However, Rust assumes floating-point exceptions cannot be observed, so these exceptions
2795
- /// cannot actually be utilized from Rust code.
2796
- /// In other words, this intrinsic is equivalent in behavior to `nearbyintf128` and `roundevenf128`.
2808
+
2809
+ /// To be removed on next bootstrap bump.
2810
+ #[ cfg( bootstrap) ]
2811
+ pub unsafe fn round_ties_even_f64 ( x : f64 ) -> f64 {
2812
+ #[ rustc_intrinsic]
2813
+ #[ rustc_intrinsic_must_be_overridden]
2814
+ #[ rustc_nounwind]
2815
+ unsafe fn rintf64 ( _x : f64 ) -> f64 {
2816
+ unreachable ! ( )
2817
+ }
2818
+
2819
+ // SAFETY: this intrinsic isn't actually unsafe
2820
+ unsafe { rintf64 ( x) }
2821
+ }
2822
+
2823
+ /// Returns the nearest integer to an `f128`. Rounds half-way cases to the number with an even
2824
+ /// least significant digit.
2797
2825
///
2798
2826
/// The stabilized version of this intrinsic is
2799
2827
/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
2800
2828
#[ rustc_intrinsic]
2801
2829
#[ rustc_intrinsic_must_be_overridden]
2802
2830
#[ rustc_nounwind]
2803
- pub unsafe fn rintf128 ( _x : f128 ) -> f128 {
2831
+ #[ cfg( not( bootstrap) ) ]
2832
+ pub unsafe fn round_ties_even_f128 ( _x : f128 ) -> f128 {
2804
2833
unreachable ! ( )
2805
2834
}
2806
2835
2807
- /// Returns the nearest integer to an `f16`. Changing the rounding mode is not possible in Rust,
2808
- /// so this rounds half-way cases to the number with an even least significant digit.
2809
- ///
2810
- /// This intrinsic does not have a stable counterpart.
2811
- #[ rustc_intrinsic]
2812
- #[ rustc_intrinsic_must_be_overridden]
2813
- #[ rustc_nounwind]
2814
- pub unsafe fn nearbyintf16 ( _x : f16 ) -> f16 {
2815
- unreachable ! ( )
2816
- }
2817
- /// Returns the nearest integer to an `f32`. Changing the rounding mode is not possible in Rust,
2818
- /// so this rounds half-way cases to the number with an even least significant digit.
2819
- ///
2820
- /// This intrinsic does not have a stable counterpart.
2821
- #[ rustc_intrinsic]
2822
- #[ rustc_intrinsic_must_be_overridden]
2823
- #[ rustc_nounwind]
2824
- pub unsafe fn nearbyintf32 ( _x : f32 ) -> f32 {
2825
- unreachable ! ( )
2826
- }
2827
- /// Returns the nearest integer to an `f64`. Changing the rounding mode is not possible in Rust,
2828
- /// so this rounds half-way cases to the number with an even least significant digit.
2829
- ///
2830
- /// This intrinsic does not have a stable counterpart.
2831
- #[ rustc_intrinsic]
2832
- #[ rustc_intrinsic_must_be_overridden]
2833
- #[ rustc_nounwind]
2834
- pub unsafe fn nearbyintf64 ( _x : f64 ) -> f64 {
2835
- unreachable ! ( )
2836
- }
2837
- /// Returns the nearest integer to an `f128`. Changing the rounding mode is not possible in Rust,
2838
- /// so this rounds half-way cases to the number with an even least significant digit.
2839
- ///
2840
- /// This intrinsic does not have a stable counterpart.
2841
- #[ rustc_intrinsic]
2842
- #[ rustc_intrinsic_must_be_overridden]
2843
- #[ rustc_nounwind]
2844
- pub unsafe fn nearbyintf128 ( _x : f128 ) -> f128 {
2845
- unreachable ! ( )
2836
+ /// To be removed on next bootstrap bump.
2837
+ #[ cfg( bootstrap) ]
2838
+ pub unsafe fn round_ties_even_f128 ( x : f128 ) -> f128 {
2839
+ #[ rustc_intrinsic]
2840
+ #[ rustc_intrinsic_must_be_overridden]
2841
+ #[ rustc_nounwind]
2842
+ unsafe fn rintf128 ( _x : f128 ) -> f128 {
2843
+ unreachable ! ( )
2844
+ }
2845
+
2846
+ // SAFETY: this intrinsic isn't actually unsafe
2847
+ unsafe { rintf128 ( x) }
2846
2848
}
2847
2849
2848
2850
/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
@@ -2886,47 +2888,6 @@ pub unsafe fn roundf128(_x: f128) -> f128 {
2886
2888
unreachable ! ( )
2887
2889
}
2888
2890
2889
- /// Returns the nearest integer to an `f16`. Rounds half-way cases to the number
2890
- /// with an even least significant digit.
2891
- ///
2892
- /// This intrinsic does not have a stable counterpart.
2893
- #[ rustc_intrinsic]
2894
- #[ rustc_intrinsic_must_be_overridden]
2895
- #[ rustc_nounwind]
2896
- pub unsafe fn roundevenf16 ( _x : f16 ) -> f16 {
2897
- unreachable ! ( )
2898
- }
2899
- /// Returns the nearest integer to an `f32`. Rounds half-way cases to the number
2900
- /// with an even least significant digit.
2901
- ///
2902
- /// This intrinsic does not have a stable counterpart.
2903
- #[ rustc_intrinsic]
2904
- #[ rustc_intrinsic_must_be_overridden]
2905
- #[ rustc_nounwind]
2906
- pub unsafe fn roundevenf32 ( _x : f32 ) -> f32 {
2907
- unreachable ! ( )
2908
- }
2909
- /// Returns the nearest integer to an `f64`. Rounds half-way cases to the number
2910
- /// with an even least significant digit.
2911
- ///
2912
- /// This intrinsic does not have a stable counterpart.
2913
- #[ rustc_intrinsic]
2914
- #[ rustc_intrinsic_must_be_overridden]
2915
- #[ rustc_nounwind]
2916
- pub unsafe fn roundevenf64 ( _x : f64 ) -> f64 {
2917
- unreachable ! ( )
2918
- }
2919
- /// Returns the nearest integer to an `f128`. Rounds half-way cases to the number
2920
- /// with an even least significant digit.
2921
- ///
2922
- /// This intrinsic does not have a stable counterpart.
2923
- #[ rustc_intrinsic]
2924
- #[ rustc_intrinsic_must_be_overridden]
2925
- #[ rustc_nounwind]
2926
- pub unsafe fn roundevenf128 ( _x : f128 ) -> f128 {
2927
- unreachable ! ( )
2928
- }
2929
-
2930
2891
/// Float addition that allows optimizations based on algebraic rules.
2931
2892
/// May assume inputs are finite.
2932
2893
///
0 commit comments