Skip to main content

n_bit_divisor

Macro n_bit_divisor 

Source
macro_rules! n_bit_divisor {
    ($(#[$doc:meta])* $name:ident, $enum:ident, $t:ty, $wide:ty, |$n:ident| $body:expr, $example:expr) => { ... };
}
Expand description

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