rldicr

Rotate Left Doubleword Immediate Clear Right

rldicr RA, RS, SH, ME

Rotates 64-bit RS left by SH, then clears the low-order bits (ME+1 to 63).

Details

The rlwnm instruction rotates the low-order 32 bits of register RS left by a variable number of bits specified in RB, then ANDs the result with a mask generated from bits MB+32 to ME+32. The masked result is placed into register RA, clearing the remaining bits.

Pseudocode Operation

rot <- ROTL64(RS, SH); mask <- MASK(0, ME); RA <- rot & mask

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

rldicr r3, r4, 2, 60

Encoding

Binary Layout
30
0
RS
6
RA
11
SH
16
ME
21
01
27
Rc
31
 
Format MD-form
Opcode 0x78000004
Extension Base
Registers Altered CR0

Operands

  • RA
    Target
  • RS
    Source
  • SH
    Shift Amount
  • ME
    Mask End