rldcr

Rotate Left Doubleword then Clear Right

rldcr RT,RS,RB,ME
rldcr. RT,RS,RB,ME

Rotates the contents of register RS left by a variable number of bits specified by (RB)58:63, and clears the rightmost bits.

Details

The contents of register RS are rotated 64 bits to the left by the number of bits specified by (RB)58:63. A mask is generated having 1-bits from bit 0 through bit ME and 0-bits elsewhere. The rotated data are ANDed with the generated mask, and the result is placed into register RA.

Pseudocode Operation

if 'rldcr' then
    n ← (RB)58:63
    r ← ROTL64((RS), n)
    ME ← me5 || me0:4
    m ← MASK(0, ME)
    RA ← r & m
if 'rldcr.' then
    CR0 <- updated based on result

Programming Note

rldcr can be used to extract an n-bit field that starts at variable bit position b in register RS, left-justified RA), by setting RB58:63=b and ME=n-1. It can also be used to rotate the contents of a register left (right) by variable n bits, by setting RB58:63=n (64-n) and ME=63.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction

Example

rldcr r3, r3, r5, 31

Encoding

Binary Layout
0
0
RS
6
RA
11
RB
16
ME
21
9
27
Rc
31
 
Format MDS-form
Opcode 0x78000012
Extension Base
Registers Altered CR0 (if Rc=1)

Operands

  • RT
    Target General Purpose Register
  • RS
    Source General Purpose Register
  • RB
    Source General Purpose Register
  • ME
    Mask End bit position