rldcl (Rotate Left Double Word then Clear Left) instruction

Purpose

Rotate the contents of a general purpose register left by the number of bits specified by the contents of another general purpose register. Generate a mask that is ANDed with the result of the shift operation. Store the result of this operation in another general purpose register.

Syntax

Bits Value
0 - 5 30
6 - 10 S
11 - 15 A
16 - 20 B
21 - 26 mb
27 - 30 8
31 Rc
POWER® family
rldcl RA, RS, RB, MB (Rc=0)
rldcl. RA, RS, RB, MB (Rc=1)

Description

The contents of general purpose register (GPR) RS are rotated left the number of bits specified by the operand in the low-order six bits of RB. A mask is generated having 1 bits from bit MB through bit 63 and 0 bits elsewhere. The rotated data is ANDed with the generated mask and the result is placed into RA.

Note that the rldcl instruction can be used to extract and rotate bit fields using the methods shown below:

  • To extract an n-bit field, that starts at variable bit position b in register RS, right-justified into RA (clearing the remaining 64 - n bits of RA), set the low-order six bits of RB to b + n and MB = 64 - n.
  • To rotate the contents of a register left by variable n bits, set the low-order six bits of RB to n and MB = 0, and to shift the contents of a register right, set the low-order six bits of RB to(64 - n), and MB = 0.

Other registers altered:

  • Condition Register (CR0 field):

    Affected: LT, GT, EQ, SO (if Rc = 1)

Parameters

Item Description
RA Specifies the target general purpose register for the result of the instruction.
RS Specifies the source general purpose register containing the operand.
RB Specifies the source general purpose register containing the shift value.
MB Specifies the begin value (bit number) of the mask for the operation.

Implementation

This instruction is defined only for 64-bit implementations. Using it on a 32-bit implementation will cause the system illegal instruction error handler to be invoked.