* try to fix precision error on x86 platform step7.

This commit is contained in:
IRainman 2025-11-08 22:01:14 +03:00
parent df6b574e40
commit 1ba0d482c1
2 changed files with 4 additions and 4 deletions

View File

@ -139,8 +139,9 @@ compute_float(int64_t q, uint64_t w) noexcept {
// branchless approach: value128 product = compute_product(q, w); but in
// practice, we can win big with the compute_product_approximation if its
// additional branch is easily predicted. Which is best is data specific.
limb_t upperbit = limb_t(product.high >> 63);
limb_t shift = limb_t(upperbit + 64 - binary::mantissa_explicit_bits() - 3);
am_pow_t const upperbit = am_pow_t(product.high >> 63);
am_pow_t const shift =
am_pow_t(upperbit + 64 - binary::mantissa_explicit_bits() - 3);
answer.mantissa = product.high >> shift;

View File

@ -446,8 +446,7 @@ typedef int_fast8_t am_bits_t;
// Power bias is signed for handling a denormal float
// or an invalid mantissa.
typedef int16_t am_pow_t; // can't be int_fast16_t because invalid_am_bias
// hacks. Needs rewriting this.
typedef int32_t am_pow_t;
// Bias so we can get the real exponent with an invalid adjusted_mantissa.
constexpr static am_pow_t invalid_am_bias = -0x8000;