pub struct InvariantDivisor31 { /* private fields */ }Expand description
Exact n / d for 0 <= n < 2^31 by one multu and a shift, for a
divisor that is fixed across many dividends.
Granlund and Montgomery, “Division by invariant integers using
multiplication” (1994), theorem 4.2 with N = 31: for l = ceil(log2 d)
and m = floor(2^(31+l) / d) + 1, floor(m * n / 2^(31+l)) equals
floor(n / d) for every n < 2^31, and m fits 32 bits. The R3000A’s
div interlocks the pipeline for about 35 cycles and multu for about
12 (fewer for small operands), so a per-model depth-slot divide that ran
once per drawn face pays for its new after a handful of faces.
Implementations§
Trait Implementations§
Source§impl Clone for InvariantDivisor31
impl Clone for InvariantDivisor31
Source§fn clone(&self) -> InvariantDivisor31
fn clone(&self) -> InvariantDivisor31
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvariantDivisor31
impl Debug for InvariantDivisor31
Source§impl PartialEq for InvariantDivisor31
impl PartialEq for InvariantDivisor31
impl Copy for InvariantDivisor31
impl Eq for InvariantDivisor31
impl StructuralPartialEq for InvariantDivisor31
Auto Trait Implementations§
impl Freeze for InvariantDivisor31
impl RefUnwindSafe for InvariantDivisor31
impl Send for InvariantDivisor31
impl Sync for InvariantDivisor31
impl Unpin for InvariantDivisor31
impl UnsafeUnpin for InvariantDivisor31
impl UnwindSafe for InvariantDivisor31
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)