rldcr

Rotate Left Doubleword then Clear Right

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.

Encoding

Binary Layout
0
0:5
RS
6:10
RA
11:15
RB
16:20
ME
21:26
9
27:30
Rc
31
 
Format MDS-form
Opcode 0x78000012
Extension Base

Operands

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

Example

rldcr r3, r3, r5, 31

Registers Altered

CR0 (if Rc=1)

Related

More in Base

Reference

Description

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.

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

Extended Mnemonics

Extended Mnemonic
insrdi RA,RS,b,n

The source lists these forms without stating the instruction each one stands for.

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.