rldicl

Rotate Left Doubleword Immediate Clear Left

rldicl RA, RS, SH, MB

Rotates the contents of a register left by a specified number of bits and clears higher-order bits.

Details

The contents of register RS are rotated 64 left SH bits. A mask is generated having 1-bits from bit MB through bit 63 and 0-bits elsewhere. The rotated data are ANDed with the generated mask and the result is placed into register RA.

Pseudocode Operation

SH ← SH5 || SH0:4
r ← ROTL64((RS), SH)
MB ← MB5 || MB0:4
m ← MASK(MB, 63)
RA ← r & m

Programming Note

rldicl can be used to extract an n-bit field that starts at bit position b in register RS, right-justified into register RA (clearing the remaining 64-n bits of RA), by setting SH=b+n and MB=64-n. It can be used to rotate the contents of a register left by n bits, by setting SH=n and MB=0. It can be used to shift the contents of a register right by n bits, by setting SH=64-n and MB=n. It can be used to clear the high-order n bits of a register, by setting SH=0 and MB=n.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction
extrdi
srdi
clrldi

Example

rldicl r4, r3, 3, 0

Encoding

Binary Layout
30
0
RS
6
RA
11
SH
16
MB
21
0
26
sh
30
Rc
31
 
Format MD-form
Opcode 0x78000000
Extension Base
Registers Altered CR0

Operands

  • RA
    Target
  • RS
    Source
  • SH
    Shift
  • MB
    Mask Begin