AMCC Proprietary 299
Revision 1.02 - September 10, 2007
PPC405 Processor
rlwimi
Rotate Left Word Immediate then Mask Insert
Preliminary User’s Manual
rlwimi
Rotate Left Word Immediate then Mask Insert
r ← ROTL((RS), SH)
m
← MASK(MB, ME)
(RA) ← (r ∧ m) ∨ ((RA) ∧¬m)
The contents of register RS are rotated left by the number of bit positions specified in the SH field. A mask is gener-
ated, having 1-bits starting at the bit position specified in the MB field and ending in the bit position specified by the
ME field, with 0-bits elsewhere.
If the starting point of the mask is at a higher bit position than the ending point, the 1-bits portion of the mask wraps
from the highest bit position back around to the lowest. The rotated data is inserted into register RA, in positions
corresponding to the bit positions in the mask that contain a 1-bit.
Registers Altered
•RA
• CR[CR0]
LT, GT, EQ, SO
if Rc contains 1
Architecture Note
This instruction is part of the PowerPC User Instruction Set Architecture.
rlwimi RA, RS, SH, MB, ME Rc=0
rlwimi. RA, RS, SH, MB, ME Rc=1
20 RS RA SH MB ME Rc
0 6 11 16 21 26 31
Table 9-27. Extended Mnemonics for rlwimi, rlwimi.
Mnemonic Operands Function
Other Registers
Altered
inslwi
RA, RS, n, b
Insert from left immediate (n > 0).
(RA)
b:b+n-1
← (RS)
0:n-1
Extended mnemonic for
rlwimi RA,RS,32−b,b,b+n−1
inslwi.
Extended mnemonic for
rlwimi. RA,RS,32−b,b,b+n−1
CR[CR0]
insrwi
RA, RS, n, b
Insert from right immediate. (n > 0)
(RA)
b:b+n-1
← (RS)
32-n:31
Extended mnemonic for
rlwimi RA,RS,32−b−n,b,b+n−1
insrwi.
Extended mnemonic for
rlwimi. RA,RS,32−b−n,b,b+n−1
CR[CR0]