Skip to content

Commit 20d6292

Browse files
Use rint instead of roundeven
Use rint intrinsic instead of roundeven to impement `round_ties_even`. They do the same thing when rounding mode is default, which Rust assumes. And `rint` has better platform support. Keeps `roundeven` around in `core::intrinsics`, it's doing no harm there.
1 parent 36cd4fa commit 20d6292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/intrinsics/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ fn codegen_float_intrinsic_call<'tcx>(
295295
sym::ceilf64 => ("ceil", 1, fx.tcx.types.f64),
296296
sym::truncf32 => ("truncf", 1, fx.tcx.types.f32),
297297
sym::truncf64 => ("trunc", 1, fx.tcx.types.f64),
298+
sym::rintf32 => ("rintf", 1, fx.tcx.types.f32),
299+
sym::rintf64 => ("rint", 1, fx.tcx.types.f64),
298300
sym::roundf32 => ("roundf", 1, fx.tcx.types.f32),
299301
sym::roundf64 => ("round", 1, fx.tcx.types.f64),
300302
sym::roundevenf32 => ("roundevenf", 1, fx.tcx.types.f32),

0 commit comments

Comments
 (0)