Closed ymherklotz closed 3 years ago
Currently Oshrximm is not implemented, as it needs to be implemented with a division.
Oshrximm
One reason for the mismatch between division and shift is shown below:
-11 / (1 << 1) = -5 -11 >>> 1 = -6
Therefore it will always be more efficient to use unsigned division by a constant compared to signed division by a constant.
Maybe there is a more efficient implementation of this special case.
The following might be the correct, efficient implementation of Oshrximm (x / (2 ^ y)):
x / (2 ^ y)
q = $signed(x) < 0 ? - ((-x) >> y) : x >> y;
Currently
Oshrximm
is not implemented, as it needs to be implemented with a division.One reason for the mismatch between division and shift is shown below:
Therefore it will always be more efficient to use unsigned division by a constant compared to signed division by a constant.
Maybe there is a more efficient implementation of this special case.