Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
abs Rd |
Rd = |Rd|; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
The absolute value of the contents to the register specified is written back to the register. If the initial value equals the maximum negative value (0x80000000), the result will equal the initial value.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
(RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
acall disp |
LR = PC + 2; PC = *(ACBA + (ZE(disp8)<<2)); |
disp ∈ {0, 4, ..., 1020} |
Rev1+ |
|
The ACALL instruction performs an application function call.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
ACBA must be word aligned. Failing to align ACBA correctly may lead to erronous be- havior.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
acr Rd |
Rd = Rd + C; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Adds carry to the specified destination register.
Q: |
Not affected |
V: |
V = RES[31] AND ~Rd[31] |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = ~RES[31] AND Rd[31] |
; Add a 32-bit variable (R0) to a 64-bit variable (R2:R1) add R1, R0 acr R2
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
adc Rd, Rx, Ry |
Rd = Rx + Ry + C; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Adds carry and the two registers specified and stores the result in destination register.
Q: |
Not affected |
V: |
V = (Rx[31] AND Ry[31] AND ~RES[31]) OR (~Rx[31] AND ~Ry[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = Rx[31] AND Ry[31] OR Rx[31] AND ~RES[31] OR Ry[31] AND ~RES[31] |
; Add two 64-bit variables R1:R0 and R3:R2 and store the result in R1:R0 add
R0, R2
adc
R1, R1, R3
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
add Rd, Rs |
Rd = Rd + Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
add Rd, Rx, Ry << sa |
Rd = Rx + (Ry<< sa2); |
{d, x, y}∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
Adds the two registers specified and stores the result in destination register. Format II allows shifting of the second operand.
Format I: OP1 = Rd, OP2 = Rs |
|
Format II:OP1 = Rx, OP2 = Ry << sa2 |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND OP2[31] AND ~RES[31]) OR (~OP1[31] AND ~OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = OP1[31] AND OP2[31] OR OP1[31] AND ~RES[31] OR OP2[31] AND ~RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
addabs Rd, Rx, Ry |
Rd = Rx + |Ry|; |
{d, x, y}∈ {0, 1, …, 15} |
Rev1+ |
|
Adds Rx and the absolute value of Ry and stores the result in destination register. Useful for cal- culating the sum of absolute differences.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
addhh.wRd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); Rd = operand1 + operand2; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Adds the two halfword registers specified and stores the result in the destination word-register. The halfword registers are selected as either the high or low part of the operand registers.
OP1 = operand1, OP2 = operand2 |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND OP2[31] AND ~RES[31]) OR (~OP1[31] AND ~OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = OP1[31] AND OP2[31] OR OP1[31] AND ~RES[31] OR OP2[31] AND ~RES[31] |
addhh.wR10, R2:t, R3:b will perform R10 = SE(R2[31:16]) + SE(R3[15:0])
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
add{cond4}Rd, Rx, Ry |
if ( cond4) Rd = Rx + Ry; |
{d, x, y} ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Performs an addition and stores the result in destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
and Rd, Rs |
Rd = Rd AND Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
and Rd, Rx, Ry << sa |
Rd = Rx AND (Ry << sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||||
3 |
and Rd, Rx, Ry >> sa |
Rd = Rx AND (Ry >> sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Performs a bitwise logical AND between the specified registers and stores the result in the desti- nation register.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
andh Rd, imm |
Rd[31:16] = Rd[31:16] AND imm16; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
| ||||||||||
2 |
andh Rd, imm, COH |
Rd[31:16] = Rd[31:16] AND imm16; Rd[15:0] = 0; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
| ||||||||||
3 |
andl Rd, imm |
Rd[15:0] = Rd[15:0] AND imm16; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
| ||||||||||
4 |
andl Rd, imm, COH |
Rd[15:0] = Rd[15:0] AND imm16; Rd[31:16] = 0; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
|
Performs a bitwise logical AND between the high or the low halfword in the specified register and a constant. The result is stored in the high or the low halfword of the destination register while the other bits remain unchanged. The Clear Other Half (COH) parameter allows the other half to be cleared.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
andn Rd, Rs |
Rd = Rd AND ~Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a bitwise logical ANDNOT between the specified registers and stores the result in the destination register.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
and{cond4}Rd, Rx, Ry |
if ( cond4) Rd = Rx AND Ry; |
{d, x, y} ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Performs a bitwise logical AND between the specified registers and stores the result in the desti- nation register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
asr Rd, Rx, Ry |
Rd = ASR(Rx, Ry[4:0]); |
d, x, y ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
asr Rd, sa |
Rd = ASR(Rd, sa5); |
d ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||
3 |
asr Rd, Rs, sa |
Rd = ASR(Rs, sa5); |
{d,s} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Shifts all bits in a register to the right the amount of bits specified by the five least significant bits in Ry or an immediate while keeping the sign.
Format I: Shamt = Ry[4:0], Op = Rx |
|
Format II: Shamt = sa5, Op = Rd |
|
Format III: Shamt = sa5, Op = Rs |
|
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
if (Shamt != 0) then C = Op[Shamt-1] else C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
bfexts Rd, Rs, bp5, w5 |
Rd = SE(Rs[bp5+w5-1:bp5]); |
{d, s} ∈ {0, 1, …, 15} {bp5, w5} ∈ {0, 1, ..., 31} |
Rev1+ |
|
This instruction extracts and sign-extends the w5 bits in Rs starting at bit-offset bp5 to Rd.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = RES[31] |
If (w5 = 0) or if (bp5 + w5 > 32) the result is undefined.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
bfextu Rd, Rs, bp5, w5 |
Rd = ZE(Rs[bp5+w5-1:bp5]); |
{d, s} ∈ {0, 1, …, 15} {bp5, w5} ∈ {0, 1, ..., 31} |
Rev1+ |
|
This instruction extracts and zero-extends the w5 bits in Rs starting at bit-offset bp5 to Rd.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = RES[31] |
If (w5 = 0) or if (bp5 + w5 > 32) the result is undefined.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
bfins Rd, Rs, bp5, w5 |
Rd[bp5+w5-1:bp5] = Rs[w5-1:0]; |
{d, s} ∈ {0, 1, …, 15} {bp5, w5} ∈ {0, 1, ..., 31} |
Rev1+ |
|
This instruction inserts the lower w5 bits of Rs in Rd at bit-offset bp5.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = RES[31] |
If (w5 = 0) or if (bp5 + w5 > 32) the result is undefined.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
bld Rd, bp |
C = Rd[bp5]; Z = Rd[bp5]; |
d ∈{0, 1, …, 15} bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Copy an arbitrary bit in a register to C and Z.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Z = Rd[bp5] |
C: |
C = Rd[bp5] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
breakpoint |
if (SR[DM]==0) RSR_DBG = SR; RAR_DBG = address of first non-completed instruction; SR[R] = 1; SR[J] = 1; SR[D] = 1; SR[M2:M0] = B'110; SR[DM] = 1; SR[EM] = 1; SR[GM] = 1; PC = EVBA+0x1C; else PC = PC + 2; |
None |
Rev1+ |
|
If the on chip debug system is enabled, this instruction traps a software breakpoint for debugging. The breakpoint instruc- tion will enter debug mode disabling all interrupts and exceptions. If the on chip debug system is not enabled, this instruction will execute as a nop.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
If no on chip debug system is implemented, this instruction will execute as a "NOP".
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
brev Rd |
Rd[31:0] = Rd[0:31]; |
d ∈{0, 1, …, 15} |
Rev1+ |
|
Bit-reverse the contents in the register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
br{cond3}disp |
if (cond3) PC = PC + (SE(disp8) << 1); else PC = PC + 2; |
cond3 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl} disp ∈ {-256, -254, ..., 254} |
Rev1+ |
| ||||||||||||
2 |
br{cond4}disp |
if (cond4) PC = PC + (SE(disp21) << 1); else PC = PC + 4; |
cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} disp ∈ {-2097152, -2097150, ..., 2097150} |
Rev1+ |
|
Branch if the specified condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
bst Rd, bp |
Rd[bp5] = C; |
d ∈ {0, 1, …, 15} bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Copy the C-flag to an arbitrary bit in a register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
cache Rp[disp], Op5 |
Issue a command to the cache |
disp ∈ {-1024, -1023, ..., 1023} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Control cache operation.
Op[4:3] |
Semantic |
00 |
Instruction Cache |
01 |
Data Cache or unified cache |
10 |
Secondary Cache |
11 |
Tertiary Cache |
Op[2:0] |
Semantic |
000 |
Implementation definedk |
001 |
Implementation defined |
010 |
Implementation defined |
011 |
Implementation defined |
100 |
Implementation defined |
101 |
Implementation defined |
110 |
Implementation defined |
111 |
Implementation defined |
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
This instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Violation exception.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
casts.h Rd |
Rd[31:16] = Rd[15]; |
d ∈ {0, 1, …, 15} |
Rev1+ |
| ||||
2 |
casts.b Rd |
Rd[31:8] = Rd[7]; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Sign extends the halfword or byte that is specified to word size. The result is stored back to the specified register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
castu.h Rd |
Rd[31:16] = 0; |
d ∈ {0, 1, …, 15} |
Rev1+ |
| ||||
2 |
castu.b Rd |
Rd[31:8] = 0: |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Zero extends the halfword or byte that is specified to word size. The result is stored back to the specified register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
cbr Rd, bp |
Rd[bp5] = 0; |
d ∈ {0, 1, …, 15} bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Clears a bit in the specified register. All other bits are unaffected.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
clz Rd, Rs |
temp = 32; for (i = 31; i >= 0; i--) if (Rs[i] == 1) then temp = 31 - i; break; Rd = temp; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Counts the number of binary zero bits before the first binary one bit in a register value. The value returned from the operation can be used for doing normalize operations. If the operand is zero, the value 32 is returned.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = (RES[31:0] == 32) |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
com Rd |
Rd = ~Rd; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform a one's complement of specified register.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||||
1 |
cop CP#, CRd, CRx, CRy, Op |
CP#(CRd) = CP#(CRx) Op CP#(CRy); |
# ∈ {0, 1, …, 7} Op ∈ {0, 1, …, 127} {d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Addresses a coprocessor and performs the specified operation on the specified registers.
Q: |
Coprocessor-specific |
V: |
Coprocessor-specific |
N: |
Coprocessor-specific |
Z: |
Coprocessor-specific |
C: |
Coprocessor-specific |
cop CP2, CR0, CR1, CR2, 0
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
cp.b Rd, Rs |
Rd[7:0] - Rs[7:0]; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a compare between the lowermost bytes in the two operands specified. The operation is implemented by doing a subtraction without writeback of the difference. The operation sets the status flags according to the result of the subtraction, but does not affect the operand registers.
Q: |
Not affected |
V: |
V = (Rd[7] AND ~Rs[7] AND ~RES[7]) OR (~Rd[7] AND Rs[7] AND RES[7]) |
N: |
N = RES[7] |
Z: |
Z = (RES[7:0] == 0) |
C: |
C = ~Rd[7] AND Rs[7] OR Rs[7] AND RES[7] OR ~Rd[7] AND RES[7] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
cp.h Rd, Rs |
Rd[15:0] - Rs[15:0]; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a compare between the lowermost halfwords in the two operands specified. The oper- ation is implemented by doing a subtraction without writeback of the difference. The operation sets the status flags according to the result of the subtraction, but does not affect the operand registers.
Format I: OP1 = Rd, OP2 = Rs |
|
Q: |
Not affected |
V: |
V = (OP1[15] AND ~OP2[15] AND ~RES[15]) OR (~OP1[15] AND OP2[15] AND RES[15]) |
N: |
N = RES[15] |
Z: |
Z = (RES[15:0] == 0) |
C: |
C = ~OP1[15] AND OP2[15] OR OP2[15] AND RES[15] OR ~OP1[15] AND RES[15] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
cp.w Rd, Rs |
Rd - Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
cp.w Rd, imm |
Rd - SE(imm6); |
d ∈ {0, 1, …, 15} imm ∈ {-32, -31, ..., 31} |
Rev1+ |
| ||||||||||||
3 |
cp.w Rd, imm |
Rd - SE(imm21); |
d ∈ {0, 1, …, 15} imm ∈ {-1048576, -104875, ..., 1048575} |
Rev1+ |
|
Performs a compare between the two operands specified. The operation is implemented by doing a subtraction without writeback of the difference. The operation sets the status flags according to the result of the subtraction, but does not affect the operand registers.
Format I: OP1 = Rd, OP2 = Rs |
|
Format II: OP1 = Rd, OP2 = SE(imm6) |
|
Format III:OP1 = Rd, OP2 = SE(imm21) |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND ~OP2[31] AND ~RES[31]) OR (~OP1[31] AND OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~OP1[31] AND OP2[31] OR OP2[31] AND RES[31] OR ~OP1[31] AND RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
cpc Rd, Rs |
Rd - Rs - C; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||
2 |
cpc Rd |
Rd - C; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a compare between the two registers specified. The operation is executed by doing a subtraction with carry (as borrow) without writeback of the difference. The operation sets the sta- tus flags according to the result of the subtraction, but does not affect the operand registers. Note that the zero flag status before the operation is included in the calculation of the new zero flag. This instruction allows large compares (64, 128 or more bits).
In format II, Rs referred to below equals zero. |
|
Q: |
Not affected |
V: |
V = (Rd[31] AND ~Rs[31] AND ~RES[31]) OR (~Rd[31] AND Rs[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = ~Rd[31] AND Rs[31] OR Rs[31] AND RES[31] OR ~Rd[31] AND RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
csrf bp |
SR[bp5] = 0; |
bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Clears the status register (SR) flag specified.
SR[bp5] = 0, all other flags unchanged. |
Privileged if bp5 > 15, ie. upper half of status register. An exception will be triggered if the upper half of the status register is attempted changed in user mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
csrfcz bp |
C = SR[bp5]; Z = SR[bp5]; |
bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Copies the status register (SR) flag specified to C and Z.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = SR[bp5] |
C: |
C = SR[bp5] |
Privileged if bp5 > 15, ie. upper half of status register. A Privilege Violation exception will be trig- gered if the upper half of the status register is attempted read in user mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
divs Rd, Rx, Ry |
Rd = Rx / Ry; Rd+1 = Rx % Ry; |
d ∈ {0, 2, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a signed divide between the two 32-bit register specified. The quotient is returned in Rd, the remainder in Rd+1. No exceptions are taken if dividing by 0. Result in Rd and Rd+1 is UNDEFINED when dividing by 0. The sign of the remainder will be the same as the dividend, and the quotient will be negative if the signs of Rx and Ry are opposite.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
divu Rd, Rx, Ry |
Rd = Rx / Ry; Rd+1 = Rx % Ry; |
d ∈ {0, 2, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs an unsigned divide between the two 32-bit register specified. The quotient is returned in Rd, the remainder in Rd+1. No exceptions are taken if dividing by 0. Result in Rd and Rd+1 is UNDEFINED when dividing by 0.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
eor Rd, Rs |
Rd = Rd XOR Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
eor Rd, Rx, Ry << sa |
Rd = Rx XOR (Ry << sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||||
3 |
eor Rd, Rx, Ry >> sa |
Rd = Rx XOR (Ry >> sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Performs a bitwise logical Exclusive-OR between the specified registers and stores the result in the destination register.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
eorh Rd, imm |
Rd[31:16] = Rd[31:16] XOR imm16 |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
| ||||||
2 |
eorl Rd, imm |
Rd[15:0] = Rd[15:0] XOR imm16 |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
|
Performs a bitwise logical Exclusive-OR between the high or low halfword in the specified regis- ter and a constant. The result is stored in the destination register.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
eor{cond4} Rd, Rx, Ry |
if ( cond4) Rd = Rx XOR Ry; |
{d, x, y} ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Performs a bitwise logical Exclusive-OR between the specified registers and stores the result in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
frs |
Invalidate all entries in the return address stack. |
none |
Rev1+ |
|
Special instruction to invalidate the return address stack. This instruction is used when the user writes code that conflicts with the semantics required by the return address stack.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
On implementation without a return stack this instruction will execute as a "NOP".
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
icall Rd |
LR = PC + 2; PC = Rd; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Call to a subroutine pointed to by the pointer residing in Rp.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
incjosp imm |
if ( JOSP[3:0] + imm < 0 ) TRAP 4 else if (JOSP[3:0] + imm > 8 ) TRAP 3 else JOSP = JOSP + imm; |
imm ∈ {-4, -3, -2, -1, 1, 2, 3, 4} |
Rev1+ |
|
Increment the system register "Java Operand Stack Pointer" with value.
imm3 |
imm |
100 |
-4 |
101 |
-3 |
110 |
-2 |
111 |
-1 |
000 |
1 |
001 |
2 |
010 |
3 |
011 |
4 |
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
When trapped, this instruction will destroy R12. It is the programmer's responsibility to keep the R12value if needed.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.d Rd, Rp++ |
Rd+1:Rd = *(Rp); Rp = Rp + 8; |
d ∈ {0, 2, 4, …, 14} p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
ld.d Rd, --Rp |
Rp = Rp - 8; Rd+1:Rd = *(Rp); |
d ∈ {0, 2, 4, …, 14} p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
ld.d Rd, Rp |
Rd+1:Rd = *(Rp); |
d ∈ {0, 2, 4, …, 14} p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
4 |
ld.d Rd, Rp[disp] |
Rd+1:Rd = *(Rp + (SE(disp16))); |
d ∈ {0, 2, 4, …, 14} p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
5 |
ld.d Rd, Rb[Ri<<sa] |
Rd+1:Rd = *(Rb + (Ri << sa2)); |
d ∈ {0, 2, 4, …, 14} p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the doubleword memory location specified.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format I and II: If Rd = Rp, the result is UNDEFINED.
If Rd = Rp+1, the result is UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.sb Rd, Rp[disp] |
Rd = SE( *(Rp + (SE(disp16))) ); |
d, p ∈ {0, 1, …, 15} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
| ||||||||||||||
2 |
ld.sb Rd, Rb[Ri<<sa] |
Rd = SE( *(Rb + (Ri << sa2)) ); |
d, b, i ∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
Reads the byte memory location specified and sign-extends it.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.sb{cond4} Rd, Rp[disp] |
if (cond4) Rd = SE( *(Rp + (ZE(disp9))) ); |
d, p ∈ {0, 1, …, 15} disp ∈ {0, 1, ..., 511} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Reads the byte memory location specified and sign-extends it if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.sh Rd, Rp++ |
Rd = SE( *(Rp) ); Rp = Rp + 2; |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
ld.sh Rd, --Rp |
Rp = Rp - 2; Rd = SE( *(Rp) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
ld.sh Rd, Rp[disp] |
Rd = SE( *(Rp + (ZE(disp3) << 1)) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
4 |
ld.sh Rd, Rp[disp] |
Rd = SE( *(Rp + (SE(disp16))); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
5 |
ld.sh Rd, Rb[Ri<<sa] |
Rd = SE( *(Rb + (Ri << sa2)); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the halfword memory location specified and sign-extends it.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format I and II: If Rd = Rp, the result is UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.sh{cond4} Rd, Rp[disp] |
if (cond4) Rd = SE( *(Rp + (ZE(disp9<<1))) ); |
d, p ∈ {0, 1, …, 15} disp ∈ {0, 2, ..., 1022} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Reads the halfword memory location specified and sign-extends it if the given condition is satis- fied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.ub Rd, Rp++ |
Rd = ZE( *(Rp) ); Rp = Rp + 1; |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
ld.ub Rd, --Rp |
Rp = Rp - 1; Rd = ZE( *(Rp) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
ld.ub Rd, Rp[disp] |
Rd = ZE( *(Rp + (ZE(disp3))) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
4 |
ld.ub Rd, Rp[disp] |
Rd = ZE( *(Rp + (SE(disp16))) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
5 |
ld.ub Rd, Rb[Ri<<sa] |
Rd = ZE( *(Rb + (Ri << sa2)) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the byte memory location specified and zero-extends it.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format I and II: If Rd = Rp, the result is UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.ub{cond4} Rd, Rp[disp] |
if (cond4) Rd = ZE( *(Rp + (ZE(disp9))) ); |
d, p ∈ {0, 1, …, 15} disp ∈ {0, 1, ..., 511} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Reads the byte memory location specified and zero-extends it if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.uh Rd, Rp++ |
Rd = ZE( *(Rp) ); Rp = Rp + 2; |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
ld.uh Rd, --Rp |
Rp = Rp - 2; Rd = ZE( *(Rp) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
ld.uh Rd, Rp[disp] |
Rd = ZE( *(Rp + (ZE(disp3) << 1)) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
4 |
ld.uh Rd, Rp[disp] |
Rd = ZE( *(Rp + (SE(disp16))) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
5 |
ld.uh Rd, Rb[Ri<<sa] |
Rd = ZE( *(Rb + (Ri << sa2)) ); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the halfword memory location specified and zero-extends it.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format I and II: If Rd = Rp, the result is UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.uh{cond4} Rd, Rp[disp] |
if (cond4) Rd = ZE( *(Rp + (ZE(disp9<<1))) ); |
d, p ∈ {0, 1, …, 15} disp ∈ {0, 2, ..., 1022} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Reads the halfword memory location specified and zero-extends it if the given condition is satis- fied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
ld.w Rd, Rp++ |
Rd = *(Rp); Rp = Rp + 4; |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||||
2 |
ld.w Rd, --Rp |
Rp = Rp - 4; Rd = *(Rp); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||||
3 |
ld.w Rd, Rp[disp] |
Rd = *(Rp + (ZE(disp5) << 2)); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||||
4 |
ld.w Rd, Rp[disp] |
Rd = *(Rp + (SE(disp16))); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||||
5 |
ld.w Rd, Rb[Ri<<sa] |
Rd = *(Rb + (Ri << sa2)); |
d, p, b, i ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||||
6 |
ld.w Rd, Rb[Ri:<part> << 2] |
If (part == b) Rd = *(Rb + (Ri[7:0] << 2) ); else if (part == l) Rd = *(Rb + (Ri[15:8] << 2) ); else if (part == u) Rd = *(Rb + (Ri[23:16] << 2) ); else Rd = *(Rb + (Ri[31:24] << 2) ); |
{d, b, i} ∈ {0, 1, …, 15} part ∈ {t, u, l, b} |
Rev1+ |
|
Format I to V: Reads the word memory location specified. Format VI: This instruction extracts a specified byte from Ri. This value is zero-extended, shifted left two positions and added to Rb to form an address. The contents of this address is loaded into Rd. The instruction is useful for indexing tables.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format I and II: If Rd = Rp, the result is UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ld.w{cond4} Rd, Rp[disp] |
if (cond4) Rd = *(Rp + (ZE(disp9<<2))); |
d, p ∈ {0, 1, …, 15} disp ∈ {0, 4, ..., 2044} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Reads the word memory location specified if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
ldc.d CP#, CRd, Rp[disp] |
CP#(CRd+1:CRd) = *(Rp + (ZE(disp8) << 2)); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
2 |
ldc.d CP#, CRd, --Rp |
Rp = Rp-8; CP#(CRd+1:CRd) = *(Rp); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
3 |
ldc.d CP#, CRd, Rb[Ri<<sa] |
CP#(CRd+1:CRd) = *(Rb + (Ri << sa2)); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
4 |
ldc.w CP#, CRd, Rp[disp] |
CP#(CRd) = *(Rp + (ZE(disp8) << 2)); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
5 |
ldc.w CP#, CRd, --Rp |
Rp = Rp-4; CP#(CRd) = *(Rp); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
6 |
ldc.w CP#, CRd, Rb[Ri<<sa] |
CP#(CRd) = *(Rb + (Ri << sa2)); |
# ∈ {0, 1, …, 7} |
Rev1+ |
|
Reads the memory location specified into the addressed coprocessor.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
ldc.d CP2, CR0, R2[0]
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
ldc0.d CRd, Rp[disp] |
CP0(CRd+1:CRd) = *(Rp + (ZE(disp12) << 2)); |
p ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
ldc0.w CRd, Rp[disp] |
CP0(CRd) = *(Rp + (ZE(disp12) << 2)); |
p ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the memory location specified into coprocessor 0.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
ldc0.d CR0, R2[0]
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ldcm.d CP#, Rp{++}, ReglistCPD8 |
Loadaddress =Rp; for (i = 7 to 0) if ReglistCPD8[i] == 1 then CP#(CR(2*i+1)) =*(Loadaddress++); CP#(CR(2*i)) =*(Loadaddress++); if Opcode[++] == 1 then Rp = Loadaddress; |
# ∈ {0, 1, …, 7} p ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
ldcm.w CP#, Rp{++}, ReglistCPH8 |
Loadaddress =Rp; for (i = 7 to 0) if ReglistCPH8[i] == 1 then CP#(CRi+8) =*(Loadaddress++); if Opcode[++] == 1 then Rp = Loadaddress; |
# ∈ {0, 1, …, 7} p ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
ldcm.w CP#, Rp{++}, ReglistCPL8 |
Loadaddress =Rp; for (i = 7 to 0) if ReglistCPL8[i] == 1 then CP#(CRi) =*(Loadaddress++); if Opcode[++] == 1 then Rp = Loadaddress; |
# ∈ {0, 1, …, 7} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Reads the memory locations specified into the addressed coprocessor. The pointer register can optionally be updated after the operation.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
ldcm.w CP2, SP++, CR2-CR5
Emtpy ReglistCPL8/ReglistCPL8/ReglistCPD8 gives UNDEFINED result.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
lddpc Rd, PC[disp] |
Rd = *( (PC && 0xFFFF_FFFC) + (ZE(disp7) << 2)); |
d ∈ {0, 1, …, 15} disp ∈ {0, 4, …, 508} |
Rev1+ |
|
Performs a PC relative load of a register
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
lddsp Rd, SP[disp] |
Rd = *( (SP && 0xFFFF_FFFC) + (ZE(disp7) << 2)); |
d ∈ {0, 1, …, 15} disp ∈ {0, 4, …, 508} |
Rev1+ |
|
Reads the value of a memory location referred to by the stack pointer register and a displace- ment.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
ldins.b Rd:<part>, Rp[disp] |
If (part == b) Rd[7:0] = *(Rp+SE(disp12)); else if (part == l) Rd[15:8] = *(Rp+SE(disp12)); else if (part == u) Rd[23:16] = *(Rp+SE(disp12)); else Rd[31:24] = *(Rp+SE(disp12)); |
{p, d} ∈ {0, 1, …, 15} part ∈ {t, u, l, b} disp ∈ {-2048, -2047, ..., 2047} |
Rev1+ |
| ||||||||||||||
2 |
ldins.h Rd:<part>, Rp[disp] |
If (part == b) Rd[15:0] = *(Rp+SE(disp12) << 1); else Rd[31:16] = *(Rp+SE(disp12) << 1); |
{p, d} ∈ {0, 1, …, 15} part ∈ {t, b} disp ∈ {-4096, -4094, ..., 4094} |
Rev1+ |
|
This instruction loads a byte or a halfword from memory and inserts it into the addressed byte or halfword position in Rd. The other parts of Rd are unaffected.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
ldm Rp{++}, Reglist16 |
Loadaddress = Rp; if Reglist16[PC] == 1 then if Rp == PC then Loadaddress = SP; PC = *(Loadaddress++); if Rp == PC then if Reglist16[LR,R12] == B'00 R12 = 0; else if Reglist16[LR,R12] == B'01 R12 = 1; else R12 = - 1; Test R12 and update flags; else if Reglist16[LR] == 1 LR = *(Loadaddress++); if Reglist16[SP] == 1 SP = *(Loadaddress++); if Reglist16[R12] == 1 R12 = *(Loadaddress++); Test R12 and update flags; else if Reglist16[LR] == 1 LR = *(Loadaddress++); if Reglist16[SP] == 1 SP = *(Loadaddress++); if Reglist16[R12] == 1 R12 = *(Loadaddress++); for (i = 11 to 0) if Reglist16[i] == 1 then Ri = *(Loadaddress++); if Opcode[++] == 1 then if Rp == PC then SP = Loadaddress; else Rp = Loadaddress; |
Reglist16 ∈ {R0, R1, R2, ..., R12, LR, SP, PC} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Loads the consecutive words pointed to by Rp into the registers specified in the instruction. The PC can be loaded, resulting in a jump to the loaded target address. If PC is loaded, the return value in R12 is tested and the flags are updated. The return value may optionally be set to -1, 0 or 1.
Flags are only updated if Reglist16[PC] == 1. |
|
They are set as the result of the operation cp R12, 0. |
|
Q: |
Not affected |
V: |
V = 0 |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = 0 |
Emtpy Reglist16 gives UNDEFINED result. If Rp is in Reglist16 and pointer is written back the result is UNDEFINED. The R bit in the status register has no effect on this instruction.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
ldmts Rp{++}, Reglist16 |
Loadaddress =Rp; for (i = 15 to 0) if Reglist16[i] == 1 then Ri USER =*(Loadaddress++); if Opcode[++] == 1 then Rp = Loadaddress; |
Reglist16 ∈ {R0, R1, R2, ..., R12, LR, SP} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Loads the consecutive words pointed to by Rp into the registers specified in the instruction.The target registers reside in the User Register Context, regardless of which context the instruction is called from.
Not affected. |
This instruction is intended for performing task switches. Emtpy Reglist16 gives UNDEFINED result. PC in Reglist16 gives UNDEFINED result.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
ldswp.shRd, Rp[disp] |
temp[15:0] = *(Rp+SE(disp12) << 1); Rd = SE(temp[7:0], temp[15:8]); |
{d, p} ∈ {0, 1, …, 15} disp ∈ {-4096, -4094, ..., 4094} |
Rev1+ |
| ||||||||||||
2 |
ldswp.uhRd, Rp[disp] |
temp[15:0] = *(Rp+SE(disp12) << 1); Rd = ZE(temp[7:0], temp[15:8]); |
{d, p} ∈ {0, 1, …, 15} disp ∈ {-4096, -4094, ..., 4094} |
Rev1+ |
| ||||||||||||
3 |
ldswp.wRd, Rp[disp] |
temp = *(Rp+SE(disp12) << 2); Rd = (temp[7:0], temp[15:8], temp[23:16], temp[31:24]); |
{d, p} ∈ {0, 1, …, 15} disp ∈ {-8192, -8188, ..., 8188} |
Rev1+ |
|
This instruction loads a halfword or a word from memory. If a halfword load is performed, the loaded value is zero- or sign-extended. The bytes in the loaded value are shuffled and the result is written back to Rd. The instruction can be used for performing loads from memories of differ- ent endianness.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
lsl Rd, Rx, Ry |
Rd = LSL(Rx, Ry[4:0]); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
lsl Rd, sa |
Rd = LSL(Rd, sa5); |
d ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||
3 |
lsl Rd, Rs, sa |
Rd = LSL(Rs, sa5); |
{d,s} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Shifts all bits in a register the amount of bits specified to the left. The shift amount can reside in a register or be specified as an immediate. Zeros are shifted into the LSBs. The last bit that is shifted out is placed in C.
Format I: Shamt = Ry[4:0], Op = Rx |
|
Format II: Shamt = sa5, Op = Rd |
|
Format III: Shamt = sa5, Op = Rs |
|
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
if Shamt != 0 C = Op[32-Shamt] else C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
lsr Rd, Rx, Ry |
Rd = LSR(Rx, Ry[4:0]); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
lsr Rd, sa |
Rd = LSR(Rd, sa5); |
d ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||
3 |
lsr Rd, Rs, sa |
Rd = LSR(Rs, sa5); |
{d,s} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Shifts all bits in a register the amount specified to the right. The shift amount may be specified by a register or an immediate. Zeros are shifted into the MSB.
Format I: Shamt = Ry[4:0], Op = Rx |
|
Format II: Shamt = sa5, Op = Rd |
|
Format III: Shamt = sa5, Op = Rs |
|
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
if Shamt != 0 C = Op[Shamt-1] else C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
mac Rd, Rx, Ry |
Rd = (Rx × Ry) + Rd; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a Multiply-Accumulate operation and stores the result into the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
machh.d Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); (Rd+1:Rd)[63:16] = (operand1 × operand2)[31:0] + (Rd+1:Rd)[63:16]; Rd[15:0] = 0; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified and adds the result to the specified doubleword- register. Only the 48 highest of the 64 possible bits in the doubleword accumulator are used. The 16 lowest bits are cleared. The halfword registers are selected as either the high or low part of the operand registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
machh.d R10, R2:t, R3:b will perform (R11 : R10)[63:16] = ( SE(R2[31:16]) × SE(R3[15:0]) ) + (R11 : R10)[63:16] R10[15:0] = 0
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
machh.w Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); Rd = (operand1 × operand2) + Rd; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified and adds the result to the specified word-register. The halfword registers are selected as either the high or low part of the operand registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
machh.w R10, R2:t, R3:b will perform R10 = ( SE(R2[31:16]) × SE(R3[15:0]) ) + R10
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
macs.d Rd, Rx, Ry |
acc = (Rd+1:Rd); prod = (Rx × Ry); res = prod + acc; (Rd+1:Rd) = res; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a Multiply-Accumulate operation with signed numbers and stores the result into the destination registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
macsathh.w Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If (operand1 == operand2 == 0x8000) product = 0x7FFF_FFFF; else product = (operand1 × operand2) << 1; Rd = Sat(product + Rd); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified, shifts the results one position to the left and stores the result as a temporary word-sized product. If the two operands equals -1, the product is saturated to the largest positive 32-bit fractional number. The halfword registers are selected as either the high or low part of the operand registers. The temporary product is added with sat- uration to Rd.
Q: |
Set if saturation occurred, or if the accumulation overflows, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
macsathh.wR10, R2:t, R3:b will perform R10 = Sat (Sat(( SE(R2[31:16]) × SE(R3[15:0]) ) << 1) + R10)
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
macu.d Rd, Rx, Ry |
acc = (Rd+1:Rd); prod = (Rx × Ry); res = prod + acc; (Rd+1:Rd) = res; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a Multiply-Accumulate operation with unsigned numbers and stores the result into the destination registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
macwh.d Rd, Rx, Ry:<part> |
operand1 = Rx; If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); (Rd+1:Rd)[63:16] = (operand1 × operand2)[47:0] + (Rd+1:Rd)[63:16]; Rd[15:0] = 0; |
d ∈ {0, 2, …, 14} {x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the word and halfword register specified and adds the result to the specified double- word-register. The halfword register is selected as either the high or low part of Ry. Only the 48 highest of the 64 possible bits in the doubleword accumulator are used. The 16 lowest bits are cleared.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
macwh.dR10, R2, R3:bwill perform (R11:R10)[63:16] = (R2 × SE(R3[15:0])) + (R11:R10)[63:16] R10[15:0] = 0
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
max Rd, Rx, Ry |
If Rx > Ry Rd = Rx; else Rd = Ry; |
d, x, y ∈ {0, 1, …, 15} |
Rev1+ |
|
Sets Rd equal to the signed maximum of Rx and Ry.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
mcall Rp[disp] |
LR = PC + 4 PC = *((Rp & 0xFFFFFFFC) + (SE(disp16) << 2)) |
p ∈ {0, 1, …, 15} disp ∈ {-131072, -131068,…, 131068} |
Rev1+ |
|
Subroutine call to a call destination specified in a location residing in memory.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
memc imm, bp5 |
*(SE(imm15<<2)[bp5]) = 0 |
bp5 ∈ {0, 1, …, 31} imm ∈ {-65536, -65532,…, 65532} |
Rev1+ |
|
Performs a read-modify-write operation to clear an arbitrary bit in memory. The word to modify is pointed to by a signed 17-bit address. This allows the instruction to address the upper 64KB and lower 64KB of mem- ory. This instruction is part of the optional RMW instruction set.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
mems imm, bp5 |
*(SE(imm15<<2)[bp5]) = 1 |
bp5 ∈ {0, 1, …, 31} imm ∈ {-65536, -65532,…, 65532} |
Rev1+ |
|
Performs a read-modify-write operation to set an arbitrary bit in memory. The word to modify is pointed to by a signed 17-bit address. This allows the instruction to address the upper 64KB and lower 64KB of mem- ory. This instruction is part of the optional RMW instruction set.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
memt imm, bp5 |
*(SE(imm15<<2)[bp5]) = ~*(SE(k15<<2)[bp5]) |
bp5 ∈ {0, 1, …, 31} imm ∈ {-65536, -65532,…, 65532} |
Rev1+ |
|
Performs a read-modify-write operation to toggle an arbitrary bit in memory. The word to modify is pointed to by a signed 17-bit address. This allows the instruction to address the upper 64KB and lower 64KB of memory. This instruction is part of the optional RMW instruction set.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
mfdr Rd, DebugRegisterNo |
Rd = DebugRegister[DebugRegisterAddress << 2]; |
DebugRegisterNo ∈ {0, 4, 8, ..., 1020} |
Rev1+ |
|
The instruction copies the value in the specified debug register to the specified register in the register file. Note that special timing concerns must be considered when operating on the debug registers, see the Pipeline Chapter for details.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Debug registers are implementation defined. If accessing a debug register that does not exist, the result is UNDEFINED.
This instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Violation exception.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
mfsr Rd, SystemRegisterAddress |
Rd = SystemRegister[SystemRegisterAddress << 2]; |
SystemRegisterAddress ∈ {0, 4, 8, ..., 1020} |
Rev1+ |
|
The instruction copies the value in the specified system register to the specified register in the register file. Note that special timing concerns must be considered when operating on the sys- tem registers, see the Pipeline Chapter for details.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Some system registers are implementation defined. If accessing a system register that does not exist, the result is UNDEFINED.
With the exception of accessing the JECR and JOSP system registers, this instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Viola- tion exception.
JECR and JOSP can be accessed from all modes with this instruction.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
min Rd, Rx, Ry |
If Rx < Ry Rd = Rx; else Rd = Ry; |
d, x, y ∈ {0, 1, …, 15} |
Rev1+ |
|
Sets Rd equal to the signed minimum of Rx and Ry.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
mov Rd, imm |
Rd = SE(imm8); |
d ∈ {0, 1, …, 15} imm ∈ {-128, -127, ..., 127} |
Rev1+ |
| ||||||||||||
2 |
mov Rd, imm |
Rd = SE(imm21); |
d ∈ {0, 1, …, 15} imm ∈ {-1048576, -104875, ..., 1048575} |
Rev1+ |
| ||||||||||||
3 |
mov Rd, Rs |
Rd = Rs; |
d, s ∈ {0, 1, …, 15} |
Rev1+ |
|
Moves a value into a register. The value may be an immediate or the contents of another regis- ter. Note that Rd may specify PC, resulting in a jump. All flags are unchanged.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
movh Rd, imm |
Rd = imm16<<16; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev2+ |
|
Moves a value into the high halfword of a register. The low halfword is cleared. All flags are unchanged.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mov{cond4} Rd, Rs |
if ( cond4) Rd = Rs; |
{d, s} ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev1+ |
| ||||||||||||||
2 |
mov{cond4} Rd, imm |
if ( cond4) Rd = SE(imm8); |
d ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} imm ∈ {-128, -127, ..., 127} |
Rev1+ |
|
Copies the contents of the source register or immediate to the destination register. The source register is unchanged. All flags are unchanged.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
mtdr DebugRegisterAddress, Rs |
DebugRegister[DebugRegisterAddress << 2] = Rs; |
DebugRegisterAddress ∈ {0, 4, 8, ..., 1020} |
Rev1+ |
|
The instruction copies the value in the specified register to the specified debug register. Note that special timing concerns must be considered when operating on the system registers, see the Pipeline Chapter for details.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
The debug registers are implementation defined, and updates of these registers are handled in an implementation specific way.
This instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Violation exception.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
mtsr SystemRegisterAddress, Rs |
SystemRegister[SystemRegisterAddress << 2] = Rs; |
SystemRegisterAddress ∈ {0, 4, 8, ..., 1020} |
Rev1+ |
|
The instruction copies the value in the specified register to the specified system register. Note that special timing concerns must be considered when operating on the system registers, see the Implementation Manual for details.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Some system registers are implementation defined. If writing a system register that does not exist, or to a register that is read only, the instruction is executed but no registers are updated.
With the exception of accessing the JECR and JOSP system registers, this instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Viola- tion exception. JECR and JOSP can be accessed from all modes with this instruction.
The instruction mtsr JOSP, Rx must be used with care. The programmer must ensure that no change of flow instruction nor an INCJOSP instruction follows mtsr JOSP, Rx within a number of instructions. This number of cycles is implementation defined. It should also be noted, that this is true even if the instructions are not to be executed. For instance the sequence
mtsr JOSP, Rx retj incjosp
will execute with an incorrect result. In practice this warning will only affect programmers writing their own Java Virtual Machine based on the AVR32 Java Extension module.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
mul Rd, Rs |
Rd = Rd × Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
mul Rd, Rx, Ry |
Rd = Rx × Ry; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
3 |
mul Rd, Rs, imm |
Rd = Rs × SE(imm8) |
{d, s} ∈ {0, 1, …, 15} imm ∈ {-128, -127, ..., 127} |
Rev1+ |
|
Multiplies the specified operands and stores the result in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
mulhh.w Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); Rd = operand1 × operand2; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified and stores the result in the destination word-regis- ter. The halfword registers are selected as either the high or low part of the operand registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulhh.wR10, R2:t, R3:b will perform R10 = SE(R2[31:16]) × SE(R3[15:0])
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
mulnhh.w Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); Rd = - (operand1 × operand2); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified and stores the result in the destination word-regis- ter. The halfword registers are selected as either the high or low part of the operand registers. The result is negated.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mulnwh.d Rd, Rx, Ry:<part> |
operand1 = Rx; If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); (Rd+1:Rd)[63:16] = - (operand1 × operand2); Rd[15:0] = 0; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the word register with the halfword register specified and stores the negated result in the destination register pair. The halfword register is selected as either the high or low part of Ry. Since the most significant part of the product is stored, no overflow will occur.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
muls.d Rd, Rx, Ry |
Rd+1:Rd = Rx × Ry; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Multiplies the two registers specified and stores the result in the destination registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
mulsathh.h Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If (operand1 == operand2 == 0x8000) Rd = 0x7FFF; else Rd = SE( (operand1 × operand2) >> 15 ); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified, shifts the results one position to the left and stores the sign-extended high halfword of the result in the destination word-register. If the two operands equals -1, the result is saturated to the largest positive 16-bit fractional number. The halfword registers are selected as either the high or low part of the operand registers.
Q: |
Set if saturation occurred, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulsathh.h R10, R2:t, R3:b will perform R10 = SE( Sat(SE(R2[31:16]) × SE(R3[15:0]) ) >> 15 )
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
mulsathh.w Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If (operand1 == operand2 == 0x8000) Rd = 0x7FFF_FFFF; else Rd = (operand1 × operand2) << 1; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified, shifts the results one position to the left and stores the result in the destination word-register. If the two operands equals -1, the result is sat- urated to the largest positive 32-bit fractional number. The halfword registers are selected as either the high or low part of the operand registers.
Q: |
Set if saturation occurred, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulsathh.w R10, R2:t, R3:b will perform R10 = Sat( (SE(R2[31:16]) × SE(R3[15:0] )) << 1)
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
mulsatrndhh.h Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If (operand1 == operand2 == 0x8000) Rd = 0x7FFF; else Rd = SE( ((operand1 × operand2) + 0x4000 ) >> 15 ); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the two halfword registers specified, shifts the results one position to the left and stores the result in the destination word-register. If the two operands equal -1, the result is satu- rated to the largest positive 16-bit fractional number. The halfword registers are selected as either the high or low part of the operand registers. The product is rounded.
Q: |
Set if saturation occurred, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulsatrndhh.h R10, R2:t, R3:b will perform R10 = SE( Sat( SE(R2[31:16]) × SE(R3[15:0]) ) + 0x4000) >> 15)
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mulsatrndwh.w Rd, Rx, Ry:<part> |
operand1 = Rx; If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If ((operand1 == 0x8000_0000) && (operand2 == 0x8000)) Rd = 0x7FFF_FFFF; else Rd = SE( ((operand1 × operand2) + 0x4000 ) >> 15 ); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the word register with the halfword register specified, rounds the upper 32 bits of the result and stores it in the destination word-register. The halfword register is selected as either the high or low part of Ry. Since the most significant part of the product is stored, no overflow will occur. If the two operands equals -1, the result is saturated to the largest positive 32-bit fractional number.
Q: |
Set if saturation occurred, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulsatrndwh.w R10, R2, R3b will perform R10 = (Sat( R2[31:16] × SE(R3[15:0]) ) + 0x4000) >> 15
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mulsatwh.w Rd, Rx, Ry:<part> |
operand1 = Rx; If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); If ((operand1 == 0x8000_0000) && (operand2 == 0x8000)) Rd = 0x7FFF_FFFF; else Rd = (operand1 × operand2) >> 15; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the word register with the halfword register specified and stores the upper 32 bits of the result in the destination word-register. The halfword register is selected as either the high or low part of Ry. Since the most significant part of the product is stored, no overflow will occur. If the two operands equal -1, the result is saturated to the largest positive 32-bit fractional number.
Q: |
Set if saturation occurred, or previously set. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
mulsatwh.wR10, R2, R3:b will perform R10 = Sat( R2 × SE(R3[15:0])) >> 15
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
mulu.d Rd, Rx, Ry |
Rd+1:Rd = Rx × Ry; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Multiplies the two registers specified and stores the result in the destination registers.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mulwh.d Rd, Rx, Ry:<part> |
operand1 = Rx; If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); (Rd+1:Rd)[63:16] = operand1 × operand2; Rd[15:0] = 0; |
d ∈ {0, 2, 4, …, 14} {x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Multiplies the word register with the halfword register specified and stores result in the destina- tion register pair. The halfword register is selected as either the high or low part of Ry. Since the most significant part of the product is stored, no overflow will occur.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
musfr Rs |
SR[3:0] = Rs[3:0]; |
s ∈ {0, 1, …, 15} |
Rev1+ |
|
The instruction copies the lower 4 bits of the register Rs to the lower 4 bits of the status register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
mustr Rd |
Rd = ZE(SR[3:0]); |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
The instruction copies the value of the 4 lower bits of the status register into the register Rd. The value is zero extended.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mvcr.d CP#, Rd, CRs |
(Rd+1:Rd) = CP#(CRs+1:CRs); |
# ∈ {0, 1, …, 7} {d, s} ∈ {0, 2, 4, …, 14} |
Rev1+ |
| ||||||||||||||
2 |
mvcr.w CP#, Rd, CRs |
Rd = CP#(CRs); |
# ∈ {0, 1, …, 7} {d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Addresses a coprocessor and moves the specified registers into the register file.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
mvcr.d CP2, R0, CR2
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
mvrc.d CP#, CRd, Rs |
CP#(CRd+1:CRd) = Rs+1:Rs; |
# ∈ {0, 1, …, 7} {d, s} ∈ {0, 2, 4, …, 14} |
Rev1+ |
| ||||||||||||||
2 |
mvrc.w CP#, CRd, Rs |
CP#(CRd) = Rs; |
# ∈ {0, 1, …, 7} {d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Moves the specified register into the addressed coprocessor.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
mvrc.d CP2, CR0, R2
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
neg Rd |
Rd = 0 -Rd; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform a two's complement of specified register.
Q: |
Not affected |
V: |
V = Rd[31] AND RES[31] |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = Rd[31] OR RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
nop |
none |
none |
Rev1+ |
|
Special instructions for "no operation" that does not create data depencencies in the pipeline
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
or Rd, Rs |
Rd = Rd OR Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
or Rd, Rx, Ry << sa |
Rd = Rx OR (Ry << sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
| ||||||||||||||
3 |
or Rd, Rx, Ry >> sa |
Rd = Rx OR (Ry >> sa5); |
{d, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, …, 31} |
Rev1+ |
|
Performs a bitwise logical OR between the specified registers and stores the result in the desti- nation register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
orh Rd, imm |
Rd[31:16] = Rd[31:16] OR imm16; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
| ||||||
2 |
orl Rd, imm |
Rd[15:0] = Rd[15:0] OR imm16; |
d ∈ {0, 1, …, 15} imm ∈ {0, 1, ..., 65535} |
Rev1+ |
|
Performs a bitwise logical OR between the high or low word in the specified register and a con- stant. The result is stored in the destination register.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
or{cond4} Rd, Rx, Ry |
if ( cond4) Rd = Rx OR Ry; |
{d, x, y} ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
Performs a bitwise logical OR between the specified registers and stores the result in the desti- nation register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
pabs.sb Rd, Rs |
Rd[31:24] = | Rs[31:24] |; Rd[23:16] = | Rs[23:16] |; Rd[15:8] = | Rs[15:8] |; Rd[7:0] = | Rs[7:0] |; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||
2 |
pabs.sh Rd, Rs |
Rd[31:16] = | Rs[31:16] |; Rd[15:0] = | Rs[15:0] |; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Compute the absolute values of four packed signed bytes (pabs.sb) or two packed signed half- words (pabs.sh) from the source register and store the results as packed bytes or halfwords in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
packsh.ub Rd, Rx, Ry |
Rd[31:24] = SATSU(Rx[31:16], 8); Rd[23:16] = SATSU(Rx[15:0], 8); Rd[15:8] = SATSU(Ry[31:16], 8); Rd[7:0] = SATSU(Ry[15:0], 8); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
packsh.sb Rd, Rx, Ry |
Rd[31:24] = SATS(Rx[31:16], 8); Rd[23:16] = SATS(Rx[15:0], 8); Rd[15:8] = SATS(Ry[31:16], 8); Rd[7:0] = SATS(Ry[15:0], 8); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Pack the four signed halfwords located in the two source registers into four bytes in the destina- tion register. Each of the signed halfwords are saturated to unsigned (packsh.ub) or signed bytes (packsh.sb).
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
packw.sh Rd, Rx, Ry |
Rd[31:16] = SATS(Rx, 16); Rd[15:0] = SATS(Ry, 16); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Pack the two words given in the source registers into two halfwords in the destination register. Each of the words are saturated to signed halfwords before being packed.
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
padd.b Rd, Rx, Ry |
Rd[31:24] = Rx[31:24] + Ry[31:24]; Rd[23:16] = Rx[23:16] + Ry[23:16]; Rd[15:8] = Rx[15:8] + Ry[15:8]; Rd[7:0] = Rx[7:0] + Ry[7:0]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
padd.h Rd, Rx, Ry |
Rd[31:16] = Rx[31:16] + Ry[31:16]; Rd[15:0] = Rx[15:0] + Ry[15:0]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform addition of four pairs of packed bytes (padd.b) or two pairs of halfwords (padd.h). Upon overflow any additional bits are discarded and the result is wrapped around.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
paddh.ub Rd, Rx, Ry |
Rd[31:24] = LSR(ZE(Rx[31:24], 9) + ZE(Ry[31:24], 9), 1) ; Rd[23:16] = LSR(ZE(Rx[23:16], 9) + ZE(Ry[23:16], 9), 1); Rd[15:8] = LSR(ZE(Rx[15:8], 9) + ZE(Ry[15:8], 9), 1); Rd[7:0] = LSR(ZE(Rx[7:0], 9) + ZE(Ry[7:0], 9), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
paddh.sh Rd, Rx, Ry |
Rd[31:16] = ASR(SE(Rx[31:16], 17) + SE(Ry[31:16], 17), 1); Rd[15:0] = ASR(SE(Rx[15:0], 17) + SE(Ry[15:0], 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform addition of four pairs of packed unsigned bytes (paddh.ub) or two pairs of packed signed halfwords (paddh.sh) with a halving of the result to prevent any overflows from occuring.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
padds.ub Rd, Rx, Ry |
Rd[31:24] = SATU(ZE(Rx[31:24], 9) + ZE(Ry[31:24], 9), 8) ; Rd[23:16] = SATU(ZE(Rx[23:16], 9) + ZE(Ry[23:16], 9), 8); Rd[15:8] = SATU(ZE(Rx[15:8], 9) + ZE(Ry[15:8], 9), 8); Rd[7:0] = SATU(ZE(Rx[7:0], 9) + ZE(Ry[7:0], 9), 8); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
padds.sb Rd, Rx, Ry |
Rd[31:24] = SATS(SE(Rx[31:24], 9) + SE(Ry[31:24], 9), 8); Rd[23:16] = SATS(SE(Rx[23:16], 9) + SE(Ry[23:16], 9), 8); Rd[15:8] = SATS(SE(Rx[15:8], 9) + SE(Ry[15:8], 9), 8); Rd[7:0] = SATS(SE(Rx[7:0], 9) + SE(Ry[7:0], 9), 8); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
3 |
padds.uh Rd, Rx, Ry |
Rd[31:16] = SATU(ZE(Rx[31:16], 17) + ZE(Ry[31:16], 17), 16); Rd[15:0] = SATU(ZE(Rx[15:0], 17) + ZE(Ry[15:0], 17), 16); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
4 |
padds.sh Rd, Rx, Ry |
Rd[31:16] = SATS(SE(Rx[31:16], 17) + SE(Ry[31:16], 17), 16); Rd[15:0] = SATS(SE(Rx[15:0], 17) + SE(Ry[15:0], 17), 16); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform addition of four pairs of packed bytes or two pairs of halfwords. The result is saturated to either unsigned bytes (padds.ub), signed bytes (padds.sb), unsigned halfwords (padds.uh) or signed halfwords (padds.sh).
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
paddsub.h Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = operand1 + operand2; Rd[15:0] = operand1 - operand2; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform an addition and subtraction on the same halfword operands which are selected from the source registers. The two halfword results are packed into the destination register without per- forming any saturation.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
paddsubh.sh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = ASR(SE(operand1, 17) + SE(operand2, 17), 1); Rd[15:0] = ASR(SE(operand1, 17) - SE(operand2, 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform an addition and subtraction on the same signed halfword operands which are selected from the source registers. The halfword results are halved in order to prevent any overflows from occuring
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
paddsubs.uh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = SATU(ZE(operand1, 17) + ZE(operand2, 17), 16); Rd[15:0] = SATSU(ZE(operand1, 17) - ZE(operand2, 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
| ||||||||||||||||
2 |
paddsubs.sh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = SATS(SE(operand1, 17) + SE(operand2, 17), 16); Rd[15:0] = SATS(SE(operand1, 17) - SE(operand2, 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform an addition and subtraction on the same halfword operands which are selected from the source registers. The resulting halfwords are saturated to unsigned halfwords (paddsubs.uh) or signed halfwords (paddsubs.sh) and then packed together in the destination register.
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
paddx.h Rd, Rx, Ry |
Rd[31:16] = Rx[31:16] + Ry[15:0] ; Rd[15:0] = Rx[15:0] + Ry[31:16]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Add together the top halfword of Rx with the bottom halfword of Ry and the bottom halfword of Rx with the top halfword of Ry. The resulting halfwords are packed together in the destination register without performing any saturation.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
paddxh.sh Rd, Rx, Ry |
Rd[31:16] = ASR(SE(Rx[31:16], 17) + SE(Ry[15:0], 17), 1); Rd[15:0] = ASR(SE(Rx[15:0], 17) + SE(Ry[31:16], 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Add together the top halfword of Rx with the bottom halfword of Ry and the bottom halfword of Rx with the top halfword of Ry. The resulting halfwords are halved in order to avoid any overflow and then packed together in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
paddxs.uh Rd, Rx, Ry |
Rd[31:16] = SATU(ZE(Rx[31:16], 17) + ZE(Ry[15:0], 17), 16) ; Rd[15:0] = SATU(ZE(Rx[15:0], 17) + ZE(Ry[31:16], 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
paddxs.sh Rd, Rx, Ry |
Rd[31:16] = SATS(SE(Rx[31:16], 17) + SE(Ry[15:0], 17), 16) ; Rd[15:0] = SATS(SE(Rx[15:0], 17) + SE(Ry[31:16], 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Add together the top halfword of Rx with the bottom halfword of Ry and the bottom halfword of Rx with the top halfword of Ry. The resulting halfwords are saturated to unsigned halfwords (paddxh.uh) or signed halfwords (paddxh.sh) and then packed together in the destination regis- ter.
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
pasr.b Rd, Rs, sa |
Rd[31:24] = ASR(Rs[31:24], sa3); Rd[23:16] = ASR(Rs[23:16], sa3); Rd[15:8] = ASR(Rs[15:8], sa3); Rd[7:0] = ASR(Rs[7:0], sa3); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
pasr.h Rd, Rs, sa |
Rd[31:16] = ASR(Rs[31:16], sa4); Rd[15:0] = ASR(Rs[15:0], sa4); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform an arithmetic shift right on each of the packed bytes or halfwords in the source register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
pavg.ub Rd, Rx, Ry |
Rd[31:24] = LSR(ZE(Rx[31:24], 9) + ZE(Ry[31:24], 9) + 1, 1); Rd[23:16] = LSR(ZE(Rx[23:16], 9) + ZE(Ry[23:16], 9) + 1, 1); Rd[15:8] = LSR(ZE(Rx[15:8], 9) + ZE(Ry[15:8], 9) + 1, 1); Rd[7:0] = LSR(ZE(Rx[7:0], 9) + ZE(Ry[7:0], 9) + 1, 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
pavg.sh Rd, Rx, Ry |
Rd[31:16] = ASR(SE(Rx[31:16], 17) + SE(Ry[31:16], 17) + 1, 1); Rd[15:0] = ASR(SE(Rx[15:0], 17) + SE(Ry[15:0], 17) + 1, 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Computes the average of pairs of packed unsigned bytes (pavg.ub) or packed signed halfwords (pavg.sh). The averages are computed by adding two values together while also adding in a rounding factor in the least significant bit. The result is then halved by shifting it one position to the right.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
plsl.b Rd, Rs, sa |
Rd[31:24] = LSL(Rs[31:24], sa3); Rd[23:16] = LSL(Rs[23:16], sa3); Rd[15:8] = LSL(Rs[15:8], sa3); Rd[7:0] = LSL(Rs[7:0], sa3); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
plsl.h Rd, Rs, sa |
Rd[31:16] = LSL(Rs[31:16], sa4); Rd[15:0] = LSL(Rs[15:0], sa4); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform a logical shift left on each of the packed bytes or halfwords in the source register and store the result to the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
plsr.b Rd, Rs, sa |
Rd[31:24] = LSR(Rs[31:24], sa3); Rd[23:16] = LSR(Rs[23:16], sa3); Rd[15:8] = LSR(Rs[15:8], sa3); Rd[7:0] = LSR(Rs[7:0], sa3); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
plsr.h Rd, Rs, sa |
Rd[31:16] = LSR(Rs[31:16], sa4); Rd[15:0] = LSR(Rs[15:0], sa4); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform a logical shift right on each of the packed bytes or halfwords in the source register and store the result to the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
pmax.ub Rd, Rx, Ry |
If ( Rx[31:24] > Ry[31:24] ) then Rd[31:24] = Rx[31:24] else Rd[31:24] = Ry[31:24] ; If ( Rx[23:16] > Ry[23:16] ) then Rd[23:16] = Rx[23:16] else Rd[23:16] = Ry[23:16] ; If ( Rx[15:8] > Ry[15:8] ) then Rd[15:8] = Rx[15:8] else Rd[15:8] = Ry[15:8] ; If ( Rx[7:0] > Ry[7:0] ) then Rd[7:0] = Rx[7:0] else Rd[7:0] = Ry[7:0] ; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
pmax.sh Rd, Rx, Ry |
If ( Rx[31:16] > Ry[31:16] ) then Rd[31:16] = Rx[31:16] else Rd[31:16] = Ry[31:16] ; If ( Rx[15:0] > Ry[15:0] ) then Rd[15:0] = Rx[15:0] else Rd[15:0] = Ry[15:0] ; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Compute the maximum values of pairs of packed unsigned bytes (pmax.ub) or packed signed halfwords (pmax.sh).
Format I: |
|
Q: |
Not affected. |
V: |
( Rx[7:0] > Ry[7:0] ) |
N: |
( Rx[15:8] > Ry[15:8] ) |
Z: |
( Rx[23:16] > Ry[23:16] ) |
C: |
( Rx[31:24] > Ry[31:24] ) |
Format II: |
|
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
( Rx[15:0] > Ry[15:0] ) |
C: |
( Rx[31:16] > Ry[31:16] ) |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
pmin.ub Rd, Rx, Ry |
If ( Rx[31:24] < Ry[31:24] ) then Rd[31:24] = Rx[31:24] else Rd[31:24] = Ry[31:24] ; If ( Rx[23:16] < Ry[23:16] ) then Rd[23:16] = Rx[23:16] else Rd[23:16] = Ry[23:16] ; If ( Rx[15:8] < Ry[15:8] ) then Rd[15:8] = Rx[15:8] else Rd[15:8] = Ry[15:8] ; If ( Rx[7:0] < Ry[7:0] ) then Rd[7:0] = Rx[7:0] else Rd[7:0] = Ry[7:0] ; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
pmin.sh Rd, Rx, Ry |
If ( Rx[31:16] < Ry[31:16] ) then Rd[31:16] = Rx[31:16] else Rd[31:16] = Ry[31:16] ; If ( Rx[15:0] < Ry[15:0] ) then Rd[15:0] = Rx[15:0] else Rd[15:0] = Ry[15:0] ; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Compute the minimum values of pairs of packed unsigned bytes (pmin.ub) or packed signed halfwords (pmin.sh).
Format I: |
|
Q: |
Not affected. |
V: |
( Rx[7:0] < Ry[7:0] ) |
N: |
( Rx[15:8] < Ry[15:8] ) |
Z: |
( Rx[23:16] < Ry[23:16] ) |
C: |
( Rx[31:24] < Ry[31:24] ) |
Format II: |
|
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
( Rx[15:0] < Ry[15:0] ) |
C: |
( Rx[31:16] < Ry[31:16] ) |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
popjc |
temp =FRAME; JAVA_LV0 =*(temp--); JAVA_LV1 =*(temp--); JAVA_LV2 =*(temp--); JAVA_LV3 =*(temp--); JAVA_LV4 =*(temp--); JAVA_LV5 =*(temp--); JAVA_LV6 =*(temp--); JAVA_LV7 =*(temp--); |
none |
Rev1+ |
|
Fetch the system registers LV0 to LV7 used in Java state from the current method frame. The register FRAME (equal to R9) is used as pointer register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
popm Reglist8 {, R12 = {-1, 0, 1}} |
if Reglist8[PC] AND k == B'1 PC = *(SP++) if Reglist8[LR:R12] == B'00 R12 = 0; else if Reglist8[LR:R12] == B'01 R12 = 1; else R12 = - 1; Test R12 and update flags; else if Reglist8[PC] == 1 then PC = *(SP++); if Reglist8[LR] == 1 then LR = *(SP++); if Reglist8[R12] == 1 then R12 =*(SP++); if Reglist8[PC] == 1 then Test R12 and update flags; if Reglist8[5] == 1 then R11 =*(SP++); if Reglist8[4] == 1 then R10 =*(SP++); if Reglist8[3] == 1 then R9 = *(SP++); R8 = *(SP++); if Reglist8[2] == 1 then R7 = *(SP++); R6 = *(SP++); R5 = *(SP++); R4 = *(SP++); if Reglist8[1] == 1 then R3 = *(SP++); R2 = *(SP++); R1 = *(SP++); R0 = *(SP++); |
Reglist8 ∈ {R0- R3, R4-R7, R8-R9, R10,R11, R12, LR, PC} |
Rev1+ |
|
Loads the consecutive words pointed to by SP into the registers specified in the instruction. The PC can be loaded, resulting in a jump to the loaded value. If PC is popped, the return value in R12 is tested and the flags are updated. R12 can optionally be updated with -1, 0 or 1. The k bit in the instruction coding is used to optionally let the POPM instruction update the return register R12 with the values -1, 0 or 1.
Flags are only updated if Reglist8[PC] == 1. |
|
They are set as the result of the operation cp R12, 0 |
|
Q: |
Not affected |
V: |
V = 0 |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = 0 |
Emtpy Reglist8 gives UNDEFINED result. The R bit in the status register has no effect on this instruction.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
pref Rp[disp] |
Prefetch cache line containing the address (Rp + SE(disp16)). |
p ∈ {0, 1, …, 15} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
|
This instruction allows the programmer to explicitly state that the cache should prefetch the specified line. The memory system treats this instruction in an implementation-dependent man- ner, and implementations without cache treats the instruction as a NOP. A prefetch instruction never reduces the performance of the system. If the prefetch instruction performs an action that would lower the system performance, it is treated as a NOP. For example, if the prefetch instruc- tion is about to generate an addressing exception, the instruction is cancelled and no exception is taken.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psad Rd, Rx, Ry |
Rd = | Rx[31:24] - Ry[31:24] | + | Rx[23:16] - Ry[23:16] | + | Rx[15:8] - Ry[15:8] | + | Rx[7:0] - Ry[7:0] |; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Compute the Sum of Absolute Differences (SAD) of four pairs of packed unsigned bytes from the source registers and store the result in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psub.b Rd, Rx, Ry |
Rd[31:24] = Rx[31:24] - Ry[31:24]; Rd[23:16] = Rx[23:16] - Ry[23:16]; Rd[15:8] = Rx[15:8] - Ry[15:8]; Rd[7:0] = Rx[7:0] - Ry[7:0]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
psub.h Rd, Rx, Ry |
Rd[31:16] = Rx[31:16] - Ry[31:16]; Rd[15:0] = Rx[15:0] - Ry[15:0]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform subtraction of four pairs of packed bytes (psub.b) or two pairs of halfwords (psub.h). Upon overflow any additional bits are discarded and the result is wrapped around.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
psubadd.h Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = operand1 - operand2; Rd[15:0] = operand1 + operand2; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform an subtraction and addition on the same halfword operands which are selected from the source registers. The two halfword results are packed into the destination register without per- forming any saturation.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
psubaddh.sh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = ASR(SE(operand1, 17) - SE(operand2, 17), 1); Rd[15:0] = ASR(SE(operand1, 17) + SE(operand2, 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform a subtraction and addition on the same halfword operands which are selected from the source registers. The halfword results are halved in order to prevent any overflows from occuring
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
psubadds.uh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = SATSU(ZE(operand1, 17) - ZE(operand2, 17), 16); Rd[15:0] = SATU(ZE(operand1, 17) + ZE(operand2, 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
| ||||||||||||||||
2 |
psubadds.sh Rd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = Rx[31:16] else operand1 = Rx[15:0]; If (Ry-part == t) then operand2 = Ry[31:16] else operand2 = Ry[15:0]; Rd[31:16] = SATS(SE(operand1, 17) - SE(operand2, 17), 16 ); Rd[15:0] = SATS(SE(operand1, 17) + SE(operand2, 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Perform a subtraction and addition on the same halfword operands which are selected from the source registers. The resulting halfwords are saturated to unsigned halfwords (psubadds.uh) or signed halfwords (psubadds.sh) and then packed together in the destination register.
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psubh.ub Rd, Rx, Ry |
Rd[31:24] = LSR(ZE(Rx[31:24], 9) - ZE(Ry[31:24], 9), 1); Rd[23:16] = LSR(ZE(Rx[23:16], 9) - ZE(Ry[23:16], 9), 1); Rd[15:8] = LSR(ZE(Rx[15:8], 9) - ZE(Ry[15:8], 9), 1); Rd[7:0] = LSR(ZE(Rx[7:0], 9) - ZE(Ry[7:0], 9), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
psubh.sh Rd, Rx, Ry |
Rd[31:16] = ASR(SE(Rx[31:16], 17) - SE(Ry[31:16], 17), 1); Rd[15:0] = ASR(SE(Rx[15:0], 17) - SE(Ry[15:0], 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform subtraction of four pairs of packed unsigned bytes (psub.ub) or two pairs of signed half- words (psub.sh) with a halfing of the result to prevent any overflows from occuring.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psubs.ub Rd, Rx, Ry |
Rd[31:24] = SATSU(ZE(Rx[31:24], 9) - ZE(Ry[31:24], 9), 8) ; Rd[23:16] = SATSU(ZE(Rx[23:16], 9) - ZE(Ry[23:16], 9), 8); Rd[15:8] = SATSU(ZE(Rx[15:8], 9) - ZE(Ry[15:8], 9), 8); Rd[7:0] = SATSU(ZE(Rx[7:0], 9) - ZE(Ry[7:0], 9), 8); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
psubs.sb Rd, Rx, Ry |
Rd[31:24] = SATS(SE(Rx[31:24], 9) - SE(Ry[31:24], 9), 8); Rd[23:16] = SATS(SE(Rx[23:16], 9) - SE(Ry[23:16], 9), 8); Rd[15:8] = SATS(SE(Rx[15:8], 9) - SE(Ry[15:8], 9), 8); Rd[7:0] = SATS(SE(Rx[7:0], 9) - SE(Ry[7:0], 9), 8); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
3 |
psubs.uh Rd, Rx, Ry |
Rd[31:16] = SATSU(ZE(Rx[31:16], 17) - ZE(Ry[31:16], 17), 16); Rd[15:0] = SATSU(ZE(Rx[15:0], 17) - ZE(Ry[15:0], 17), 16); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
4 |
psubs.sh Rd, Rx, Ry |
Rd[31:16] = SATS(SE(Rx[31:16], 17) - SE(Ry[31:16], 17), 16); Rd[15:0] = SATS(SE(Rx[15:0], 17) - SE(Ry[15:0], 17), 16); |
I, II, III, IV.{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Perform subtraction of four pairs of packed bytes or two pairs of halfwords. The result is satu- rated to either unsigned bytes (psubs.ub), signed bytes (psubs.sb), unsigned halfwords (psubs.uh) or signed halfwords (psubs.sh).
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psubx.h Rd, Rx, Ry |
Rd[31:16] = Rx[31:16] - Ry[15:0] ; Rd[15:0] = Rx[15:0] - Ry[31:16]; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Subtract the bottom halfword of Ry from the top halfword of Rx and the top halfword of Ry from the bottom halfword of Rx. The resulting halfwords are packed together in the destination regis- ter without performing any saturation.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psubxh.sh Rd, Rx, Ry |
Rd[31:16] = ASR(SE(Rx[31:16], 17) - SE(Ry[15:0], 17), 1); Rd[15:0] = ASR(SE(Rx[15:0], 17) - SE(Ry[31:16], 17), 1); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Subtract the bottom halfword of Ry from the top halfword of Rx and the top halfword of Ry from the bottom halfword of Rx. The resulting halfwords are halved in order to avoid any overflow and then packed together in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
psubxs.uh Rd, Rx, Ry |
Rd[31:16] = SATSU(ZE(Rx[31:16], 17) - ZE(Ry[15:0], 17), 16) ; Rd[15:0] = SATSU(ZE(Rx[15:0], 17) - ZE(Ry[31:16], 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
psubxs.sh Rd, Rx, Ry |
Rd[31:16] = SATS(SE(Rx[31:16], 17) - SE(Ry[15:0], 17), 16) ; Rd[15:0] = SATS(SE(Rx[15:0], 17) - SE(Ry[31:16], 17), 16); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Subtract the bottom halfword of Ry from the top halfword of Rx and the top halfword of Ry from the bottom halfword of Rx. The resulting halfwords are saturated to unsigned halfwords (psubxh.uh) or signed halfwords (psubxh.sh) and then packed together in the destination regis- ter.
Q: |
Flag set if saturation occured in one or more of the partial operations. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
punpckub.h Rd, Rs:<part> |
If ( Rs-part == top ) then Rd[31:16] = ZE(Rs[31:24], 16); Rd[15:0] = ZE(Rs[23:16], 16); else Rd[31:16] = ZE(Rs[15:8], 16); Rd[15:0] = ZE(Rs[7:0], 16); |
{d, s} ∈ {0, 1, …, 15} part ∈ {t, b} |
Rev1+ |
| ||||||||||||
2 |
punpcksb.h Rd, Rs:<part> |
If ( Rs-part == top ) then Rd[31:16] = SE(Rs[31:24], 16); Rd[15:0] = SE(Rs[23:16], 16); else Rd[31:16] = SE(Rs[15:8], 16); Rd[15:0] = SE(Rs[7:0], 16); |
{d, s} ∈ {0, 1, …, 15} part ∈ {t, b} |
Rev1+ |
|
Unpack two unsigned bytes (punpckub.h) or two signed bytes (punpcksb.h) from the source reg- ister to two packed halfwords in the destination register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
pushjc |
temp =FRAME; *(temp--) =JAVA_LV0; *(temp--) =JAVA_LV1; *(temp--) =JAVA_LV2; *(temp--) =JAVA_LV3; *(temp--) =JAVA_LV4; *(temp--) =JAVA_LV5; *(temp--) =JAVA_LV6; *(temp--) =JAVA_LV7; |
none |
Rev1+ |
|
Stores the system registers LV0 to LV7 used in Java state to designated place on the current method frame. FRAME (equal to R9) is used as pointer register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
pushm Reglist8 |
if Reglist8[0] == 1 then *(--SP) =R0; *(--SP) =R1; *(--SP) =R2; *(--SP) =R3; if Reglist8[1] == 1 then *(--SP) =R4; *(--SP) =R5; *(--SP) =R6; *(--SP) =R7; if Reglist8[2] == 1 then *(--SP) =R8; *(--SP) =R9; if Reglist8[3] == 1 then *(--SP) =R10; if Reglist8[4] == 1 then *(--SP) =R11; if Reglist8[5] == 1 then *(--SP) =R12; if Reglist8[6] == 1 then *(--SP) =LR; if Reglist8[7] == 1 then *(--SP) =PC; |
Reglist8 ∈ {R0- R3, R4-R7, R8-R9, R10,R11, R12, LR, PC} |
Rev1+ |
|
Stores the registers specified in the instruction into consecutive words pointed to by SP.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Emtpy Reglist8 gives UNDEFINED result. The R bit in the status register has no effect on this instruction.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
rcall PC[disp] |
LR = PC + 2 PC = PC + (SE(disp10)<<1) |
disp ∈ {-1024, -1022, ..., 1022} |
Rev1+ |
| ||||||||||||
2 |
rcall PC[disp] |
LR = PC + 4 PC = PC + (SE(disp21)<<1) |
disp ∈ {-2097152, -2097150, ..., 2097150} |
Rev1+ |
|
PC-relative call of subroutine
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
retd |
SR = RSR_DBG PC = RAR_DBG |
None |
Rev1+ |
|
Return from debug mode.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
This instruction can only be executed in a privileged mode. Execution from any other mode will trigger a Privilege Violation exception.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
RETE |
If (microarchitecture == AVR32A) SR = *(SPSYS++) PC = *(SPSYS++) If ( SR[M2:M0] == {B'010, B'011, B'100, B'101} ) LR = *(SPSYS++) R12 = *(SPSYS++) R11 = *(SPSYS++) R10 = *(SPSYS++) R9 = *(SPSYS++) R8 = *(SPSYS++) SREG[L] = 0; else SR = RSRCurrent Context PC = RARCurrent Context SREG[L] = 0; |
None |
Rev1+ |
|
Returns from an exception or interrupt. SREG[L] is cleared to support atomical memory access with the stcond instruction. This instruction can only be executed in INT0-INT3, EX and NMI modes. Execution in Application or Supervisor modes will trigger a Privilege Violation exception.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
retj |
PC = LR; J = 1; R = 0; if ( SR[M2:M0] == B'001 ) GM = 0; |
None |
Rev1+ |
|
Returns from a Java trap.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
RETS |
If ( SR[M2:M0] == B'000 ) Issue Privilege Violation Exception; else if ( SR[M2:M0] == B'001 ) If (microarchitecture == AVR32A) SR = *(SPSYS++) PC = *(SPSYS++) else SR = RSRSUP; PC = RARSUP; else PC = LRCurrent Context |
None |
Rev1+ |
|
Returns from a supervisor call.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
RETSS |
If ( SR[SS] == 0 ) Issue Privilege Violation Exception; else SR = SS_RSR PC = SS_RAR |
None |
Rev3+ |
|
Returns from Secure State.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
ret{cond4} Rs |
If (cond4) If (Rs != {LR, SP, PC}) R12 = Rs; else if (Rs == LR) R12 = -1; else if (Rs == SP) R12 = 0; else R12 = 1; Test R12 and set flags; PC = LR; |
cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} s ∈{0, 1, …, 15} |
Rev1+ |
|
Return from subroutine if the specified condition is true. Values are moved into the return regis- ter, the return value is tested, and flags are set.
Flags are set as result of the operation CP R12, 0. |
|
Q: |
Not affected |
V: |
V = 0 |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
rjmp PC[disp] |
PC = PC + (SE(disp10)<<1); |
disp ∈ {-1024, -1022, ..., 1022} |
Rev1+ |
|
Jump the specified amount relative to the Program Counter .
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
rol Rd |
C´ = Rd[31]; Rd = Rd << 1; Rd[0] = C; C = C´; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Shift all bits in Rd one place to the left. The C flag is shifted into the LSB. The MSB is shifted into the C flag.
Q: |
Not affected |
V: |
Not affected |
N: |
N = Res[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = Rd[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
ror Rd |
C´ = Rd[0]; Rd = Rd >> 1; Rd[31] = C; C = C´; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Shift all bits in Rd one place to the right. The C flag is shifted into the MSB. The LSB is shifted into the C flag.
Q: |
Not affected |
V: |
Not affected |
N: |
N = Res[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = Rd[0] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
rsub Rd, Rs |
Rd = Rs - Rd; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
rsub Rd, Rs, imm |
Rd = SE(imm8) - Rs; |
{d, s} ∈ {0, 1, …, 15} imm ∈ {-128, -127, ..., 127} |
Rev1+ |
|
Performs a subtraction and stores the result in destination register. Similar to sub, but the minu- end and subtrahend are interchanged.
Format I: OP1 = Rs, OP2 = Rd |
|
Format II: OP1 = SE(imm8), OP2 = Rs |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND ~OP2[31] AND ~RES[31]) OR (~OP1[31] AND OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~OP1[31] AND OP2[31] OR OP2[31] AND RES[31] OR ~OP1[31] AND RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
rsub{cond4} Rd, imm |
if ( cond4) Rd = SE(imm8) - Rd; |
d ∈ {0, 1, …, 15} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} imm ∈ {-128, -127, ..., 127} |
Rev2+ |
|
Performs a subtraction and stores the result in destination register. Similar to sub, but the minu- end and subtrahend are interchanged.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
satadd.hRd, Rx, Ry |
temp = ZE(Rx[15:0]) + ZE(Ry[15:0])); if (Rx[15] AND Ry[15] AND ~temp[15]) OR (~Rx[15] AND ~Ry[15] AND temp[15]) then if Rx[15] == 0 then Rd = 0x00007fff; else Rd = 0xffff8000; else Rd = SE(temp[15:0]); |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Adds the two halfword registers specified and stores the result in destination register. The result is saturated if it overflows the range representable with 16 bits. If saturation occurs, the Q flag is set.
Q: |
Q = (Rx[15] AND Ry[15] AND ~temp[15]) OR (~Rx[15] AND ~Ry[15] AND temp[15]) OR Q |
V: |
V = (Rx[15] AND Ry[15] AND ~temp[15]) OR (~Rx[15] AND ~Ry[15] AND temp[15]) |
N: |
N = Rd[15] |
Z: |
Z = if (Rd[15:0] == 0) |
C: |
C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
satadd.wRd, Rx, Ry |
temp = Rx + Ry; if (Rx[31] AND Ry[31] AND ~temp[31]) OR (~Rx[31] AND ~Ry[31] AND temp[31]) then if Rx[31] == 0 then Rd = 0x7fffffff; else Rd = 0x8000000; else Rd = temp; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Adds the two registers specified and stores the result in destination register. The result is satu- rated if a two's complement overflow occurs. If saturation occurs, the Q flag is set.
Q: |
Q = (Rx[31] AND Ry[31] AND ~temp[31]) OR (~Rx[31] AND ~Ry[31] AND temp[31]) OR Q |
V: |
V = (Rx[31] AND Ry[31] AND ~temp[31]) OR (~Rx[31] AND ~Ry[31] AND temp[31]) |
N: |
N = Rd[31] |
Z: |
Z = (Rd[31:0] == 0) |
C: |
C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
satrnds Rd >> sa, bp |
Temp = Rd >> sa if (sa != 0) Rnd = Rd[sa-1] Temp = Temp + Rnd; if ((Temp == SE( Temp[bp-1:0])) || (bp == 0) ) Rd = Temp; else if (Temp[31] == 1) Rd = -2bp-1; else Rd = 2bp-1 - 1; |
d ∈ {0, 1, …, 15} {sa, bp} ∈ {0, 1, …, 31} |
Rev1+ |
|
This instruction considers the value in (Rd>>sa)[bp-1:0] as a signed value. Rounding is per- formed after the shift. If the value in (Rd>>sa)[31:bp] is not merely a sign-extention of this value, overflow has occurred and saturation is performed to the maximum signed positive or negative value. If saturation occurs, the Q flag is set. An arithmetic shift is performed on Rd. If bp equals zero, no saturation is performed.
Q: |
Set if saturation occurred or Q was already set, cleared otherwise. |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
satrndu Rd >> sa, bp |
Temp = Rd >> sa if (sa != 0) Rnd = Rd[sa-1] Temp = Temp + Rnd; If ((Temp == ZE( Temp[bp-1:0])) || (bp == 0) ) Rd = Temp; else if (Temp[31] == 1) Rd = 0x0000_0000; else Rd = 2bp - 1; |
d ∈ {0, 1, …, 15} {sa, bp} ∈ {0, 1, …, 31} |
Rev1+ |
|
This instruction considers the value in (Rd>>sa)[bp-1:0] as a unsigned value. Rounding is per- formed after the shift. If the value in (Rd>>sa)[31:bp] is not merely a zero extention of this value, overflow has occurred and saturation is performed to the maximum unsigned positive value or zero. If saturation occurs, the Q flag is set. An arithmetic shift is performed on Rd. If bp equals zero, no saturation is performed.
Q: |
Set if saturation occurred or Q was already set, cleared otherwise. |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
sats Rd >> sa, bp |
Temp = Rd >> sa If ((Temp == SE( Temp[bp-1:0])) || (bp == 0)) Rd = Temp; else if (Temp[31] == 1) Rd = -2bp-1; else Rd = 2bp-1 - 1; |
d ∈ {0, 1, …, 15} {sa, bp} ∈ {0, 1, …, 31} |
Rev1+ |
|
This instruction considers the value in (Rd>>sa)[bp-1:0] as a signed value. If the value in (Rd>>sa)[31:bp] is not merely a sign-extention of this value, overflow has occurred and satura- tion is performed to the maximum signed positive or negative value. If saturation occurs, the Q flag is set. An arithmetic shift is performed on Rd. If bp equals zero, no saturation is performed.
Q: |
Set if saturation occurred or Q was already set, cleared otherwise. |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
satsub.hRd, Rx, Ry |
temp = ZE(Rx[15:0]) - ZE(Ry[15:0]) ; if (Rx[15] AND ~Ry[15] AND ~temp[15]) OR (~Rx[15] AND Ry[15] AND temp[15]) then if Rx[15]==0 then Rd = 0x00007fff; else Rd = 0xffff8000; else Rd = SE(temp[15:0]); |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a subtraction of the specified halfwords and stores the result in destination register. The result is saturated if it overflows the range representable with 16 bits. If saturation occurs, the Q flag is set.
Q: |
Q = (Rx[15] AND ~Ry[15] AND ~temp[15]) OR (~Rx[15] AND Ry[15] AND temp[15]) OR Q |
V: |
V = (Rx[15] AND ~Ry[15] AND ~temp[15]) OR (~Rx[15] AND Ry[15] AND temp[15]) |
N: |
N = Rd[15] |
Z: |
Z = (Rd[15:0] == 0) |
C: |
C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
satsub.w Rd, Rx, Ry |
temp = Rx - Ry; |
{d, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
satsub.w Rd, Rs, imm |
temp = Rs - SE(imm16)); Format I: OP1 = Rx, OP2 = Ry Format II: OP1 = Rs, OP2 = SE(imm16) if (OP1[31] AND ~OP2[31] AND ~temp[31]) OR (~OP1[31] AND OP2[31] AND temp[31]) then if(OP1[31]==0) then Rd = 0x7fffffff; else Rd = 0x80000000; else Rd = temp |
{d, s} ∈ {0, 1, …, 15} imm ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
|
Performs a subtraction and stores the result in destination register. The result is saturated if a two's complement overflow occurs. If saturation occurs, the Q flag is set.
Format I: OP1 = Rx, OP2 = Ry |
|
Format II: OP1 = Rs, OP2 = SE(imm16) |
|
Q: |
Q = (OP1[31] AND ~OP2[31] AND ~temp[31]) OR (~OP1[31] AND OP2[31] AND temp[31]) OR |
Q |
|
V: |
V = (OP1[31] AND ~OP2[31] AND ~temp[31]) OR (~OP1[31] AND OP2[31] AND temp[31]) |
N: |
N = Rd[31] |
Z: |
Z = (Rd[31:0] == 0) |
C: |
C = 0 |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
satu Rd >> sa, bp |
Temp = Rd >> sa If ((Temp == ZE( Temp[bp-1:0])) || (bp == 0) ) Rd = Temp; else if (Temp[31] == 1) Rd = 0x0000_0000; else Rd = 2bp - 1; |
d ∈ {0, 1, …, 15} {sa, bp} ∈ {0, 1, …, 31} |
Rev1+ |
|
This instruction considers the value in (Rd>>sa)[bp-1:0] as a unsigned value. If the value in (Rd>>sa)[31:bp] is not merely a zero extention of this value, overflow has occurred and satura- tion is performed to the maximum unsigned positive value or zero. If saturation occurs, the Q flag is set. An arithmetic shift is performed on Rd. If bp equals zero, no saturation is performed.
Q: |
Set if saturation occurred or Q was already set, cleared otherwise. |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
sbc Rd, Rx, Ry |
Rd = Rx - Ry - C; |
{x, y, d} ∈ {0, 1, …, 15} |
Rev1+ |
|
Subtracts a specified register and the value of the carry bit from a destination register and stores the result in the destination register.
Q: |
Not affected. |
V: |
V = (Rx[31] AND ~Ry[31] AND ~RES[31]) OR (~Rx[31] AND Ry[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = ~Rx[31] AND Ry[31] OR Ry[31] AND RES[31] OR ~Rx[31] AND RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
sbr Rd, bp |
Rd[bp5] = 1; |
d ∈ {0, 1, …, 15} bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Sets a bit in the specified register. All other bits are unaffected.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Z = 0 |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
scall |
If ( SR[M2:M0] == {B'000 or B'001} ) If (microarchitecture == AVR32A) *(--SPSYS) = PC + 2; *(--SPSYS) = SR; PC = EVBA + 0x100; SR[M2:M0] = B'001; else RARSUP = PC + 2; RSRSUP = SR; PC = EVBA + 0x100; SR[M2:M0] = B'001; else LRCurrent Context = PC + 2; PC = EVBA + 0x100; |
none |
Rev1+ |
|
The scall instruction performs a supervisor routine call. The behaviour of the instruction is dependent on the mode it is called from, allowing scall to be executed from all contexts. Scall jumps to a dedicated entry point relative to EVBA. Scall can use the same call convention as regular subprogram calls.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
scr Rd |
Rd = Rd - C; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Subtracts carry from the specified destination register.
Q: |
Not affected |
V: |
V = (Rd[31] AND ~RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) AND Z |
C: |
C = ~Rd[31] AND RES[31] |
; Subtract a 32-bit variable (R0) from a 64-bit variable (R2:R1) sub
R1, R0
scr
R2
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
sleep Op8 |
Set the system in the specified sleep mode. |
Op8 ∈ {0, 1, …, 255} |
Rev1+ |
|
Sets the system in the sleep mode specified by the implementation defined Op8 operand. The semantic of Op8 is IMPLEMENTATION DEFINED. If bit 7 in Op8 is one, SR[GM] will be cleared when entering sleep mode.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
The sleep instruction is a privileged instruction, and will trigger a Privilege Violation exception if executed in user mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
sr{cond4} Rd |
if (cond4) Rd = 1; else Rd = 0; |
cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} d ∈ {0, 1, ..., 15} |
Rev1+ |
|
Sets the register specified to 1 if the condition specified is true, clear the register otherwise.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
sscall |
SS_RAR = PC; SS_RSR = SR; If (microarchitecture == AVR32A) PC = 0x8000_0004; else) PC = 0xA000_0004; SR[SS] = 1; SR[GM] = 1; if (SR[M2:M0] == 0) SR[M2:M0] = 001; |
none |
Rev3+ |
|
The sscall instruction performs a secure state call. Sscall can use the same call convention as regular subprogram calls.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
ssrf bp |
SR[bp5] = 1; |
bp ∈ {0, 1, …, 31} |
Rev1+ |
|
Sets the status register (SR) flag specified.
SR[bp5] = 1, all other flags unchanged. |
Privileged if bp5 > 15, ie. upper half of status register. An exception will be triggered if the upper half of the status register is attempted changed in user mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.b Rp++, Rs |
*(Rp) = Rs[7:0]; Rp = Rp + 1; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
st.b --Rp, Rs |
Rp = Rp - 1; *(Rp) = Rs[7:0]; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
st.b Rp[disp], Rs |
*(Rp + ZE(disp3)) = Rs[7:0]; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {0, 1, ..., 7} |
Rev1+ |
| ||||||||||||||
4 |
st.b Rp[disp], Rs |
*(Rp + SE(disp16)) = Rs[7:0]; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
| ||||||||||||||
5 |
st.b Rb[Ri << sa], Rs |
*(Rb + (Ri << sa2)) = Rs[7:0]; |
{b, i, s} ∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
The source register is stored to the byte memory location referred to by the pointer address.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
For formats I. and II., if Rp = Rs the result will be UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.b{cond4} Rp[disp], Rs |
if (cond4) *(Rp + ZE(disp9)) = Rs[7:0]; |
s, p ∈ {0, 1, …, 15} disp ∈ {0, 1, ..., 511} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
The source register is stored to the byte memory location referred to by the pointer address if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.d Rp++, Rs |
*(Rp) = Rs+1:Rs; Rp = Rp + 8; |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} |
Rev1+ |
| ||||||||||||||
2 |
st.d --Rp, Rs |
Rp = Rp - 8; *(Rp) = Rs+1:Rs; |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} |
Rev1+ |
| ||||||||||||||
3 |
st.d Rp, Rs |
*(Rp) = Rs+1:Rs; |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} |
Rev1+ |
| ||||||||||||||
4 |
st.d Rp[disp], Rs |
*(Rp + SE(disp16)) = Rs+1:Rs; |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
| ||||||||||||||
5 |
st.d Rb[Ri << sa], Rs |
*(Rb + (Ri << sa2)) = Rs+1:Rs; |
{b, i} ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
The source registers are stored to the doubleword memory location referred to by the pointer address.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
For formats I. and II., if Rp == Rs the result will be UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.h Rp++, Rs |
*(Rp) = Rs[15:0]; Rp = Rp + 2; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
st.h --Rp, Rs |
Rp = Rp - 2; *(Rp) = Rs[15:0]; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
st.h Rp[disp], Rs |
*(Rp + ZE(disp3 << 1)) = Rs[15:0]; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {0, 2, ..., 14} |
Rev1+ |
| ||||||||||||||
4 |
st.h Rp[disp], Rs |
*(Rp + SE(disp16)) = Rs[15:0]; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
| ||||||||||||||
5 |
st.h Rb[Ri << sa], Rs |
*(Rb + (Ri << sa2)) = Rs[15:0]; |
{b, i, s} ∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
The source register is stored to the halfword memory location referred to by the pointer address.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
For formats I. and II., if Rp == Rs the result will be UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.h{cond4} Rp[disp], Rs |
if (cond4) *(Rp + ZE(disp9<<1)) = Rs[15:0]; |
s, p ∈ {0, 1, …, 15} disp ∈ {0, 2, ..., 1022} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
The source register is stored to the halfword memory location referred to by the pointer address if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.w Rp++, Rs |
*(Rp) = Rs; Rp = Rp + 4; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
st.w --Rp, Rs |
Rp = Rp - 4; *(Rp) = Rs; |
{s , p} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
st.w Rp[disp], Rs |
*(Rp + ZE(disp4 << 2)) = Rs; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {0, 4, ..., 60} |
Rev1+ |
| ||||||||||||||
4 |
st.w Rp[disp], Rs |
*(Rp + SE(disp16)) = Rs; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {-32768, -32767,…, 32767} |
Rev1+ |
| ||||||||||||||
5 |
st.w Rb[Ri << sa], Rs |
*(Rb + (Ri << sa2)) = Rs; |
{b, i, s} ∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} |
Rev1+ |
|
The source register is stored to the word memory location referred to by the pointer address.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
For formats I. and II., if Rp == Rs the result will be UNDEFINED.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
st.w{cond4} Rp[disp], Rs |
if (cond4) *(Rp + ZE(disp9<<2)) = Rs; |
s, p ∈ {0, 1, …, 15} disp ∈ {0, 4, ..., 2044} cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} |
Rev2+ |
|
The source register is stored to the word memory location referred to by the pointer address if the given condition is satisfied.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
stc.d CP#, Rp[disp], CRs |
*(Rp + (ZE(disp8) << 2)) = CP#(CRd+1:CRd); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
2 |
stc.d CP#, Rp++, CRs |
*(Rp) = CP#(CRd+1:CRd); Rp = Rp+8; |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
3 |
stc.d CP#, Rb[Ri<<sa], CRs |
*(Rb + (Ri << sa2)) = CP#(CRd+1:CRd); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
4 |
stc.w CP#, Rp[disp], CRs |
*(Rp + (ZE(disp8) << 2)) = CP#(CRd); |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
5 |
stc.w CP#, Rp++, CRs |
*(Rp) = CP#(CRd); Rp = Rp+4; |
# ∈ {0, 1, …, 7} |
Rev1+ |
| ||||||||||||||||
6 |
stc.w CP#, Rb[Ri<<sa], CRs |
*(Rb + (Ri << sa2)) = CP#(CRd); |
# ∈ {0, 1, …, 7} |
Rev1+ |
|
Stores the source register value to the location specified by the addressing mode.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
stc.d CP2, R2[0], CR0
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
stc0.d Rp[disp], CRs |
*(Rp + (ZE(disp12) << 2)) = CP#(CRd+1:CRd); |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} s ∈ {0, 1, …, 15} disp ∈ {0, 4, …, 16380} |
Rev1+ |
| ||||||||||||
2 |
stc0.w Rp[disp], CRs |
*(Rp + (ZE(disp12) << 2)) = CP#(CRd); |
p ∈ {0, 1, …, 15} s ∈ {0, 2, …, 14} s ∈ {0, 1, …, 15} disp ∈ {0, 4, …, 16380} |
Rev1+ |
|
Stores the coprocessor 0 source register value to the location specified by the addressing mode.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
stc0.d R2[0], CR0
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
stcm.d CP#, {--}Rp, ReglistCPD8 |
Storeaddress =Rp; if Opcode[--] == 1 then for (i = 0 to 7) if ReglistCPD8[i] == 1 then *(--Storeaddress) =CP#(CR(2*i)); *(--Storeaddress) =CP#(CR(2*i+1)); Rp = Storeaddress; else for (i = 7 to 0) if ReglistCPD8[i] == 1 then *(Storeaddress++) =CP#(CR(2*i+1)); *(Storeaddress++) =CP#(CR(2*i)); |
p ∈ {0, 1, …, 15} ReglistCPD8 ∈ {CR0-CR1,CR2-CR3,CR4-CR5,CR6-CR7,CR8-CR9, CR10-CR11,CR12-CR13,CR14-CR15} |
Rev1+ |
| ||||||||||||||
2 |
stcm.w CP#, {--}Rp, ReglistCPH8 |
Storeaddress =Rp; if Opcode[--] == 1 then for (i = 0 to 7) if ReglistCPH8[i] == 1 then *(--Storeaddress) =CP#(CRi+8); Rp = Storeaddress; else for (i = 7 to 0) if ReglistCPH8[i] == 1 then *(Storeaddress++) =CP#(CRi+8); |
ReglistCPH8 ∈ {CR8, CR9, CR10, ..., CR15} |
Rev1+ |
| ||||||||||||||
3 |
stcm.w CP#, {--}Rp, ReglistCPL8 |
Storeaddress =Rp; if Opcode[--] == 1 then for (i = 0 to 7) if ReglistCPL8[i] == 1 then *(--Storeaddress) =CP#(CRi); Rp = Storeaddress; else for (i = 7 to 0) if ReglistCPL8[i] == 1 then *(Storeaddress++) =CP#(CRi); |
ReglistCPL8 ∈ {CR0, CR1, CR2, ..., CR7} |
Rev1+ |
|
Writes multiple registers in the addressed coprocessor into the specified memory locations.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
stcm.w CP2, --SP, CR2-CR5
Emtpy ReglistCPH8/ReglistCPL8/ReglistCPD8 gives UNDEFINED result.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||
1 |
stcond Rp[disp], Rs |
SREG[Z] = SREG[L]; If SREG[L] *(Rp + SE(disp16)) = Rs; |
{s , p} ∈ {0, 1, …, 15} disp ∈ {-32768, -32767, ..., 32767} |
Rev1+ |
|
The source register is stored to the word memory location referred to by the pointer address if SREG[L] is set. Also, SREG[L] is copied to SREG[Z] to indicate a success or failure of the oper- ation. This instruction is used for atomical memory access.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
SREG[Z] = SREG[L]. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
stdsp SP[disp], Rs |
*( (SP && 0xFFFF_FFFC) + (ZE(disp7) << 2) ) = Rs; |
disp ∈ {0, 4, ..., 508} s ∈ {0, 1, …, 15} |
Rev1+ |
|
Stores the source register value to the memory location referred to specified by the Stack Pointer and the displacement.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||||||||
1 |
sthh.w Rp[disp], Rx:<part>, Ry:<part> |
*(Rp + ZE(disp8 << 2)) = {high-part, low-part}; |
{p, x, y} ∈ {0, 1, …, 15} disp ∈ {0, 4, ..., 1020} part ∈ {b,t} |
Rev1+ |
| ||||||||||||||||||||||
2 |
sthh.w Rb[Ri << sa], Rx:<part>, Ry:<part> |
*(Rb + (Ri << sa2)) = {high-part, low-part}; |
{b, i, x, y} ∈ {0, 1, …, 15} sa ∈ {0, 1, 2, 3} part ∈ {b,t} |
Rev1+ |
|
The selected halfwords of the source registers are combined and stored to the word memory location referred to by the pointer address.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
stm {--}Rp, Reglist16 |
Storeaddress = Rp; if Opcode[--] == 1 then for (i = 0 to 15) if Reglist16[i] == 1 then *(--Storeaddress) =Ri; Rp = Storeaddress; else for (i = 15 to 0) if Reglist16[i] == 1 then *(Storeaddress++) =Ri; |
Reglist16 ∈ {R0, R1, R2, ..., R12, LR, SP, PC} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Stores the registers specified to the consecutive memory locations pointed to by Rp. Both regis- ters in the register file and some of the special-purpose registers can be stored.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Emtpy Reglist16 gives UNDEFINED result.
If Rp is in Reglist16 and pointer is written back the result is UNDEFINED
The R bit in the status register has no effect on this instruction.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
stmts {--}Rp, Reglist16 |
Storeaddress = Rp; if Opcode[--] == 1 then for (i = 0 to 15) if Reglist16[i] == 1 then *(--Storeaddress) =RiApp; Rp = Storeaddress; else for (i = 15 to 0) if Reglist16[i] == 1 then *(Storeaddress++) =RiApp; |
Reglist16 ∈ {R0, R1, R2, ..., R12, LR, SP} p ∈ {0, 1, …, 15} |
Rev1+ |
|
Stores the registers specified to the consecutive memory locations pointed to by Rp. The regis- ters specified all reside in the application context.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Emtpy Reglist16 gives UNDEFINED result. PC in Reglist16 gives UNDEFINED result.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
stswp.h Rp[disp], Rs |
temp[15:0] = (Rs[7:0], Rs[15:8]); *(Rp+SE(disp12) << 1) = temp[15:0]; |
{s, p} ∈ {0, 1, …, 15} disp ∈ {-4096, -4094, ..., 4094} |
Rev1+ |
| ||||||||||||
2 |
stswp.wRp[disp], Rs |
temp[31:0] = (Rs[7:0], Rs[15:8], Rs[23:16], Rs[31:24]); *(Rp+SE(disp12) << 2) = temp[31:0]; |
{s, p} ∈ {0, 1, …, 15} disp ∈ {-8192, -8188 ..., 8188} |
Rev1+ |
|
This instruction swaps the bytes in a halfword or a word in the register file and stores the result to memory. The instruction can be used for performing stores to memories of different endianness.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||
1 |
sub Rd, Rs |
Rd = Rd - Rs; |
{d, s, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
2 |
sub Rd, Rx, Ry << sa |
Rd = Rx - (Ry << sa2); |
{d, s, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
3 |
sub Rd, imm |
if (Rd == SP) Rd = Rd - SE(imm8 << 2); else Rd = Rd - SE(imm8); |
{d, s, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
4 |
sub Rd, imm |
Rd = Rd - SE(imm21); |
{d, s, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||||
5 |
sub Rd, Rs, imm |
Rd = Rs - SE(imm16); |
{d, s, x, y} ∈ {0, 1, …, 15} |
Rev1+ |
|
Performs a subtraction and stores the result in destination register.
Format I: OP1 = Rd, OP2 = Rs |
|
Format II:OP1 = Rx, OP2 = Ry << sa2 |
|
Format III: OP1 = Rd, if (Rd==SP) OP2 = SE(imm8<<2) else OP2 = SE(imm8) |
|
Format IV: OP1 = Rd, OP2 = SE(imm21) |
|
Format V: OP1 = Rs, OP2 = SE(imm16) |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND ~OP2[31] AND ~RES[31]) OR (~OP1[31] AND OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~OP1[31] AND OP2[31] OR OP2[31] AND RES[31] OR ~OP1[31] AND RES[31] |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
subhh.wRd, Rx:<part>, Ry:<part> |
If (Rx-part == t) then operand1 = SE(Rx[31:16]) else operand1 = SE(Rx[15:0]); If (Ry-part == t) then operand2 = SE(Ry[31:16]) else operand2 = SE(Ry[15:0]); Rd = operand1 - operand2; |
{d, x, y} ∈ {0, 1, …, 15} part ∈ {t,b} |
Rev1+ |
|
Subtracts the two halfword registers specified and stores the result in the destination word-regis- ter. The halfword registers are selected as either the high or low part of the operand registers.
OP1 = operand1, OP2 = operand2 |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND ~OP2[31] AND ~RES[31]) OR (~OP1[31] AND OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~OP1[31] AND OP2[31] OR OP2[31] AND RES[31] OR ~OP1[31] AND RES[31] |
subhh.wR10, R2:t, R3:b will perform R10 = SE(R2[31:16]) - SE(R3[15:0])
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||||||
1 |
sub{f}{cond4} Rd, imm |
If (cond4) then Rd = Rd - imm8; Update flags if opcode[f] field is cleared |
cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} d ∈ {0, 1, …, 15} imm ∈ {-128, -127, ..., 127} |
Rev2+ |
| ||||||||||||||||
2 |
sub{cond4} Rd, Rx, Ry |
If (cond4) then Rd = Rx - Ry; |
cond4 ∈ {eq, ne, cc/hs, cs/lo, ge, lt, mi, pl, ls, gt, le, hi, vs, vc, qs, al} {d, x, y} ∈ {0, 1, …, 15} |
Rev2+ |
|
Subtracts a value from a given register and stores the result in destination register if cond4 is true.
K = SE(imm8) |
|
Flags only affected if format I and (cond4) is true and F parameter is given |
|
Q: |
Not affected |
V: |
V = (Rd[31] AND ~K[31] AND ~RES[31]) OR (~Rd[31] AND K[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~Rd[31] AND K[31] OR K[31] AND RES[31] OR RES[31] AND ~Rd[31] |
subfeq R3, 5 performs R3 = R3 - 5 and sets flags accordingly if Z flag set. subeq R5, 7 performs R5 = R5 - 5 if Z flag set. Flags are not affected.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
swap.b Rd |
Temp = Rd; Rd[31:24] = Temp[7:0]; Rd[23:16] = Temp[15:8]; Rd[15:8] = Temp[23:16]; Rd[7:0] = Temp[31:24]; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Swaps different parts of a register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
swap.bhRd |
Temp = Rd; Rd[31:24] = Temp[23:16]; Rd[23:16] = Temp[31:24]; Rd[15:8] = Temp[7:0]; Rd[7:0] = Temp[15:8]; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Swaps different parts of a register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
swap.h Rd |
Temp = Rd; Rd[31:16] = Temp[15:0]; Rd[15:0] = Temp[31:16]; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
Swaps different parts of a register.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||
1 |
sync Op8 |
Finishes all pending memory operations. |
0 <= Op8 <= 255 |
Rev1+ |
|
Finish all pending memory accesses and empties write buffers. The semantic of Op8 is IMPLE- MENTATION DEFINED.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
tlbr |
if (TLBEHI[I] == 1) {TLBEHI, TLBELO} =ITLB[MMUCR[IRP]]; else {TLBEHI, TLBELO} =DTLB[MMUCR[DRP]]; |
None |
Rev1+ |
|
Read the contents of the addressed ITLB or DTLB Entry into TLBEHI and TLBELO.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
This instruction can only be executed in a privileged mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
tlbs |
MMUCR[N] =1; if (TLBEHI[I] == 1) TlbToSearch =ITLB; else TlbToSearch =DTLB; endif; for (i = 0 to TLBToSearchEntries-1) if ( Compare(TlbToSearch[i]VPN, VA, TlbToSearch[i]SZ, TlbToSearch[i]V) ) // VPN and VA matches for the given page size and entry valid if ( SharedVMM or (PrivateVMM and ( TlbToSearch[i]G or (TlbToSearch[i]ASID==TLBEHI[ASID]) ) ) ) ptr = i; MMUCR[N] =0; endif; endif; endfor; if (TLBEHI[I] == 1) MMUCR[IRP] =ptr; else MMUCR[DRP] =ptr; endif; |
None |
Rev1+ |
|
Search the addressed TLB for an entry matching TLB Entry High and Low (TLBEHI/TLBELO) registers. Return a pointer to the entry in MMUCR[IRP] or MMUCR[DRP] if a match found, oth- erwise set the Not Found bit in the MMU control register, MMUCR[N].
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
This instruction can only be executed in a privileged mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||
1 |
tlbw |
if (TLBEHI[I] == 1) ITLB[MMUCR[IRP]] = {TLBEHI, TLBELO}; else ITLB[MMUCR[DRP]] = {TLBEHI, TLBELO}; |
None |
Rev1+ |
|
Write the contents of the TLB Entry High and Low (TLBEHI/TLBELO) registers into the addressed TLB entry.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Not affected. |
C: |
Not affected. |
This instruction can only be executed in a privileged mode.
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||
1 |
tnbz Rd |
if (Rd[31:24] == 0 OR Rd[23:16] == 0 OR Rd[15:8] == 0 OR Rd[7:0] == 0 ) SR[Z] = 1; else SR[Z] = 0; |
d ∈ {0, 1, …, 15} |
Rev1+ |
|
If any of the bytes 0,1,2,3 in the word is zero, the SR[Z] flag is set.
Q: |
Not affected. |
V: |
Not affected. |
N: |
Not affected. |
Z: |
Z = (Rd[31:24] == 0 OR Rd[23:16] == 0 OR Rd[15:8] == 0 OR Rd[7:0] == 0 ) |
C: |
Not affected. |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||
1 |
tst Rd, Rs |
Rd AND Rs; |
{d,s} ∈ {0, 1, …, 15} |
Rev1+ |
|
Test register. Used to check if a subset of a register includes one or more set bits. No writeback of the result is performed, but the flags are set.
Q: |
Not affected |
V: |
Not affected |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
Not affected |
Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
xchg Rd, Rx, Ry |
Temp = *(Rx); *(Rx) = Ry; Rd = Temp; |
{d,x,y} ∈ {0, 1, …, 14} |
Rev1+ |
|
Reads a word from memory pointed to by Rx into register Rd, and writes the value of register Ry to memory. This instruction can be used to implement binary semaphores (mutexes). The stcond instruction should be used to implement counting semaphores.
Q: |
Not affected |
V: |
Not affected |
N: |
Not affected |
Z: |
Not affected |
C: |
Not affected |
If R15 is used as Rd, Rx or Ry, the result is UNDEFINED.
If Rd = Ry, the result is UNDEFINED. If Rd = Rx, the result is UNDEFINED.