
2-24
MPC603e & EC603e RISC Microprocessors User's Manual
MOTOROLA
2.3.4.1.4 Integer Rotate and Shift Instructions
Rotation operations are performed on data from a GPR, and the result, or a portion of the
result, is returned to a GPR. See Appendix F, “Simplified Mnemonics,” in
The
Programming Environments Manual
for a complete list of simplified mnemonics that
allows simpler coding of often-used functions such as clearing the leftmost or rightmost
bits of a register, left justifying or right justifying an arbitrary field, and simple rotates and
shifts.
Integer rotate instructions rotate the contents of a register. The result of the rotation is either
inserted into the target register under control of a mask (if a mask bit is 1 the associated bit
of the rotated data is placed into the target register, and if the mask bit is 0 the associated
bit in the target register is unchanged), or ANDed with a mask before being placed into the
target register.
The integer rotate instructions are listed in Table 2-12.
The integer shift instructions perform left and right shifts. Immediate-form logical
(unsigned) shift operations are obtained by specifying masks and shift values for certain
rotate instructions. Simplified mnemonics are provided to make coding of such shifts
simpler and easier to understand.
Multiple-precision shifts can be programmed as shown in Appendix C, “Multiple-Precision
Shifts,” in
The Programming Environments Manual
.
Equivalent
eqv (eqv.)
r
A
,r
S
,r
B
AND with Complement
andc (andc.)
r
A
,r
S
,r
B
OR with Complement
orc (orc.)
r
A
,r
S
,r
B
Extend Sign Byte
extsb (extsb.)
r
A
,r
S
Extend Sign Half Word
extsh (extsh.)
r
A
,r
S
Count Leading Zeros Word
cntlzw (cntlzw.)
r
A
,r
S
Table 2-12. Integer Rotate Instructions
Name
Mnemonic
Operand Syntax
Rotate Left Word Immediate then AND with Mask
rlwinm (rlwinm.)
r
A
,r
S
,
SH
,
MB
,
ME
Rotate Left Word then AND with Mask
rlwnm (rlwnm.)
r
A
,r
S
,r
B
,
MB
,
ME
Rotate Left Word Immediate then Mask Insert
rlwimi (rlwimi.)
r
A
,r
S
,
SH
,
MB
,
ME
Table 2-11. Integer Logical Instructions (Continued)
Name
Mnemonic
Operand Syntax