rldimi (Rotate Left Double Word Immediate then Mask Insert) instruction

Purpose

The contents of a general purpose register are rotated left a specified number of bits. A generated mask is used to insert a specified bit-field into the corresponding bit-field of another general purpose register.

Syntax

Bits Value
0 - 5 30
6 - 10 S
11 - 15 A
16 - 20 sh
21 - 26 mb
27 - 29 3
30 sh
31 Rc
POWER® family
rldimi RA, RS, SH, MB (Rc=0)
rldimi. 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 inserted into RA under control of the generated mask.

Note that rldimi can be used to insert an n-bit field, that is right-justified in RS, into RA starting at bit position b, by setting SH = 64 - (b + n) and MB = b.

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.