@@ -2731,110 +2731,112 @@ pub unsafe fn truncf128(_x: f128) -> f128 {
2731
2731
unreachable ! ( )
2732
2732
}
2733
2733
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.
2741
2736
///
2742
2737
/// The stabilized version of this intrinsic is
2743
2738
/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
2744
2739
#[ rustc_intrinsic]
2745
2740
#[ rustc_intrinsic_must_be_overridden]
2746
2741
#[ 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 {
2748
2744
unreachable ! ( )
2749
2745
}
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.
2757
2763
///
2758
2764
/// The stabilized version of this intrinsic is
2759
2765
/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
2760
2766
#[ rustc_intrinsic]
2761
2767
#[ rustc_intrinsic_must_be_overridden]
2762
2768
#[ 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 {
2764
2771
unreachable ! ( )
2765
2772
}
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.
2773
2790
///
2774
2791
/// The stabilized version of this intrinsic is
2775
2792
/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
2776
2793
#[ rustc_intrinsic]
2777
2794
#[ rustc_intrinsic_must_be_overridden]
2778
2795
#[ 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 {
2780
2798
unreachable ! ( )
2781
2799
}
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.
2789
2817
///
2790
2818
/// The stabilized version of this intrinsic is
2791
2819
/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
2792
2820
#[ rustc_intrinsic]
2793
2821
#[ rustc_intrinsic_must_be_overridden]
2794
2822
#[ 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 {
2796
2825
unreachable ! ( )
2797
2826
}
2798
2827
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) }
2838
2840
}
2839
2841
2840
2842
/// 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 {
2878
2880
unreachable ! ( )
2879
2881
}
2880
2882
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
-
2922
2883
/// Float addition that allows optimizations based on algebraic rules.
2923
2884
/// May assume inputs are finite.
2924
2885
///
0 commit comments