PowerPC e500 Core Family Reference Manual, Rev. 1
3-16 Freescale Semiconductor
Instruction Model
3.3.1.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. Integer rotate instructions, summarized in Table 3-9, rotate the contents of a
register. The result is either inserted into the target register under control of a mask (if a mask bit is
set the associated bit of the rotated data is placed into the target register, and if the mask bit is cleared
the associated bit in the target register is unchanged) or ANDed with a mask before being placed
into the target register. Appendix C, “Simplified Mnemonics for PowerPC Instructions,” lists
simplified mnemonics that allow simpler coding of often-used functions such as clearing the left-
or right-most bits of a register, left or right justifying an arbitrary field, and simple rotates and shifts.
The integer shift instructions (Table 3-10) 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 (shown in Appendix C, “Simplified Mnemonics for PowerPC
Instructions”) are provided to simplify coding of such shifts. The integer shift instructions are
summarized in Table 3-10.
OR or (or.) rA,rS,rB—
OR Immediate ori rA,rS,UIMM Book E defines ori r0,r0,0 as the preferred form for a no-op.
The dispatcher may discard this instruction and dispatch it
only to the completion queue but not to any execution unit.
OR Immediate Shifted oris rA,rS,UIMM —
OR with Complement orc (orc.) rA,rS,rB—
XOR xor (xor.) rA,rS,rB—
XOR Immediate xori rA,rS,UIMM —
XOR Immediate Shifted xoris rA,rS,UIMM —
Table 3-9. Integer Rotate Instructions
Name Mnemonic Syntax
Rotate Left Word Immediate then AND with Mask rlwinm (rlwinm.) rA,rS,SH,MB,ME
Rotate Left Word then AND with Mask rlwnm (rlwnm.) rA,rS,rB,MB,ME
Rotate Left Word Immediate then Mask Insert rlwimi (rlwimi.) rA,rS,SH,MB,ME
Table 3-10. Integer Shift Instructions
Name Mnemonic Syntax
Shift Left Word slw (slw.) rA,rS,rB
Shift Right Word srw (srw.) rA,rS,rB
Shift Right Algebraic Word Immediate srawi (srawi.) rA,rS,SH
Shift Right Algebraic Word sraw (sraw.) rA,rS,rB
Table 3-8. Integer Logical Instructions (continued)
Name Mnemonic Syntax Implementation Notes