srawi
Shift Right Algebraic Word Immediate
Shifts the contents of a register right by an immediate value and replicates the sign bit.
Details
The low-order 32 bits of register RS are shifted right SH bits. Bits shifted out of position 63 are lost. Bit 32 of RS is replicated to fill the vacated positions on the left. The 32-bit result is placed into RA32:63. Bit 32 of RS is replicated to fill RA0:31. CA and CA32 are set to 1 if the low-order 32 bits of (RS) contain a negative number and any 1-bits are shifted out of position 63; otherwise CA and CA32 are set to 0. A shift amount of zero causes RA to receive EXTS((RS)32:63), and CA and CA32 to be set to 0.
Pseudocode Operation
Programming Note
When Rc=1 (dot form), CR0 is updated with the signed comparison of the result against zero (LT, GT, EQ) and the current SO bit from XER.
Example
Encoding
Operands
-
RA
Target Register -
RS
Source Register -
SH
Shift Amount (0-31) -
RT
Target General Purpose Register