macro_rules! impl_binary_long { ( $fn:ident, // name of the unsigned division function $zero_div_fn:ident, // function called when division by zero is attempted $normalization_shift:ident, // function for finding the normalization shift $n:tt, // the number of bits in a $iX or $uX $uX:ident, // unsigned integer type for the inputs and outputs of `$fn` $iX:ident // signed integer type with same bitwidth as `$uX` ) => { ... }; }
Expand description
Creates an unsigned division function that uses binary long division, designed for computer architectures without division instructions. These functions have good performance for microarchitectures with large branch miss penalties and architectures without the ability to predicate instructions. For architectures with predicated instructions, one of the algorithms described in the documentation of these functions probably has higher performance, and a custom assembly routine should be used instead.