rldic (Rotate Left Double Word Immediate then Clear) instruction

Purpose

The contents of a general purpose register are rotated left a specified number of bits, then masked with a bit-field to clear some number of low-order and high-order bits. The result is placed in another general purpose register.

Syntax

Bits Value
0 - 5 30
6 - 10 S
11 - 15 A
16 - 20 sh
21 - 26 mb
27 - 29 2
30 sh
31 Rc
POWER® family
rldicl RA, RS, SH, MB (Rc=0)
rldicl. RA, RS, SH, MB (Rc=1)

Description

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

Note that rldic can be used to clear and shift bit fields using the methods shown below:

  • To clear the high-order b bits of the contents of a register and then shift the result left by n bits, set SH = n and MB = b - n.
  • To clear the high-order n bits of a register, set SH = 0 and MB = n.

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.
SH Specifies the (immediate) shift value for the operation.
MB Specifies the begin value of the bit-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.