Skip to content

Commit 1fca86c

Browse files
committed
Replace mix/max combo with Ord::clamp
Bumps LLVM commit to 4dc08de9d2f680309cdd639169d3b8802c76ae9a, where the equivalent was done in the C++ version.
1 parent 318c3dd commit 1fca86c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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.0+llvm-e60b91df1357"
5+
version = "0.2.0+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
@@ -1824,7 +1824,7 @@ impl<S: Semantics> Float for IeeeFloat<S> {
18241824
let max_change = S::MAX_EXP as i32 - (S::MIN_EXP as i32 - sig_bits) + 1;
18251825

18261826
// Clamp to one past the range ends to let normalize handle overflow.
1827-
let exp_change = cmp::min(cmp::max(exp as i32, -max_change - 1), max_change);
1827+
let exp_change = (exp as i32).clamp(-max_change - 1, max_change);
18281828
self.exp = self.exp.saturating_add(exp_change as ExpInt);
18291829
self = self.normalize(round, Loss::ExactlyZero).value;
18301830
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)