Skip to main content

multiply_by_quantized_multiplier

Function multiply_by_quantized_multiplier 

Source
pub fn multiply_by_quantized_multiplier(
    x: i32,
    multiplier: i32,
    shift: i32,
) -> i32
Expand description

Rescale an i32 by a Q0.31 multiplier and a power-of-two shift, without zero point or saturation to storage (gemmlowp’s “MultiplyByQuantizedMultiplier”, C++ multiplyByQuantizedMultiplier). A negative shift left-shifts x first, saturating to the i32 range; a positive one divides the product with rounding.