EasyManua.ls Logo

Freescale Semiconductor PowerPC e500 Core - Operations on Words; C.3.1 Operations on Words

Default Icon
548 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 rA,rS,
n
,
b
(
n
> 0) rlwinm rA,rS,
b
,0,
n
– 1
Extract and right justify word immediate extrwi rA,rS,
n
,
b
(
n
> 0) rlwinm rA,rS,
b
+
n
, 32 –
n
,31
Insert from left word immediate inslwi rA,rS,
n
,
b
(
n
> 0) rlwimi rA,rS,32 –
b
,
b
,(
b
+
n
) – 1
Insert from right word immediate insrwi rA,rS,
n
,
b
(
n
> 0) rlwimi rA,rS,32 – (
b
+
n
),
b,
(
b + n
)
– 1
Rotate left word immediate rotlwi rA,rS,
n
rlwinm rA,rS,
n
,0,31
Rotate right word immediate rotrwi rA,rS,
n
rlwinm rA,rS,32 –
n
,0,31
Rotate word left rotlw rA,rS,rB rlwnm rA,rS,rB,0,31
Shift left word immediate slwi rA,rS,
n
(
n
< 32) rlwinm rA,rS,
n
,0,31 –
n
Shift right word immediate srwi rA,rS,
n
(
n
< 32) rlwinm rA,rS,32
n
,
n
,31
Clear left word immediate clrlwi rA,rS,
n
(
n
< 32) rlwinm rA,rS,0,
n
,31
Clear right word immediate clrrwi rA,rS,
n
(
n
< 32) rlwinm rA,rS,0,0,31 –
n
Clear left and shift left word immediate clrlslwi rA,rS,
b
,
n
(
n
b
31) rlwinm rA,rS,
n
,
b
n
,31
n

Table of Contents

Related product manuals