Simplified Mnemonics for PowerPC Instructions
PowerPC e500 Core Family Reference Manual, Rev. 1
Freescale Semiconductor
C-3
•
Shift—Shift the contents of a register right or left n bits, clearing vacated bits (logical shift).
•
Clear—Clear the leftmost or rightmost n bits of a register.
•
Clear left and shift left—Clear the leftmost b bits of a register, then shift the register left by
n bits. This operation can be used to scale a (known non-negative) array index by the width
of an element.
C.3.1
Operations on Words
The simplified mnemonics in
Table C-3
can be coded with a dot (.) suffix to cause the Rc bit to be
set in the underlying instruction.
Examples using word mnemonics follow:
1. Extract the sign bit (bit 0) of rS and place the result right-justified into rA.
extrwi rA,rS,1,0
equivalent to
rlwinm rA,rS,1,31,31
2. Insert the bit extracted in (1) into the sign bit (bit 0) of rB.
insrwi rB,rA,1,0 equivalent
to
rlwimi rB,rA,31,0,0
3. Shift the contents of rA left 8 bits.
slwi rA,rA,8 equivalent
to
rlwinm rA,rA,8,0,23
4. Clear the high-order 16 bits of rS and place the result into rA.
clrlwi rA,rS,16
equivalent to
rlwinm rA,rS,0,16,31
Table C-3. Word Rotate and Shift Simplified Mnemonics
Operation
Simplified Mnemonic
Equivalent to:
Extract and left justify word immediate
extlwi r
A
,r
S
,
n
,
b (n > 0)
rlwinm r
A
,r
S
,
b
,0,
n – 1
Extract and right justify word immediate
extrwi r
A
,r
S
,
n
,
b (n > 0)
rlwinm r
A
,r
S
,
b + n
,
32 –
n
,31
Insert from left word immediate
inslwi r
A
,r
S
,
n
,
b (n > 0)
rlwimi r
A
,r
S
,
32 –
b
,
b
,
(
b + n)
– 1
Insert from right word immediate
insrwi r
A
,r
S
,
n
,
b (n > 0)
rlwimi r
A
,r
S
,
32 – (
b + n)
,
b
,
(
b + n) – 1
Rotate left word immediate
rotlwi r
A
,r
S
,
n
rlwinm r
A
,r
S
,
n
,0,31
Rotate right word immediate
rotrwi r
A
,r
S
,
n
rlwinm r
A
,r
S
,
32 –
n
,0,31
Rotate word left
rotlw r
A
,r
S
,r
B
rlwnm r
A
,r
S
,r
B
,0,31
Shift left word immediate
slwi r
A
,r
S
,
n (n < 32)
rlwinm r
A
,r
S
,
n
,0,
31 –
n
Shift right word immediate
srwi r
A
,r
S
,
n (n < 32)
rlwinm r
A
,r
S
,
32 –
n
,
n
,31
Clear left word immediate
clrlwi r
A
,r
S
,
n (n < 32)
rlwinm r
A
,r
S
,0,
n
,31
Clear right word immediate
clrrwi r
A
,r
S
,
n (n < 32)
rlwinm r
A
,r
S
,0,0,
31 –
n
Clear left and shift left word immediate
clrlslwi r
A
,r
S
,
b
,
n (n
≤
b
≤
31)
rlwinm r
A
,r
S
,
n
,
b – n
,
31 –
n
Summary of Contents for PowerPC e500 Core
Page 1: ...PowerPC e500 Core Family Reference Manual Supports e500v1 e500v2 E500CORERM Rev 1 4 2005...
Page 36: ...PowerPC e500 Core Family Reference Manual Rev 1 xxxvi Freescale Semiconductor...
Page 38: ...PowerPC e500 Core Family Reference Manual Rev 1 Part I 2 Freescale Semiconductor...
Page 332: ...PowerPC e500 Core Family Reference Manual Rev 1 Part II 2 Freescale Semiconductor...
Page 530: ...Opcode Listings PowerPC e500 Core Family Reference Manual Rev 1 D 50 Freescale Semiconductor...
Page 534: ...PowerPC e500 Core Family Reference Manual Rev 1 E 4 Freescale Semiconductor Revision History...