Skip to main content

magic_u64_gen

Function magic_u64_gen 

Source
pub fn magic_u64_gen(c: u64) -> (u64, u8)
Expand description

Precompute the unsigned magic-reciprocal constants (magic, more) for a constant divisor c (c != 0), reusing the single canonical logicaffeine_data::LogosDivU64 generator — the same algorithm the AOT compile_to_rust path emits, exhaustively proven against hardware //%. The more byte encoding (low 6 bits = shift, 0x40 = the 65-bit add-marker path, 0x80 = the pure-shift power-of-two path) is exactly what magic_eval consumes.