[][src]Macro compiler_builtins::impl_binary_long

macro_rules! impl_binary_long {
    (
        $unsigned_name:ident, // name of the unsigned division function
        $signed_name:ident, // name of the signed 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 `$unsigned_name`
        $iX:ident, // signed integer type for the inputs and outputs of `$signed_name`
        $($unsigned_attr:meta),*; // attributes for the unsigned function
        $($signed_attr:meta),* // attributes for the signed function
    ) => { ... };
}

Creates unsigned and signed division functions that use 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.