We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mul
fma.rs
1 parent cacbf24 commit d5f918bCopy full SHA for d5f918b
src/math/fma.rs
@@ -29,21 +29,10 @@ fn normalize(x: f64) -> Num {
29
Num { m: ix, e, sign }
30
}
31
32
+#[inline]
33
fn mul(x: u64, y: u64) -> (u64, u64) {
- 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)
+ let t = (x as u128).wrapping_mul(y as u128);
+ ((t >> 64) as u64, t as u64)
47
48
49
/// Floating multiply add (f64)
0 commit comments