@@ -2198,86 +2198,86 @@ pub unsafe fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;
2198
2198
/// [`f16::floor`](../../std/primitive.f16.html#method.floor)
2199
2199
#[ rustc_intrinsic]
2200
2200
#[ rustc_nounwind]
2201
- pub unsafe fn floorf16 ( x : f16 ) -> f16 ;
2201
+ pub const unsafe fn floorf16 ( x : f16 ) -> f16 ;
2202
2202
/// Returns the largest integer less than or equal to an `f32`.
2203
2203
///
2204
2204
/// The stabilized version of this intrinsic is
2205
2205
/// [`f32::floor`](../../std/primitive.f32.html#method.floor)
2206
2206
#[ rustc_intrinsic]
2207
2207
#[ rustc_nounwind]
2208
- pub unsafe fn floorf32 ( x : f32 ) -> f32 ;
2208
+ pub const unsafe fn floorf32 ( x : f32 ) -> f32 ;
2209
2209
/// Returns the largest integer less than or equal to an `f64`.
2210
2210
///
2211
2211
/// The stabilized version of this intrinsic is
2212
2212
/// [`f64::floor`](../../std/primitive.f64.html#method.floor)
2213
2213
#[ rustc_intrinsic]
2214
2214
#[ rustc_nounwind]
2215
- pub unsafe fn floorf64 ( x : f64 ) -> f64 ;
2215
+ pub const unsafe fn floorf64 ( x : f64 ) -> f64 ;
2216
2216
/// Returns the largest integer less than or equal to an `f128`.
2217
2217
///
2218
2218
/// The stabilized version of this intrinsic is
2219
2219
/// [`f128::floor`](../../std/primitive.f128.html#method.floor)
2220
2220
#[ rustc_intrinsic]
2221
2221
#[ rustc_nounwind]
2222
- pub unsafe fn floorf128 ( x : f128 ) -> f128 ;
2222
+ pub const unsafe fn floorf128 ( x : f128 ) -> f128 ;
2223
2223
2224
2224
/// Returns the smallest integer greater than or equal to an `f16`.
2225
2225
///
2226
2226
/// The stabilized version of this intrinsic is
2227
2227
/// [`f16::ceil`](../../std/primitive.f16.html#method.ceil)
2228
2228
#[ rustc_intrinsic]
2229
2229
#[ rustc_nounwind]
2230
- pub unsafe fn ceilf16 ( x : f16 ) -> f16 ;
2230
+ pub const unsafe fn ceilf16 ( x : f16 ) -> f16 ;
2231
2231
/// Returns the smallest integer greater than or equal to an `f32`.
2232
2232
///
2233
2233
/// The stabilized version of this intrinsic is
2234
2234
/// [`f32::ceil`](../../std/primitive.f32.html#method.ceil)
2235
2235
#[ rustc_intrinsic]
2236
2236
#[ rustc_nounwind]
2237
- pub unsafe fn ceilf32 ( x : f32 ) -> f32 ;
2237
+ pub const unsafe fn ceilf32 ( x : f32 ) -> f32 ;
2238
2238
/// Returns the smallest integer greater than or equal to an `f64`.
2239
2239
///
2240
2240
/// The stabilized version of this intrinsic is
2241
2241
/// [`f64::ceil`](../../std/primitive.f64.html#method.ceil)
2242
2242
#[ rustc_intrinsic]
2243
2243
#[ rustc_nounwind]
2244
- pub unsafe fn ceilf64 ( x : f64 ) -> f64 ;
2244
+ pub const unsafe fn ceilf64 ( x : f64 ) -> f64 ;
2245
2245
/// Returns the smallest integer greater than or equal to an `f128`.
2246
2246
///
2247
2247
/// The stabilized version of this intrinsic is
2248
2248
/// [`f128::ceil`](../../std/primitive.f128.html#method.ceil)
2249
2249
#[ rustc_intrinsic]
2250
2250
#[ rustc_nounwind]
2251
- pub unsafe fn ceilf128 ( x : f128 ) -> f128 ;
2251
+ pub const unsafe fn ceilf128 ( x : f128 ) -> f128 ;
2252
2252
2253
2253
/// Returns the integer part of an `f16`.
2254
2254
///
2255
2255
/// The stabilized version of this intrinsic is
2256
2256
/// [`f16::trunc`](../../std/primitive.f16.html#method.trunc)
2257
2257
#[ rustc_intrinsic]
2258
2258
#[ rustc_nounwind]
2259
- pub unsafe fn truncf16 ( x : f16 ) -> f16 ;
2259
+ pub const unsafe fn truncf16 ( x : f16 ) -> f16 ;
2260
2260
/// Returns the integer part of an `f32`.
2261
2261
///
2262
2262
/// The stabilized version of this intrinsic is
2263
2263
/// [`f32::trunc`](../../std/primitive.f32.html#method.trunc)
2264
2264
#[ rustc_intrinsic]
2265
2265
#[ rustc_nounwind]
2266
- pub unsafe fn truncf32 ( x : f32 ) -> f32 ;
2266
+ pub const unsafe fn truncf32 ( x : f32 ) -> f32 ;
2267
2267
/// Returns the integer part of an `f64`.
2268
2268
///
2269
2269
/// The stabilized version of this intrinsic is
2270
2270
/// [`f64::trunc`](../../std/primitive.f64.html#method.trunc)
2271
2271
#[ rustc_intrinsic]
2272
2272
#[ rustc_nounwind]
2273
- pub unsafe fn truncf64 ( x : f64 ) -> f64 ;
2273
+ pub const unsafe fn truncf64 ( x : f64 ) -> f64 ;
2274
2274
/// Returns the integer part of an `f128`.
2275
2275
///
2276
2276
/// The stabilized version of this intrinsic is
2277
2277
/// [`f128::trunc`](../../std/primitive.f128.html#method.trunc)
2278
2278
#[ rustc_intrinsic]
2279
2279
#[ rustc_nounwind]
2280
- pub unsafe fn truncf128 ( x : f128 ) -> f128 ;
2280
+ pub const unsafe fn truncf128 ( x : f128 ) -> f128 ;
2281
2281
2282
2282
/// Returns the nearest integer to an `f16`. Rounds half-way cases to the number with an even
2283
2283
/// least significant digit.
@@ -2286,7 +2286,7 @@ pub unsafe fn truncf128(x: f128) -> f128;
2286
2286
/// [`f16::round_ties_even`](../../std/primitive.f16.html#method.round_ties_even)
2287
2287
#[ rustc_intrinsic]
2288
2288
#[ rustc_nounwind]
2289
- pub fn round_ties_even_f16 ( x : f16 ) -> f16 ;
2289
+ pub const fn round_ties_even_f16 ( x : f16 ) -> f16 ;
2290
2290
2291
2291
/// Returns the nearest integer to an `f32`. Rounds half-way cases to the number with an even
2292
2292
/// least significant digit.
@@ -2295,10 +2295,11 @@ pub fn round_ties_even_f16(x: f16) -> f16;
2295
2295
/// [`f32::round_ties_even`](../../std/primitive.f32.html#method.round_ties_even)
2296
2296
#[ rustc_intrinsic]
2297
2297
#[ rustc_nounwind]
2298
- pub fn round_ties_even_f32 ( x : f32 ) -> f32 ;
2298
+ pub const fn round_ties_even_f32 ( x : f32 ) -> f32 ;
2299
2299
2300
2300
/// Provided for compatibility with stdarch. DO NOT USE.
2301
2301
#[ inline( always) ]
2302
+ #[ rustc_allow_const_fn_unstable( core_intrinsics) ]
2302
2303
pub unsafe fn rintf32 ( x : f32 ) -> f32 {
2303
2304
round_ties_even_f32 ( x)
2304
2305
}
@@ -2310,11 +2311,12 @@ pub unsafe fn rintf32(x: f32) -> f32 {
2310
2311
/// [`f64::round_ties_even`](../../std/primitive.f64.html#method.round_ties_even)
2311
2312
#[ rustc_intrinsic]
2312
2313
#[ rustc_nounwind]
2313
- pub fn round_ties_even_f64 ( x : f64 ) -> f64 ;
2314
+ pub const fn round_ties_even_f64 ( x : f64 ) -> f64 ;
2314
2315
2315
2316
/// Provided for compatibility with stdarch. DO NOT USE.
2316
2317
#[ 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 {
2318
2320
round_ties_even_f64 ( x)
2319
2321
}
2320
2322
@@ -2325,36 +2327,36 @@ pub unsafe fn rintf64(x: f64) -> f64 {
2325
2327
/// [`f128::round_ties_even`](../../std/primitive.f128.html#method.round_ties_even)
2326
2328
#[ rustc_intrinsic]
2327
2329
#[ rustc_nounwind]
2328
- pub fn round_ties_even_f128 ( x : f128 ) -> f128 ;
2330
+ pub const fn round_ties_even_f128 ( x : f128 ) -> f128 ;
2329
2331
2330
2332
/// Returns the nearest integer to an `f16`. Rounds half-way cases away from zero.
2331
2333
///
2332
2334
/// The stabilized version of this intrinsic is
2333
2335
/// [`f16::round`](../../std/primitive.f16.html#method.round)
2334
2336
#[ rustc_intrinsic]
2335
2337
#[ rustc_nounwind]
2336
- pub unsafe fn roundf16 ( x : f16 ) -> f16 ;
2338
+ pub const unsafe fn roundf16 ( x : f16 ) -> f16 ;
2337
2339
/// Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
2338
2340
///
2339
2341
/// The stabilized version of this intrinsic is
2340
2342
/// [`f32::round`](../../std/primitive.f32.html#method.round)
2341
2343
#[ rustc_intrinsic]
2342
2344
#[ rustc_nounwind]
2343
- pub unsafe fn roundf32 ( x : f32 ) -> f32 ;
2345
+ pub const unsafe fn roundf32 ( x : f32 ) -> f32 ;
2344
2346
/// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
2345
2347
///
2346
2348
/// The stabilized version of this intrinsic is
2347
2349
/// [`f64::round`](../../std/primitive.f64.html#method.round)
2348
2350
#[ rustc_intrinsic]
2349
2351
#[ rustc_nounwind]
2350
- pub unsafe fn roundf64 ( x : f64 ) -> f64 ;
2352
+ pub const unsafe fn roundf64 ( x : f64 ) -> f64 ;
2351
2353
/// Returns the nearest integer to an `f128`. Rounds half-way cases away from zero.
2352
2354
///
2353
2355
/// The stabilized version of this intrinsic is
2354
2356
/// [`f128::round`](../../std/primitive.f128.html#method.round)
2355
2357
#[ rustc_intrinsic]
2356
2358
#[ rustc_nounwind]
2357
- pub unsafe fn roundf128 ( x : f128 ) -> f128 ;
2359
+ pub const unsafe fn roundf128 ( x : f128 ) -> f128 ;
2358
2360
2359
2361
/// Float addition that allows optimizations based on algebraic rules.
2360
2362
/// May assume inputs are finite.
0 commit comments