AMCC Proprietary 420
Revision 1.02 - September 10, 2007
PPC405 Processor
Preliminary User’s Manual
B.6 Arithmetic and Logical Instructions
Table B-7 lists the arithmetic and logical instructions. Arithmetic operations are performed on integer or ordinal
operands stored in registers. Instructions using two operands are defined in a three-operand format, where the
operation is performed on the operands stored in two registers, and the result is placed in a third register.
Instructions using one operand are defined in a two-operand format, where the operation is performed on the
operand in one register, and the result is placed in another register. Several instructions have immediate formats,
in which one operand is coded as part of the instruction itself. Most arithmetic and logical instructions can optionally
set the Condition Register (CR) based on the outcome of the instruction.
stswi RS, RA, NB Store consecutive bytes in memory starting at EA=(RA|0).
Number of bytes n = 32 if NB = 0, else n =NB.
Bytes are unstacked from CEIL(
n/4) consecutive registers starting
with RS.
GPR(0) is consecutive to GPR(31).
318
stswx RS, RA, RB Store consecutive bytes in memory starting at EA=(RA|0)+(RB).
Number of bytes
n = XER[TBC].
Bytes are unstacked from CEIL(
n/4)
consecutive registers starting with RS.
GPR(0) is consecutive to GPR(31).
319
stw RS, D(RA) Store word (RS) in memory at
EA = (RA|0) + EXTS(D).
321
stwbrx RS, RA, RB Store word (RS) byte-reversed in memory at EA = (RA|0) + (RB).
MS(EA, 4)
← (RS)
24:31
|| (RS)
16:23
||
(RS)
8:15
|| (RS)
0:7
322
stwcx. RS, RA, RB Store word (RS) in memory at EA = (RA|0) + (RB) only if the
reservation bit is set.
if RESERVE = 1 then
MS(EA, 4)
← (RS)
RESERVE ← 0
(CR[CR0]) ←
2
0 || 1 || XER
so
else
(CR[CR0]) ←
2
0 || 0 || XER
so.
323
stwu RS, D(RA) Store word (RS) in memory at EA = (RA|0) + EXTS(D).
Update the base address,
(RA)
← EA.
324
stwux RS, RA, RB Store word (RS) in memory at EA = (RA|0) + (RB).
Update the base address,
(RA)
← EA.
325
stwx RS, RA, RB Store word (RS) in memory at
EA = (RA|0) + (RB).
326
Table B-7. Arithmetic and Logical Instructions
Mnemonic Operands Function
Other Registers
Changed
Page
add RT, RA, RB Add (RA) to (RB).
Place result in RT.
add. CR[CR0]
addo XER[SO, OV]
addo. CR[CR0]
XER[SO, OV]
Table B-6. Storage Reference Instructions (Continued)
Mnemonic Operands Function
Other Registers
Changed
Page