Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pseudocode for saturation (Oh no, not again)

In some instruction descriptions there are calls to SignedSatQ (directly or indirectly).

The pseudocode for SignedSatQ:

(bits(N), boolean) SignedSatQ(integer i, integer N)

if i > 2^(N-1) - 1 then

result = 2^(N-1) - 1; saturated = TRUE;

elsif i < -(2^(N-1)) then

result = -(2^(N-1)); saturated = TRUE;

else

result = i; saturated = FALSE;

return (result<N-1:0>, saturated);

What's the idea with 'result<N-1:0>' in the return (shifting the result one bit left)?

Parents Reply Children
No data