@@ -2198,86 +2198,86 @@ pub unsafe fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;
21982198/// [`f16::floor`](../../std/primitive.f16.html#method.floor)
21992199#[ rustc_intrinsic]
22002200#[ rustc_nounwind]
2201- pub unsafe fn floorf16 ( x : f16 ) -> f16 ;
2201+ pub const unsafe fn floorf16 ( x : f16 ) -> f16 ;
22022202/// Returns the largest integer less than or equal to an `f32`.
22032203///
22042204/// The stabilized version of this intrinsic is
22052205/// [`f32::floor`](../../std/primitive.f32.html#method.floor)
22062206#[ rustc_intrinsic]
22072207#[ rustc_nounwind]
2208- pub unsafe fn floorf32 ( x : f32 ) -> f32 ;
2208+ pub const unsafe fn floorf32 ( x : f32 ) -> f32 ;
22092209/// Returns the largest integer less than or equal to an `f64`.
22102210///
22112211/// The stabilized version of this intrinsic is
22122212/// [`f64::floor`](../../std/primitive.f64.html#method.floor)
22132213#[ rustc_intrinsic]
22142214#[ rustc_nounwind]
2215- pub unsafe fn floorf64 ( x : f64 ) -> f64 ;
2215+ pub const unsafe fn floorf64 ( x : f64 ) -> f64 ;
22162216/// Returns the largest integer less than or equal to an `f128`.
22172217///
22182218/// The stabilized version of this intrinsic is
22192219/// [`f128::floor`](../../std/primitive.f128.html#method.floor)
22202220#[ rustc_intrinsic]
22212221#[ rustc_nounwind]
2222- pub unsafe fn floorf128 ( x : f128 ) -> f128 ;
2222+ pub const unsafe fn floorf128 ( x : f128 ) -> f128 ;
22232223
22242224/// Returns the smallest integer greater than or equal to an `f16`.
22252225///
22262226/// The stabilized version of this intrinsic is
22272227/// [`f16::ceil`](../../std/primitive.f16.html#method.ceil)
22282228#[ rustc_intrinsic]
22292229#[ rustc_nounwind]
2230- pub unsafe fn ceilf16 ( x : f16 ) -> f16 ;
2230+ pub const unsafe fn ceilf16 ( x : f16 ) -> f16 ;
22312231/// Returns the smallest integer greater than or equal to an `f32`.
22322232///
22332233/// The stabilized version of this intrinsic is
22342234/// [`f32::ceil`](../../std/primitive.f32.html#method.ceil)
22352235#[ rustc_intrinsic]
22362236#[ rustc_nounwind]
2237- pub unsafe fn ceilf32 ( x : f32 ) -> f32 ;
2237+ pub const unsafe fn ceilf32 ( x : f32 ) -> f32 ;
22382238/// Returns the smallest integer greater than or equal to an `f64`.
22392239///
22402240/// The stabilized version of this intrinsic is
22412241/// [`f64::ceil`](../../std/primitive.f64.html#method.ceil)
22422242#[ rustc_intrinsic]
22432243#[ rustc_nounwind]
2244- pub unsafe fn ceilf64 ( x : f64 ) -> f64 ;
2244+ pub const unsafe fn ceilf64 ( x : f64 ) -> f64 ;
22452245/// Returns the smallest integer greater than or equal to an `f128`.
22462246///
22472247/// The stabilized version of this intrinsic is
22482248/// [`f128::ceil`](../../std/primitive.f128.html#method.ceil)
22492249#[ rustc_intrinsic]
22502250#[ rustc_nounwind]
2251- pub unsafe fn ceilf128 ( x : f128 ) -> f128 ;
2251+ pub const unsafe fn ceilf128 ( x : f128 ) -> f128 ;
22522252
22532253/// Returns the integer part of an `f16`.
22542254///
22552255/// The stabilized version of this intrinsic is
22562256/// [`f16::trunc`](../../std/primitive.f16.html#method.trunc)
22572257#[ rustc_intrinsic]
22582258#[ rustc_nounwind]
2259- pub unsafe fn truncf16 ( x : f16 ) -> f16 ;
2259+ pub const unsafe fn truncf16 ( x : f16 ) -> f16 ;
22602260/// Returns the integer part of an `f32`.
22612261///
22622262/// The stabilized version of this intrinsic is
22632263/// [`f32::trunc`](../../std/primitive.f32.html#method.trunc)
22642264#[ rustc_intrinsic]
22652265#[ rustc_nounwind]
2266- pub unsafe fn truncf32 ( x : f32 ) -> f32 ;
2266+ pub const unsafe fn truncf32 ( x : f32 ) -> f32 ;
22672267/// Returns the integer part of an `f64`.
22682268///
22692269/// The stabilized version of this intrinsic is
22702270/// [`f64::trunc`](../../std/primitive.f64.html#method.trunc)
22712271#[ rustc_intrinsic]
22722272#[ rustc_nounwind]
2273- pub unsafe fn truncf64 ( x : f64 ) -> f64 ;
2273+ pub const unsafe fn truncf64 ( x : f64 ) -> f64 ;
22742274/// Returns the integer part of an `f128`.
22752275///
22762276/// The stabilized version of this intrinsic is
22772277/// [`f128::trunc`](../../std/primitive.f128.html#method.trunc)
22782278#[ rustc_intrinsic]
22792279#[ rustc_nounwind]
2280- pub unsafe fn truncf128 ( x : f128 ) -> f128 ;
2280+ pub const unsafe fn truncf128 ( x : f128 ) -> f128 ;
22812281
22822282/// Returns the nearest integer to an `f16`. Rounds half-way cases to the number with an even
22832283/// least significant digit.
@@ -2286,7 +2286,7 @@ pub unsafe fn truncf128(x: f128) -> f128;
22862286/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
22872287#[ rustc_intrinsic]
22882288#[ rustc_nounwind]
2289- pub fn round_ties_even_f16 ( x : f16 ) -> f16 ;
2289+ pub const fn round_ties_even_f16 ( x : f16 ) -> f16 ;
22902290
22912291/// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
22922292/// least significant digit.
@@ -2295,10 +2295,11 @@ pub fn round_ties_even_f16(x: f16) -> f16;
22952295/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
22962296#[ rustc_intrinsic]
22972297#[ rustc_nounwind]
2298- pub fn round_ties_even_f32 ( x : f32 ) -> f32 ;
2298+ pub const fn round_ties_even_f32 ( x : f32 ) -> f32 ;
22992299
23002300/// Provided for compatibility with stdarch. DO NOT USE.
23012301#[ inline( always) ]
2302+ #[ rustc_allow_const_fn_unstable( core_intrinsics) ]
23022303pub unsafe fn rintf32 ( x : f32 ) -> f32 {
23032304 round_ties_even_f32 ( x)
23042305}
@@ -2310,11 +2311,12 @@ pub unsafe fn rintf32(x: f32) -> f32 {
23102311/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
23112312#[ rustc_intrinsic]
23122313#[ rustc_nounwind]
2313- pub fn round_ties_even_f64 ( x : f64 ) -> f64 ;
2314+ pub const fn round_ties_even_f64 ( x : f64 ) -> f64 ;
23142315
23152316/// Provided for compatibility with stdarch. DO NOT USE.
23162317#[ inline( always) ]
2317- pub unsafe fn rintf64 ( x : f64 ) -> f64 {
2318+ #[ rustc_allow_const_fn_unstable( core_intrinsics) ]
2319+ pub const unsafe fn rintf64 ( x : f64 ) -> f64 {
23182320 round_ties_even_f64 ( x)
23192321}
23202322
@@ -2325,36 +2327,36 @@ pub unsafe fn rintf64(x: f64) -> f64 {
23252327/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
23262328#[ rustc_intrinsic]
23272329#[ rustc_nounwind]
2328- pub fn round_ties_even_f128 ( x : f128 ) -> f128 ;
2330+ pub const fn round_ties_even_f128 ( x : f128 ) -> f128 ;
23292331
23302332/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
23312333///
23322334/// The stabilized version of this intrinsic is
23332335/// [`f16::round`](../../std/primitive.f16.html#method.round)
23342336#[ rustc_intrinsic]
23352337#[ rustc_nounwind]
2336- pub unsafe fn roundf16 ( x : f16 ) -> f16 ;
2338+ pub const unsafe fn roundf16 ( x : f16 ) -> f16 ;
23372339/// Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
23382340///
23392341/// The stabilized version of this intrinsic is
23402342/// [`f32::round`](../../std/primitive.f32.html#method.round)
23412343#[ rustc_intrinsic]
23422344#[ rustc_nounwind]
2343- pub unsafe fn roundf32 ( x : f32 ) -> f32 ;
2345+ pub const unsafe fn roundf32 ( x : f32 ) -> f32 ;
23442346/// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
23452347///
23462348/// The stabilized version of this intrinsic is
23472349/// [`f64::round`](../../std/primitive.f64.html#method.round)
23482350#[ rustc_intrinsic]
23492351#[ rustc_nounwind]
2350- pub unsafe fn roundf64 ( x : f64 ) -> f64 ;
2352+ pub const unsafe fn roundf64 ( x : f64 ) -> f64 ;
23512353/// Returns the nearest integer to an `f128`. Rounds half-way cases away from zero.
23522354///
23532355/// The stabilized version of this intrinsic is
23542356/// [`f128::round`](../../std/primitive.f128.html#method.round)
23552357#[ rustc_intrinsic]
23562358#[ rustc_nounwind]
2357- pub unsafe fn roundf128 ( x : f128 ) -> f128 ;
2359+ pub const unsafe fn roundf128 ( x : f128 ) -> f128 ;
23582360
23592361/// Float addition that allows optimizations based on algebraic rules.
23602362/// May assume inputs are finite.
0 commit comments