summaryrefslogtreecommitdiffstats
path: root/vendor/compiler_builtins/libm/src/math/fma.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/compiler_builtins/libm/src/math/fma.rs')
-rw-r--r--vendor/compiler_builtins/libm/src/math/fma.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/vendor/compiler_builtins/libm/src/math/fma.rs b/vendor/compiler_builtins/libm/src/math/fma.rs
index f9a86dc60..940ee2db9 100644
--- a/vendor/compiler_builtins/libm/src/math/fma.rs
+++ b/vendor/compiler_builtins/libm/src/math/fma.rs
@@ -29,21 +29,10 @@ fn normalize(x: f64) -> Num {
Num { m: ix, e, sign }
}
+#[inline]
fn mul(x: u64, y: u64) -> (u64, u64) {
- let t1: u64;
- let t2: u64;
- let t3: u64;
- let xlo: u64 = x as u32 as u64;
- let xhi: u64 = x >> 32;
- let ylo: u64 = y as u32 as u64;
- let yhi: u64 = y >> 32;
-
- t1 = xlo * ylo;
- t2 = xlo * yhi + xhi * ylo;
- t3 = xhi * yhi;
- let lo = t1.wrapping_add(t2 << 32);
- let hi = t3 + (t2 >> 32) + (t1 > lo) as u64;
- (hi, lo)
+ let t = (x as u128).wrapping_mul(y as u128);
+ ((t >> 64) as u64, t as u64)
}
/// Floating multiply add (f64)