Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 3b7c2b4

Browse files
authored
Merge pull request #277 from TDecki/patch-1
2 parents ccd5f94 + e0b4f0e commit 3b7c2b4

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

libm/src/math/fma.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,10 @@ fn normalize(x: f64) -> Num {
2929
Num { m: ix, e, sign }
3030
}
3131

32+
#[inline]
3233
fn mul(x: u64, y: u64) -> (u64, u64) {
33-
let t1: u64;
34-
let t2: u64;
35-
let t3: u64;
36-
let xlo: u64 = x as u32 as u64;
37-
let xhi: u64 = x >> 32;
38-
let ylo: u64 = y as u32 as u64;
39-
let yhi: u64 = y >> 32;
40-
41-
t1 = xlo * ylo;
42-
t2 = xlo * yhi + xhi * ylo;
43-
t3 = xhi * yhi;
44-
let lo = t1.wrapping_add(t2 << 32);
45-
let hi = t3 + (t2 >> 32) + (t1 > lo) as u64;
46-
(hi, lo)
34+
let t = (x as u128).wrapping_mul(y as u128);
35+
((t >> 64) as u64, t as u64)
4736
}
4837

4938
/// Floating multiply add (f64)

0 commit comments

Comments
 (0)