How can I implement the rightrotate (and leftrotate) operations on 32 bit integers without using any bitwise operations?
I need this because High Level Shader Language (HLSL) does not allow bitwise oeprations upon numbers, and I need rightrotate for a specific shader I’m trying to implement.
For unsigned integers, divide by 2 and add 2^32 if the number was odd, for right rotate. For left, multiply by two and add 1 if it was above 2^32 – 1.