Skip to content

Commit

Permalink
Make use of guess macro
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Aug 19, 2024
1 parent ee4c48c commit d664c77
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/float/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,16 @@ impl FloatDivision for f32 {
/// targets. Not used by default as it requires performing more work during
/// rounding and would hardly help on regular 32- or 64-bit targets.
const C_HW: HalfRep<Self> = guess!(HalfRep<Self>);

// 0x7504;
}

impl FloatDivision for f64 {
// const HALF_ITERATIONS: usize = 3;

/// HW is at least 32. Shifting into the highest bits if needed.
const C_HW: HalfRep<Self> = 0x7504F333 << (HalfRep::<Self>::BITS - 32);
const C_HW: HalfRep<Self> = guess!(HalfRep<Self>);
}

#[cfg(not(feature = "no-f16-f128"))]
impl FloatDivision for f128 {
// const HALF_ITERATIONS: usize = 4;

// const C_HW: HalfRep<Self> = 0x7504F333 << (HalfRep::<Self>::BITS - 32);
const C_HW: HalfRep<Self> = 0x7504f333f9de6108;
const C_HW: HalfRep<Self> = guess!(HalfRep<Self>);
}

fn div<F>(a: F, b: F) -> F
Expand Down

0 comments on commit d664c77

Please sign in to comment.