Skip to content

Commit c9d7071

Browse files
eduardosmtgross35
authored andcommitted
Replace mix/max combo with Ord::clamp
Bumps LLVM commit to llvm/llvm-project@4dc08de, where the equivalent was done in the C++ version.
1 parent ba30eaf commit c9d7071

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
members = ["fuzz"]
33

44
[workspace.package]
5-
version = "0.2.3+llvm-e60b91df1357"
5+
version = "0.2.3+llvm-4dc08de9d2f6"
66
edition = "2021"
77
license = "Apache-2.0 WITH LLVM-exception"
88

src/ieee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ impl<S: Semantics> Float for IeeeFloat<S> {
18611861
let max_change = S::MAX_EXP as i32 - (S::MIN_EXP as i32 - sig_bits) + 1;
18621862

18631863
// Clamp to one past the range ends to let normalize handle overflow.
1864-
let exp_change = cmp::min(cmp::max(exp as i32, -max_change - 1), max_change);
1864+
let exp_change = (exp as i32).clamp(-max_change - 1, max_change);
18651865
self.exp = self.exp.saturating_add(exp_change as ExpInt);
18661866
self = self.normalize(round, Loss::ExactlyZero).value;
18671867
if self.is_nan() {

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Port of LLVM's APFloat software floating-point implementation from the
22
//! following C++ sources (please update commit hash when backporting):
3-
//! <https://github.com/llvm/llvm-project/commit/e60b91df1357e6a5f66840581f4d5f57e258c0b4>
3+
//! <https://github.com/llvm/llvm-project/commit/4dc08de9d2f680309cdd639169d3b8802c76ae9a>
44
//! * `llvm/include/llvm/ADT/APFloat.h` -> `Float` and `FloatConvert` traits
55
//! * `llvm/lib/Support/APFloat.cpp` -> `ieee` and `ppc` modules
66
//! * `llvm/unittests/ADT/APFloatTest.cpp` -> `tests` directory

0 commit comments

Comments
 (0)