Skip to main content

Module divisor

Module divisor 

Source

Macros§

divisor_enum 🔒
n_bit_divisor 🔒
A divisor with an N-bit multiplier, which computes the quotient as MULUH(m, n') >> shift for n' from $body. Up and Down differ only in n', and the macro keeps them from duplicating the rest. |n| ... looks like a closure but is macro syntax for the expression, because a const fn can’t call a closure
signed_divisor 🔒
unsigned_divisor 🔒

Structs§

AddIndicatorDivisorI32
A i32 divisor whose magnitude isn’t a power of two, see DivisorI32
AddIndicatorDivisorI64
A i64 divisor whose magnitude isn’t a power of two, see DivisorI64
AddIndicatorDivisorU32
A u32 divisor that isn’t a power of two, see DivisorU32
AddIndicatorDivisorU64
A u64 divisor that isn’t a power of two, see DivisorU64
DownDivisorU32
A u32 divisor whose rounded-up multiplier isn’t exact in N bits, see DivisorU32
PowerOfTwoDivisorI32
A i32 divisor whose magnitude is a power of two, see DivisorI32
PowerOfTwoDivisorI64
A i64 divisor whose magnitude is a power of two, see DivisorI64
PowerOfTwoDivisorU32
A u32 divisor that is a power of two, see DivisorU32
PowerOfTwoDivisorU64
A u64 divisor that is a power of two, see DivisorU64
UpDivisorU32
A u32 divisor whose rounded-up multiplier is exact in N bits, see DivisorU32
UpDivisorU64
A u64 divisor whose rounded-up multiplier is exact in N bits, see DivisorU64

Enums§

DivisorI32
A i32 divisor, precomputed once to divide many values by it
DivisorI64
A i64 divisor, precomputed once to divide many values by it
DivisorU32
A u32 divisor, precomputed once to divide many values by it
DivisorU64
A u64 divisor, precomputed once to divide many values by it

Constants§

CHEAP_SATURATION 🔒
Whether a saturating increment on u32 lanes is cheap: one uqadd on aarch64, and pminud from SSE4.1 and a subtract on x86. Baseline x86-64 has no unsigned 32-bit min and emulates it with compares, so there the saturating increment of DivisorU32::Down costs more than the add and halve of DivisorU32::AddIndicator