No announcement yet.

Shift right inconsistency

  • Filter
  • Time
  • Show
Clear All
new posts

  • Shift right inconsistency

    There appears to be an inconsistency between the documentation and actual behavior of the Picaso GFX2. The Programmers reference manual, page 20, states:

    "Whether or not the vacated high order bit(s) positions are replaced with zeros or ones depends on the SIGN of the number."

    This is what I would expect for a signed number shift, because the result will keep the sign of the operand. However, the operator appears to be using only zeros to be shifted in the MSB bit.

    This is actually what I would prefer for my application, because otherwise I have to mask out the ones that may shift from the SIGN bit.

    Is this going to be corrected in the next revision, or should I use this inconsistency to speed up my code?

  • #2

    Yes this is not correct in the manual, it is a logical shift and will remain consistent.

    If a signed shift is required, division can be used which will maintain sign.