Skip to content

Commit a9e8cfe

Browse files
authored
Rollup merge of #136543 - RalfJung:round-ties-even, r=tgross35
intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic LLVM has three intrinsics here that all do the same thing (when used in the default FP environment). There's no reason Rust needs to copy that historically-grown mess -- let's just have one intrinsic and leave it up to the LLVM backend to decide how to lower that. Suggested by `@hanna-kruppe` in rust-lang/rust#136459; Cc `@tgross35` try-job: test-various
2 parents be63572 + beb24b3 commit a9e8cfe

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/intrinsic/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,11 @@ fn get_simple_intrinsic<'gcc, 'tcx>(
8484
sym::ceilf64 => "ceil",
8585
sym::truncf32 => "truncf",
8686
sym::truncf64 => "trunc",
87-
sym::rintf32 => "rintf",
88-
sym::rintf64 => "rint",
89-
sym::nearbyintf32 => "nearbyintf",
90-
sym::nearbyintf64 => "nearbyint",
87+
// We match the LLVM backend and lower this to `rint`.
88+
sym::round_ties_even_f32 => "rintf",
89+
sym::round_ties_even_f64 => "rint",
9190
sym::roundf32 => "roundf",
9291
sym::roundf64 => "round",
93-
sym::roundevenf32 => "roundevenf",
94-
sym::roundevenf64 => "roundeven",
9592
sym::abort => "abort",
9693
_ => return None,
9794
};

0 commit comments

Comments
 (0)