diff options
| author | Jules Bertholet <julesbertholet@quoi.xyz> | 2022-11-07 13:10:36 -0500 |
|---|---|---|
| committer | Jules Bertholet <julesbertholet@quoi.xyz> | 2022-12-11 01:20:18 -0500 |
| commit | f8138110bca50f8eb9196e098d20df5f496b7051 (patch) | |
| tree | f2bfbad05c4f55121c41413829efbb3baff6ac53 /compiler/rustc_codegen_cranelift | |
| parent | 03c166d3893aba971beecaf65d0722f44a786ecf (diff) | |
| download | rust-f8138110bca50f8eb9196e098d20df5f496b7051.tar.gz rust-f8138110bca50f8eb9196e098d20df5f496b7051.zip | |
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.
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 4851c3fdcb7..ff9447a7484 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -295,6 +295,8 @@ fn codegen_float_intrinsic_call<'tcx>( sym::ceilf64 => ("ceil", 1, fx.tcx.types.f64), sym::truncf32 => ("truncf", 1, fx.tcx.types.f32), sym::truncf64 => ("trunc", 1, fx.tcx.types.f64), + sym::rintf32 => ("rintf", 1, fx.tcx.types.f32), + sym::rintf64 => ("rint", 1, fx.tcx.types.f64), sym::roundf32 => ("roundf", 1, fx.tcx.types.f32), sym::roundf64 => ("round", 1, fx.tcx.types.f64), sym::roundevenf32 => ("roundevenf", 1, fx.tcx.types.f32), |
