Expand description
Arithmetic primitives for rANS.
This module provides:
mul_hi_u64: High 64 bits of 64x64 multiply (equivalent to__umulh/Mul64Hi)compute_reciprocal: Reciprocal frequency preparation for fast division
The arithmetic here must match the Microsoft C++ implementation exactly.
Functionsยง
- compute_
reciprocal_ u32 - Compute the fixed-point reciprocal frequency for a 32-bit state.
- compute_
reciprocal_ u64 - Compute the fixed-point reciprocal frequency for a 64-bit state.
- fast_
quotient_ u32 - fast_
quotient_ u64 - Perform fast division by frequency using the reciprocal.
- freq_
one_ reciprocal_ u32 - Compute the frequency-one reciprocal for 32-bit state.
- freq_
one_ reciprocal_ u64 - Compute the frequency-one reciprocal for 64-bit state.
- mul_
hi_ u64 - Returns the high 64 bits of the 128-bit product of two 64-bit integers.
- reciprocal_
shift - Compute the reciprocal shift for a given frequency.