sradi

Shift Right Algebraic Doubleword Immediate

sradi RA, RS, SH

Performs an arithmetic right shift on a 64-bit doubleword by a constant amount.

Details

The sradi instruction shifts the contents of the low-order 32 bits of register RS to the right by a specified number of bits, determined by the value in (RB)58:63. Bits shifted out of position 63 are lost, and bit 32 of RS is replicated to fill the vacated positions on the left. The 32-bit result is placed into RA32:63, with RA0:31 also filled by replicating bit 32 of RS. CA and CA32 are set based on whether any 1-bits are shifted out of position 63 when (RS) contains a negative number.

Pseudocode Operation

RA <- (RS) >>a SH

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

sradi r3, r4, 10

Encoding

Binary Layout
31
0
RS
6
RA
11
SH
16
413
21
Rc
31
 
Format XS-form
Opcode 0x7C00033C
Extension Base
Registers Altered CR0

Operands

  • RA
    Target Register
  • RS
    Source Register
  • SH
    Shift Amount (0-63, Split field)