diff --git a/mlir/lib/Dialect/Tosa/Utils/QuantUtils.cpp b/mlir/lib/Dialect/Tosa/Utils/QuantUtils.cpp --- a/mlir/lib/Dialect/Tosa/Utils/QuantUtils.cpp +++ b/mlir/lib/Dialect/Tosa/Utils/QuantUtils.cpp @@ -46,8 +46,8 @@ // Shifting tops out at 63 bits. Right shift to make 63 bits the max. if (shift > 63) { - // Shifting the multiplier by more than 32-bits is unnecessary. - multiplier = multiplier >> std::min(32, shift - 63); + // Shifting the multiplier by more than 31-bits is unnecessary. + multiplier = multiplier >> std::min(31, shift - 63); shift = 63; } } @@ -82,7 +82,7 @@ // Shifting tops out at 63 bits. Right shift to make 63 bits the max. if (shift > 63) { // Shifting the multiplier by more than 32-bits is unnecessary. - multiplier = multiplier >> std::min(32, shift - 63); + multiplier = multiplier >> std::min(31, shift - 63); shift = 63; } }