4.6 Instruction Descriptions (E to MULUU)
ED | Subtract and Square to Accumulator (Partial Euclidean Distance) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label} | ED{.w} | Wx, | Wy, | A | {,AWB} | |||||
ED.l | [Wx], | [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]4} | |||||||||
Operation: | ((Wx) - (Wy))2 → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modified Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 10AL | wwww | ssss | IIIi | iJJJ | jjaa | a011 | ||
Description: | Instruction to compute (A-B)2 functions. Signed or unsigned (defined by CORCON.US)
subtract then square of data concurrently read from Wx and Wy or fetched
from X and Y address space (see note 3). The result is sign-extended or
zero-extended to 72-bits then written to the specified accumulator.
Fractional results are also scaled prior to the accumulator update to
align the operand and accumulator (msw) fractional points. When indirect addressing is selected for either or both X and Y address space, the Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address. The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the ED operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 5). AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 2 |
EDAC | Subtract, Square and Accumulate (Euclidean Distance) | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label} | EDAC{.w} Wx, | Wy, | A | {,AWB} | ||||||
EDAC.l | [Wx], | [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]4} | |||||||||
Operation: | ACC(A or B) + ((Wx) - (Wy))2 → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modification Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 10AL | wwww | ssss | IIIi | iJJJ | jjaa | a111 | ||
Description: | Instruction to compute (A-B)2 functions. Signed or unsigned (defined by CORCON.US)
subtract then square of data read from Wx and Wy or concurrently fetched
from the X and Y address space. The result is sign-extended or
zero-extended to 72-bits and then added to the specified accumulator.
Fractional or integer operation (defined by CORCON.IF) will determine if
the result is scaled or not prior to the accumulator update. Fractional
operation will scale the result to align the operand and accumulator
(msw) fractional points (see note 3). Integer operation will align the
LSb of the result with the LSb of the accumulator. When indirect addressing is selected for either or both X and Y address space, the Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data words by which to modify the Effective Address. The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the EDAC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 5). AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register. The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 2 |
EXCH | Exchange Ws and Wd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | EXCH | Wns, | Wnd | ||||
Operands: | Wns ∈ [W0 ... W15]; Wnd ∈ [W0 ... W15] | |||||||
Operation: | (Wns) ↔ (Wnd) | |||||||
Status Affected: | None | |||||||
Encoding: | 1000 | 001U | dddd | ssss | UUUU | UUUU | UUUU | 0100 |
Description: | This instruction exchanges the contents of two Working registers and is a two cycle operation. In cycle one, Wnd is read and moved to Wns. In cycle two, Wns is read and moved to Wnd. The ‘s’ bits select the Wns register. The ‘d’ bits select the Wnd register. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
FBCL | Find First Bit Change from Left | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | FBCL{.w} | Ws, | Wnd | ||||
FBCL.l | [Ws], | |||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | See description | |||||||
Status Affected: | C | |||||||
Encoding: | 1110 | 011L | dddd | ssss | pppU | UUUU | UUUU | 1011 |
Description: | Finds the first occurrence of a one (for a positive signed value) or zero (for a negative signed value) starting from the next MSb after the Sign bit working towards the LSb of the word operand. The bit number is sign-extended to 32-bits and is written to the destination register. The next MSb after the Sign bit is assigned number zero. For a word operation, the LSb number is assigned -14 and a result of -15 (C=1) indicates that the bit was not found. For a long word operation, the LSb number is assigned -30 and a result of -31 (C=1) indicates that the bit was not found. C is cleared for all non-zero results. The ‘L’ bit selects word or long word operation. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. See and for modifier addressing information. Note: This instruction only operates in Word and Long Word mode. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 | |||||||
Example 1: | FBCL W1, W9 | ; Find 1st bit change from left in W1 ; and store result to W9 | |||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W1 | 55FF | W1 | 55FF | ||||||
W9 | FFFF | W9 | 0000 | ||||||
SR | 0000 | SR | 0000 |
Example 2: | FBCL W1, W9 | ; Find 1st bit change from left in W1 ; and store result to W9 | |||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W1 | FFFF | W1 | FFFF | ||||||
W9 | BBBB | W9 | FFF1 | ||||||
SR | 0000 | SR | 0001 | (C = 1) |
Example 3: | FBCL [W1++], W9 | ; Find 1st bit change from left in [W1] ; and store result to W9 ; Post-increment W1 | |||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W1 | 2000 | W1 | 2002 | ||||||
W9 | BBBB | W9 | FFF9 | ||||||
Data 2000 | FF0A | Data 2000 | FF0A | ||||||
SR | 0000 | SR | 0000 |
FF1L | Find First One from Left | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | FF1L{.w} | Ws, | Wnd | ||||
FF1L.l | [Ws], | |||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | See description | |||||||
Status Affected: | C | |||||||
Encoding: | 1110 | 011L | dddd | ssss | pppU | UUUU | UUUU | 0011 |
Description: | Finds the first occurrence of a one starting from the MSb working towards the LSb of the word operand. The bit number result is zero-extended to 32-bits and is written to the destination register. The MSb is assigned number one. For a word operation, the LSb number is assigned 16, and a result of zero (C=1) indicates that the bit was not found. For a long word operation, the LSb number is assigned 32 and a result of zero (C=1) indicates that the bit was not found. C is cleared for all non-zero results. The ‘L’ bit selects word or long word operation. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note: This instruction only operates in word and long word mode. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | FF1L W2, W5 ; Find the 1st one from the left in W2 ; and store result to W5 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W2 | 000A | W2 | 000A | ||||||
W5 | BBBB | W5 | 000D | ||||||
SR | 0000 | SR | 0000 |
Example 2: | FF1L [W2++], W5 ; Find the 1st one from the left in [W2] ; and store the result to W5 ; Post-increment W2 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | |||||||||
W2 | 2000 | W2 | 2002 | |||||||
W5 | BBBB | W5 | 0000 | |||||||
Data 2000 | 0000 | Data 2000 | 0000 | |||||||
SR | 0000 | SR | 0001 | (C = 1) |
FF1R | Find First One from Right | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | FF1R{.w} | Ws, | Wnd | ||||
FF1R.l | [Ws], | |||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | See description | |||||||
Status Affected: | C | |||||||
Encoding: | 1110 | 011L | dddd | ssss | pppU | UUUU | UUUU | 0111 |
Description: | Finds the first occurrence of a one starting from the LSb working towards the MSb of the word operand. The bit number result is zero-extended to 32-bits and is written to the destination register. The LSb is assigned number one. For a word operation, the MSb number is assigned 16, and a result of zero (C=1) indicates that the bit was not found. For a long word operation, the MSb number is assigned 32 and a result of zero (C=1) indicates that the bit was not found. C is cleared for all non-zero results. The ‘L’ bit selects word or long word operation. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note: This instruction only operates in word and long word mode. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | FF1R W1, W9 ; Find the 1st one from the right in W1 ; and store the result to W9 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | |||||||||
W1 | 000A | W1 | 000A | |||||||
W9 | BBBB | W9 | 0002 | |||||||
SR | 0000 | SR | 0000 |
Example 2: | FF1R [W1++], W9 ; Find the 1st one from the right in [W1] ; and store the result to W9 ; Post-increment W1 | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | |||||||||
W1 | 2000 | W1 | 2002 | |||||||
W9 | BBBB | W9 | 0010 | |||||||
Data 2000 | 8000 | Data 2000 | 8000 | |||||||
SR | 0000 | SR | 0000 |
FLIM | Force (Signed) Data Range Limit | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | FLIM{.w} | Wb, | Ws, | ||||
FLIM.l | [Ws], | |||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W14]; Wb ∈ [W0 ... W13]; | |||||||
Operation: | IF (Ws) > (Wb) THEN {
(Wb) → (Ws); 0→ Z; 0→ N; 0→ OV } ELSE IF (Ws) < (Wb+1) THEN { (Wb+1) → Ws; 0→ Z; 1→ N; 0→ OV } ELSE { (Ws) → Ws4; 1→ Z; 0→ N; 0→ OV } | |||||||
Status Affected: | N, Z, OV | |||||||
Encoding: | 1110 | 010L | UUUU | ssss | pppU | UUww | wwUU | 0011 |
Description: | Simultaneously compare any size of signed data value in Ws to a maximum signed limit value held in Wb and a minimum signed limit value held in Wb+1. For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are updated such that a subsequent BGT instruction will take a branch. For long word data size, if Ws[31:0] is less than Wb+1[31:0], set Ws[31:0] to the limit value held in Wb+1[31:0]. For word data sizes, if Ws[15:0] is less than Wb+1[15:0], set Ws[15:0] to the limit value held in Wb+1[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are updated such that a subsequent BLT instruction will take a branch. If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0], and greater than or equal to the minimum limit value in Wb+1[31:0] (for long word sized data), or Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] and greater than or equal to the minimum limit value in Wb+1[15:0] (for word sized data), neither data limit is applied such that the contents of Ws will not change (for the given data size). The Z status bit is set such that a subsequent BZ instruction will take a branch (OV and N status are both cleared). For word sized register direct operations, Ws is always 0 extended to 32-bits (even if neither of the data limits are applied)4. Note that the instruction always executes the maximum compare first. Should Ws be less than the maximum, it will then execute the minumum compare, and if Ws is found to be not less than the minimum, Ws will remain unchanged. Furthermore, should the (maximum) limit value Wb be inadvertently set to less than or equal to the (minimum) limit value Wb+1, the same compare sequence will still be executed. This condition is not detected. The OV status bit is always cleared by this instruction. The ‘s’ bits select the source (data value) register. The ‘w’ bits select the base (data limit) register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
FLIM | Force (Signed) Data Range Limit with Limit Excess Result | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | FLIM{.w}{v} Wb, | Ws, | Wd | ||||
FLIM.l{v} | [Ws], | [Wd] | ||||||
[Ws++], | [Wd++] | |||||||
[Ws--], | [Wd--] | |||||||
[++Ws], | [++Wd] | |||||||
[--Ws], | [--Wd] | |||||||
Operands: | Ws ∈ [W0 ... W14]; Wb ∈ [W0 ... W13]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | IF (Ws) > (Wb) THEN (
IF FLIM.v THEN (Ws) - (Wb) → Wnd
ELSE +1 → Wnd;
(Wb) → (Ws); 0→ Z; 0→ N; 0→ OV; ) ELSE IF (Ws) < (Wb+1) THEN ( IF FLIM.v THEN (Ws) - (Wb+1) → Wnd ELSE -1 → Wnd; (Wb+1) → Ws; 0→ Z; 1→ N; 0→ OV; ) ELSE ( 0 → Wnd; (Ws) → Ws4; 1→ Z; 0→ N; 0→ OV; ) | |||||||
Status Affected: | N, Z, OV | |||||||
Encoding: | 1110 | 010L | dddd | ssss | pppq | qqww | wwUV | 0111 |
Description: | Simultaneously compare any size of signed data value in Ws to a maximum signed limit value held in Wb and a minimum signed limit value held in Wb+1. Write a limit excess value into Wnd. For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). In all cases, write the (signed) value by which the limit is exceeded to Wnd[31:0] (FLIM.v, where opcode bit field V = 1) or set Wnd to +1 (FLIM, where opcode bit field V = 0). Whenever Ws is greater than Wb, Wnd will always be a positive value. The Z, N and OV status bits are updated such that a subsequent BGT instruction will take a branch. For long word data size, if Ws[31:0] is less than Wb+1[31:0], set Ws[31:0] to the limit value held in Wb+1[31:0]. For word data sizes, if Ws[15:0] is less than Wb+1[15:0], set Ws[15:0] to the limit value held in Wb+1[15:0] (Ws[31:16] is ignored). In all cases, write the (signed) value by which the limit is exceeded to Wnd[31:0] (FLIM.v, where opcode bit field V = 1) or set Wnd to +1 (FLIM, where opcode bit field V = 0). Whenever Ws is less than Wb+1, Wnd will always be a negative value. The Z, N and OV status bits are updated such that a subsequent BLT instruction will take a branch. If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0] and greater than or equal to the minimum limit value in Wb+1[31:0] (for long word sized data), or Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] and greater than or equal to the minimum limit value in Wb+1[15:0] (for word sized data), neither data limit is applied such that contents of Ws will not change (for the given data size). The Z status bit is set such that a subsequent BZ instruction will take a branch (OV and N status are both cleared).For word sized register direct operations, Ws is always zero extended to 32-bits (even if neither of the data limits are applied)4. Note that the instruction always executes the maximum compare first. Should Ws be less than the maximum, it will then execute the minimum compare, and if Ws is found to be not less than the minimum, Ws will remain unchanged. Furthermore, should the (maximum) limit value Wb be inadvertently set to less than or equal to the (minimum) limit value Wb+1, the same compare sequence will still be executed. This condition is not detected. The OV status bit is always cleared by this instruction. The ‘s’ bits select the source (data value) register. The ‘w’ bits select the base (data limit) register. The ‘d’ bits select the destination (limit test result) register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. The ‘V’ bit selects the result format for Wnd. See for modifier addressing information. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
GOTO | Unconditional Jump | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | GOTO | lit24 | |||||
Operands: | lit24 ∈ [0 ... 16MB] | |||||||
Operation: | lit24 → PC[23:0], NOP → Instruction Register. | |||||||
Status Affected: | None | |||||||
Encoding: | 1101 | 101n | nnnn | nnnn | nnnn | nnnn | nnnn | nn10 |
Description: | Unconditional jump to any address within (for latency) one cycle’s memory space. The 24-bit value ‘lit24’ is loaded into the PC. A jump to either a 32-bit or 16-bit instruction is permitted. The ‘n’ bits form the target address. Note: The (byte) PC address is always either word or long word aligned. The opcode does not store the LSb because it is always 1’b0. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example:1 | Address | Label | Instruction | Comment | |
---|---|---|---|---|---|
0x804000 | - | GOTO _CHECK_FAIL | ; Jumps to address 0x805000(_CHECK_FAIL) | ||
. . . | |||||
0x805000 | _CHECK_FAIL: | MOV.l SR, W6 | ; Random code | ||
CP w6, w7 |
GOTO | Unconditional Indirect Jump | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | GOTO | Wns | |||||
Operands: | Wns ∈ [W0 ... W14] | |||||||
Operation: | (Wns) → PC[23:0]; NOP → Instruction Register. | |||||||
Status Affected: | None | |||||||
Encoding: | 1101 | 011U | UUUU | ssss | UUUU | UUUU | UUUU | 1010 |
Description: | Unconditional indirect jump to any address within executable memory address space. The Wns[23:0] is loaded into PC[23:0]. Wns must therefore contain a PS byte address. The value of Wns[0] is ignored and PC[0] is always set to 1’b0. GOTO is a two-cycle instruction. The ‘s’ bits select the source register. If Wns[31:24] !=8’h00, an address error trap will be initiated. | |||||||
I-Words: | 1 | |||||||
Cycles: | 2 Note: The goto target instruction fetch is not executed if an exception is pending, making effective instruction execution time one cycle. |
Example:1 | Address | Label | Instruction | Comment | |
---|---|---|---|---|---|
0x804000 | - | GOTO _CHECK_FAIL | ; Jumps to address 0x805000(_CHECK_FAIL) | ||
. . . | |||||
0x805000 | _CHECK_FAIL: | MOV.l SR, W6 | ; Random code | ||
CP w6, w7 |
INC | Increment f | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | INC.b | f | {,Wnd} | {,WREG} | |||
INC.bz | ||||||||
INC{.w} | ||||||||
INC.l | ||||||||
Operands: | f ∈ [0 ... 64KB]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | (f) + 1 → destination designated by D | |||||||
Status Affected: | C, N, OV, Z | |||||||
Encoding: | 1101 | 010L | dddd | ffff | ffff | ffff | ffff | BD01 |
Description: | Add one to the contents of the file register and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register. The ‘L’ and ‘B’ bits select operation data width. The ‘D’ bit selects the destination. The ‘f’ bits select the address of the file register. The ‘d bits select the Working register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | INC.B 0x1000 ; Increment 0x1000 (Byte mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
Data 1000 | 8FFF | Data 1000 | 8F00 | ||||||||||
SR | 0000 | SR | 0101 | (DC, C = 1) |
Example 2: | INC 0x1000, WREG ; Increment 0x1000 and store to WREG ; (Word mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
WREG | ABCD | WREG | 9000 | ||||||||||
Data 1000 | 8FFF | Data 1000 | 8FFF | ||||||||||
SR | 0000 | SR | 0108 | (DC, N = 1) |
INC2 | Increment f by 2 | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | INC2.b | f | {,Wnd} | {,WREG} | |||
INC2.bz | ||||||||
INC2{.w} | ||||||||
INC2.l | ||||||||
Operands: | f ∈ [0 ... 64KB]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | (f) + 2 → destination designated by D | |||||||
Status Affected: | C, N, OV, Z | |||||||
Encoding: | 1101 | 110L | dddd | ffff | ffff | ffff | ffff | BD01 |
Description: | Add two to the contents of the file register and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register. The ‘L’ and ‘B’ bits select operation data width. The ‘D’ bit selects the destination. The ‘f’ bits select the address of the file register. The ‘d’ bits select the Working register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | INC2.B 0x1000 ; Increment 0x1000 by 2 ; (Byte mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
Data 1000 | 8FFF | Data 1000 | 8F01 | ||||||||||
SR | 0000 | SR | 0101 | (DC, C = 1) |
Example 2: | INC2 0x1000, WREG ; Increment 0x1000 by 2 and store to WREG ; (Word mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
WREG | ABCD | WREG | 9001 | ||||||||||
Data 1000 | 8FFF | Data 1000 | 8FFF | ||||||||||
SR | 0000 | SR | 0108 | (DC, N = 1) |
IOR | Inclusive OR Wb and Ws | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | IOR.b | Wb, | Ws, | Wd | |||
IOR.bz | [Ws], | [Wd] | ||||||
IOR{.w} | [Ws++], | [Wd++] | ||||||
IOR.l | [Ws--], | [Wd--] | ||||||
[++Ws], | [++Wd] | |||||||
[--Ws], | [--Wd] | |||||||
SR | SR | |||||||
Operands: | Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15] | |||||||
Operation: | (Wb).IOR.(Ws) → Wd | |||||||
Status Affected: | N, Z | |||||||
Encoding: | S110 | 101L | dddd | ssss | pppq | qqww | wwUU | BU00 |
Description: | Compute the Inclusive OR of the contents of the source register Ws and the contents of the base register Wb and place the result in the destination register Wd. The ‘S’ bit selects instruction size. The ‘L’ and ‘B’ bits select operation data width. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |
Example 1: | IOR.B W1, [W5++], [W9++] ; IOR W1 and [W5] (Byte mode) ; Store result to [W9] ; Post-increment W5 and W9 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W1 | AAAA | W1 | AAAA | ||||||||||
W5 | 2000 | W5 | 2001 | ||||||||||
W9 | 2400 | W9 | 2401 | ||||||||||
Data 2000 | 1155 | Data 2000 | 1155 | ||||||||||
Data 2400 | 0000 | Data 2400 | 00FF | ||||||||||
SR | 0000 | SR | 0008 | (N = 1) |
Example 2: | IOR W1, W5, W9 ; IOR W1 and W5 (Word mode) ; Store the result to W9 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W1 | AAAA | W1 | AAAA | ||||||
W5 | 5555 | W5 | 5555 | ||||||
W9 | A34D | W9 | FFFF | ||||||
SR | 0000 | SR | 0008 | (N = 1) |
IOR | Inclusive OR Wb and Short Literal | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | IOR.b | Ws, | lit7, | Wd | |||
IOR.bz | [Ws], | [Wd] | ||||||
IOR{.w} | [Ws++], | [Wd++] | ||||||
IOR.l | [Ws--], | [Wd--] | ||||||
[++Ws], | [++Wd] | |||||||
[--Ws], | [--Wd] | |||||||
SR | SR | |||||||
Operands: | Ws ∈ [W0 ... W15]; lit7 ∈ [0 ... 127]; Wd ∈ [W0 ... W15] | |||||||
Operation: | (Ws).IOR.lit7 → Wd Note: The literal is zero-extended to the selected data size of the operation | |||||||
Status Affected: | N, Z | |||||||
Encoding: | 1110 | 101L | dddd | ssss | pppq | qqkk | kkkk | Bk10 |
Description: | Compute the Inclusive OR of the contents of the source register Ws and the zero-extended literal operand and place the result in the destination register Wd. The ‘L’ and ‘B’ bits select operation data width. The ‘k’ bits provide the literal operand (MSb in op[2]). The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. See and for modifier addressing information. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | IOR.B W1, #0x5, [W9++] ; IOR W1 and 0x5 (Byte mode) ; Store to [W9] ; Post-increment W9 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W1 | AAAA | W1 | AAAA | ||||||||||
W9 | 2000 | W9 | 2001 | ||||||||||
Data 2000 | 0000 | Data 2000 | 00AF | ||||||||||
SR | 0000 | SR | 0008 | (N = 1) |
Example 2: | IOR W1, #0x0, W9 ; IOR W1 with 0x0 (Word mode) ; Store to W9 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W1 | 0000 | W1 | 0000 | ||||||||||
W9 | A34D | W9 | 0000 | ||||||||||
SR | 0000 | SR | 0002 | (Z = 1) |
IOR | Inclusive OR Literal and Wn | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | IOR.b | lit16, | Wn | ||||
IOR.bz | SR | |||||||
IOR{.w} | ||||||||
IOR.l | ||||||||
Operands: | lit16 ∈ [0 ... 65535]; Wn ∈ [W0 ... W14]; Status Register (SR) | |||||||
Operation: | (Wn) .IOR. lit163 → Wn or (SR) .IOR. lit16 → SR | |||||||
Status Affected: | N, Z | |||||||
Encoding: | 1100 | 101L | ssss | kkkk | kkkk | kkkk | kkkk | BT10 |
Description: | Compute the Inclusive OR of the literal operand and the contents of the Working register Wn or SR and place the result in the Working register Wn or SR. The ‘L’ and ‘B’ bits select operation data width. The ‘s’ bits select the Working register. The ‘k’ bits specify the literal operand. The ‘T’ bit selects between Ws (T = 0) and SR (T = 1) target registers. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | IOR.B #0xAA, W9 ; IOR 0xAA to W9 ; (Byte mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W9 | 1234 | W9 | 12BE | ||||||||||
SR | 0000 | SR | 0008 | (N = 1) |
Example 2: | IOR #0x2AA, W4 ; IOR 0x2AA to W4 ; (Word mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W4 | A34D | W4 | A3EF | ||||||||||
SR | 0000 | SR | 0008 | (N = 1) |
IOR | Inclusive OR f and Wn | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | IOR.b | f | ,Wn | {,WREG} | |||
IOR.bz | ||||||||
IOR{.w} | ||||||||
IOR.l | ||||||||
Operands: | f ∈ [0 ... 64KB]; Wn ∈ [W0 ... W14] | |||||||
Operation: | (f).IOR.(Wn) → destination designated by D | |||||||
Status Affected: | N, Z | |||||||
Encoding: | 1110 | 101L | ssss | ffff | ffff | ffff | ffff | BD01 |
Description: | Compute the Inclusive OR of the contents of the Working register and the contents of the file register and place the result in the destination designated by D. If the optional Wn is specified, D=0 and store result in Wn; otherwise, D=1 and store result in the file register. The ‘L’ and ‘B’ bits select operation data width. The ‘D’ bit selects the destination. The ‘f’ bits select the address of the file register. The ‘s’ bits select the Working register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
LAC | Load Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LAC{.w} | Ws, | { Slit6, } | A | |||
LAC.l | [Ws], | B | ||||||
[Ws++] | ||||||||
[Ws--] | ||||||||
[--Ws], | ||||||||
[++Ws], | ||||||||
[Ws+Wb], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31] | |||||||
Operation: | For Word operation: 8{Ws[15]}, Ws[15:0], 48’h000000000000 → ACC[71:0] ShiftSlit6(ACC) → ACC For Long Word operation: 8{Ws[31]}, Ws[31:0], 32’h00000000 → ACC[71:0] ShiftSlit6(ACC) → ACC | |||||||
Status Affected: | OA, SA or OB, SB | |||||||
Encoding: | 1100 | 00AL | wwww | ssss | pppU | UUkk | kkkk | 0011 |
Description: | Read the contents of the Effective Address. Place
the data read into the target accumulator, then optionally shift the
entire accumulator. For a word operation (LAC{.w}), the value contained at the Effective Address is assumed to be Q1.15 signed fractional data and is written into ACCx[63:48]. ACCx[47:0] is set to all 0’s, and ACCx[63:0] is automatically sign-extended (through bit 71). The accumulator is then arithmetically shifted by the value held in slit6. For a long word operation (LAC.l), the value contained at the Effective Address is assumed to be Q1.31 signed fractional data and is written into ACCx[63:32]. ACCx[31:0] is set to all 0’s, and ACCx[63:0] is automatically sign-extended (through bit 71). The accumulator is then arithmetically shifted by the value held in slit6. The ‘L’ bit selects word or long word operation. The ‘A’ bits specify the destination accumulator. The ‘s’ bits specify the source register Wns. The ‘p’ bits select the source addressing mode. The ‘w’ bits specify the offset register Wb. The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s. Note: Positive values
of operand Slit6 represent arithmetic shift right. Negative
values of operand Slit6 represent shift left.
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | LAC [W4++], #-3, B ; Load ACCB with [W4] << 3 ; Contents of [W4] do not change ; Post increment W4 ; Assume saturation disabled ; (SATB = 0) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W4 | 2000 | W4 | 2002 | ||||||
ACCB | 00 1525 ABCD 2512 1922 | ACCB | FF 9108 0000 0000 0000 | ||||||
Data 2000 | 1221 | Data 2000 | 1221 | ||||||
SR | 0000 | SR | 4800 | (OB, OAB = 1) |
Example 2: | LAC [--W2], #7, A ; Pre-decrement W2 ; Load ACCA with [W2] >> 7 ; Contents of [W2] do not change ; Assume saturation disabled ; (SATA = 0) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W2 | 4002 | W2 | 4000 | ||||||
ACCA | 00 1525 ABCD 2512 1922 | ACCA | FF FF22 1000 0000 0000 | ||||||
Data 4000 | 9108 | Data 4000 | 9108 | ||||||
Data 4002 | 1221 | Data 4002 | 1221 | ||||||
SR | 0000 | SR | 0000 |
LLAC | Load Lower Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LLAC.l | Ws, | { Slit6, } | A | |||
[Ws], | B | |||||||
[Ws++] | ||||||||
[Ws--] | ||||||||
[--Ws], | ||||||||
[++Ws], | ||||||||
[Ws+Wb], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31] | |||||||
Operation: | Ws[31:0] → ACC[31:0] ShiftSlit6(ACC) → ACC | |||||||
Status Affected: | OA, SA or OB, SB | |||||||
Encoding: | 1100 | 00A1 | wwww | ssss | pppU | UUkk | kkkk | 0111 |
Description: | Read the contents of the Effective Address. Place
the data read into the lower 32-bits of the target accumulator
(ACCx[31:0]), then optionally arithmetically shift the entire
accumulator. The ‘A’ bits specify the destination accumulator. The ‘s’ bits specify the source register Wns. The ‘p’ bits select the source addressing mode. The ‘w’ bits specify the offset register Wb. The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s. Note: Positive values
of operand Slit6 represent arithmetic shift right. Negative
values of operand Slit6 represent shift left.
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example:1 | LLAC | A, #4, w8 | ; Load ACCAL from w8 ;Right shift value of ACCA by 4 | ||
---|---|---|---|---|---|
Before execution | After execution | ||||
ACCA | 0x00_1022_2EE1_5633_9078 | ACCA | 0xFF_F102_22EE_1123_4567 | ||
w8 | 0x12345678 | w8 | 0x12345678 |
LNK | Allocate Stack Frame | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LNK | lit16 | |||||
Operands: | lit16 ∈ [0 ... 65535] | |||||||
Operation: | (W14) → (TOS) (W15) + 4 → W15 (W15) → W14; (W15) + lit16 → W15 | |||||||
Status Affected: | None | |||||||
Encoding: | 1101 | 010U | UUUU | kkkk | kkkk | kkkk | kkkk | 1010 |
Description: | This instruction allocates a stack frame of size lit16 bytes (though always long word aligned) and adjusts the Stack Pointer and Frame Pointer. The ‘k’ bits specify the size of the stack frame in bytes. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example:1 | LNK | #8 | ;Allocate stack frame | ||
---|---|---|---|---|---|
Before execution | After execution | ||||
W14 | 0x1234 | W14 | 0x5004 | ||
W15 | 0x5000 | W15 | 0x500C | ||
Data @0x5000 | 0x0000 | Data @0x5000 | 0x1234 |
LNK | Allocate Stack Frame (short) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LNK | lit7 | |||||
Operands: | lit7∈ [0 ... 127] | |||||||
Operation: | (W14) → (TOS) (W15) + 4 → W15 (W15) → W14; (W15) + lit5, 2’b00 → W15 | |||||||
Status Affected: | None | |||||||
Encoding: | 0111 | 001k | kkkk | 1110 | ||||
Description: | This instruction allocates a stack frame of size lit7 bytes and adjusts the Stack Pointer and Frame Pointer. The ‘k’ bits specify the size of the stack frame (in long words). Note:
| |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
LSR | Logical Shift Right by 1 | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSR.b | Ws, | Wd | ||||
LSR.bz | [Ws], | [Wd] | ||||||
LSR{.w} | [Ws++], | [Wd++] | ||||||
LSR.l | [Ws--], | [Wd--] | ||||||
[++Ws], | [++Wd] | |||||||
[--Ws], | [--Wd] | |||||||
Operands: | Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15] | |||||||
Operation: | For long word operation: 0 → Wd[31], (Ws[31:1]) → Wd[30:0], (Ws[0]) → C For word operation: 0 → Wd[15], (Ws[15:1]) → Wd[14:0], (Ws[0]) → C For byte operation: 0 → Wd[7], (Ws[7:1]) → Wd[6:0], (Ws[0]) → C | |||||||
Status Affected: | C,N,Z | |||||||
Encoding: | S010 | 101L | dddd | ssss | pppq | qqUU | UUUU | B000 |
Description: | Logical shift right the contents of the source register Ws by one bit, placing the result in the destination register Wd. Destination register direct Extended Byte or Word mode will zero-extend the result to 32-bits, then write to Wd. The ‘S’ bit selects instruction size. The ‘L’ and ‘B’ bits select operation data width. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |
LSR | Logical Shift Right f | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSR.b | f | {,Wnd} | {,WREG} | |||
LSR.bz | ||||||||
LSR{.w} | ||||||||
LSR.l | ||||||||
Operands: | f ∈ [0 ....64KB]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | For byte operation: 0 → Dest[7:1], (f[7:1]) → Dest[6:0], (f[0]) → C For word operation: 0 → Dest[15], (f[15:1]) → Dest[14:0], (f[0]) → C For long word operation: 0 → Dest[31], (f[31:1]) → Dest[30:0], (f[0]) → C | |||||||
Status Affected: | C, N, Z | |||||||
Encoding: | 1010 | 001L | dddd | ffff | ffff | ffff | ffff | BD01 |
Description: | Shift the contents of the file register f one bit to the right and place the result in the destination designated by D. If the optional Wnd is specified, D=0 and store result in Wnd; otherwise, D=1 and store result in the file register. The carry flag bit is set if the LSB of the file register is ‘1’. The N flag is always cleared. The ‘L’ and ‘B’ bits select operation data width. The ‘D’ bit selects the destination. The ‘f’ bits select the address of the file register. The ‘d’ bits select the Working register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | LSR.B 0x600 ; Logically shift right (0x600) by one ; (Byte mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
Data 600 | 55FF | Data 600 | 557F | ||||||||||
SR | 0000 | SR | 0001 | (C = 1) |
Example 2: | LSR 0x600, WREG ; Logically shift right (0x600) by one ; Store to WREG ; (Word mode) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
Data 600 | 55FF | Data 600 | 55FF | ||||||||||
WREG | 0000 | WREG | 2AFF | ||||||||||
SR | 0000 | SR | 0001 | (C = 1) |
LSR | Logical Shift Right by Short Literal | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSR{.w} | Ws, | lit5, | Wd | |||
LSR.l | [Ws], | [Wd] | ||||||
[Ws++], | [Wd++] | |||||||
[Ws--], | [Wd--] | |||||||
[++Ws], | [--Wd] | |||||||
[--Ws], | [++Wd] | |||||||
Operands: | Ws ∈ [W0 ... W15]; lit5 ∈ [0...32]; Wd ∈ [W0 ... W14] | |||||||
Operation: | lit5[4:0]→ Shift_Val 1’b0 → Right shift input (logical shift) For long word operation: Ws[31:0], 32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[63:32] → Wd For word operation: 16’b0,Ws[15:0],32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[47:32] → Wd[15:0] | |||||||
Status Affected: | N,Z | |||||||
Encoding: | S010 | 001k | kkkk | dddd | pppq | qqss | ssUU | L000 |
Description: | Logical shift right the contents of the source register Ws by lit5 bits (up to 31 positions), placing the result in the destination Wd. The N flag is always cleared unless the shift value is zero (see note 1). This instruction will generate the correct result for any shift value in lit5 (a word operation shift value > 15, Wd[15:0]=0x0000). Register Direct Word mode will zero-extend the result to 32-bits, then write to Wd. The ‘S’ bit selects instruction size. The ‘L’ bit selects word or long word operation. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. The ‘k’ bits provide the literal operand. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |
Example 1: | LSR W4, #14, W5 ; LSR W4 by 14 ; Store result to W5 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W4 | C800 | W4 | C800 | ||||||||||
W5 | 1200 | W5 | 0003 | ||||||||||
SR | 0000 | SR | 0000 |
Example 2: | LSR W4, #1, W5 ; LSR W4 by 1 ; Store result to W5 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||
W4 | 0505 | W4 | 0505 | ||||||
W5 | F000 | W5 | 0282 | ||||||
SR | 0000 | SR | 0000 |
LSR | Logical Shift Right by Wb | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSR.b | Ws, | Wb, | Wd | |||
LSR.bz | [Ws], | [Wd] | ||||||
LSR{.w} | [Ws++], | [Wd++] | ||||||
LSR.l | [Ws--], | [Wd--] | ||||||
[++Ws], | [++Wd] | |||||||
[--Ws], | [--Wd] | |||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ...W15]; Wd ∈ [W0 ... W15] | |||||||
Operation: | Wb[15:0]→ Shift_Val For long word operation: Ws[31:0], 32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[63:32] → Wd For word operation: 16’b0,Ws[15:0],32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[47:32] → Wd[15:0] For byte operation: 24’b0,Ws[7:0],32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[39:32] → Wd[7:0] | |||||||
Status Affected: | N,Z | |||||||
Encoding: | 1010 | 101L | wwww | dddd | pppq | qqss | ssUU | B100 |
Description: | Logical shift right the contents of the source register Ws by Wb bits, placing the result in the destination register Wd. When used in isolation, this instruction will generate the correct result for any shift value in Wb[15:0]:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
LSRM | Logical Shift Right Multi-Precision by Short Literal | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSRM{.l} | Ws, | lit5, | Wnd | |||
[Ws], | ||||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; lit5 ∈ [0...31]; Wnd ∈ [W1 ... W14] | |||||||
Operation: | lit5[4:0]→ Shift_Val 0 → Right shift input (logical shift) Ws[31:0], 32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[63:32] → Wnd Shift_Out[31:0] | Wnd-1 → Wnd-1 | |||||||
Status Affected: | N,Z | |||||||
Encoding: | 1110 | 000k | kkkk | dddd | pppU | UUss | ssUU | 0111 |
Description: | Logical shift right the contents of the source register Ws by lit5 bits (up to 31 positions), placing the result in the destination register Wnd. The register containing the next least significant data word will already contain an intermediate shift result. Bitwise OR this value with the data shifted out of Ws in order to create the final shift result, then update the corresponding destination register. The Z bit is “sticky” (can only be cleared). The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘k’ bits provide the literal operand. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
LSRM | Logical Shift Right Multi-Precision by Wb | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LSRM{.l} | Ws, | Wb, | Wnd | |||
[Ws], | ||||||||
[Ws++], | ||||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ...W15]; Wnd ∈ [W1 ... W14] | |||||||
Operation: | Wb[15:0]→ Shift_Val 0 → Right shift input (logical shift) Ws[31:0], 32’b0 → Shift_In[63:0] Logical shift right Shift_In[63:0] by Shift_Val → Shift_Out[63:0] Shift_Out[63:32] → Wnd Shift_Out[31:0] | Wnd-1 → Wnd-1 | |||||||
Status Affected: | N,Z | |||||||
Encoding: | 1110 | 001U | ssss | dddd | pppU | UUww | wwUU | 0111 |
Description: | Logical shift right the contents of the source register Ws by Wb bits, placing the result in the destination register Wnd. The register containing the next least significant data word will already contain an intermediate shift result. Bitwise OR this value with the data shifted out of Ws in order to create the final shift result, then update the corresponding destination register. The right shift may be by any amount between zero and 32 bits. Should the shift value held in Wb[15:0] exceed 2’d32, the shift value will saturate to 2’d32 for consistency. Any data held in Wb[31:16] will have no effect. The Z bit is “sticky” (can only be cleared). The ‘w’ bits select the base (shift count) register. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note: This instruction operates in Long Word mode only. | |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
LUAC | Load Upper Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | LUAC.l | Ws, | { Slit6, } | A | |||
[Ws], | B | |||||||
[Ws++] | ||||||||
[Ws--] | ||||||||
[--Ws], | ||||||||
[++Ws], | ||||||||
[Ws+Wb], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W15]; Slit6 ∈ [-32 ... +31] | |||||||
Operation: | Ws[7:0] → ACC[71:64] ShiftSlit6(ACC) → ACC | |||||||
Status Affected: | OA, SA or OB, SB | |||||||
Encoding: | 1100 | 11A1 | wwww | ssss | pppU | UUkk | kkkk | 1011 |
Description: | Read the contents of the Effective Address. Place
the LSb of the data read into the upper 8-bits of the target accumulator
(ACCx[71:64]), then optionally arithmetically shift the entire
accumulator. The ‘A’ bits specify the destination accumulator. The ‘s’ bits specify the source register Wns. The ‘p’ bits select the source addressing mode. The ‘w’ bits specify the offset register Wb. The ‘k’ bits encode the optional operand Slit6 which determines the amount of the accumulator shift; if the operand Slit6 is absent, the literal bit field is set to all 0’s. Note: Positive values
of operand Slit6 represent arithmetic shift right. Negative
values of operand Slit6 represent shift left.
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example:1 | LUAC | A, #4, w8 | ; Load ACCAU from w8[7:0] ;Right shift value of ACCA by 4 | ||
---|---|---|---|---|---|
Before execution | After execution | ||||
ACCA | 0x00_1022_2EE1_5633_9078 | ACCA | 0xFF_F102_22EE_1563_3907 | ||
w8 | 0x000000FF | w8 | 0x000000FF |
MAC | Multiply and Accumulate | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label:} | MAC{.w} | Wx | , Wy, | A | {,AWB} | |||||
MAC.l | [Wx] | , [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3} | |||||||||
Operation: | (ACC(A or B)) + ((Wx) * (Wy)) → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modified Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 00AL | wwww | ssss | IIIi | iJJJ | jjaa | a011 | ||
Description: | Signed/unsigned (defined by CORCON.US) multiply of
data read from Wx and Wy or concurrently fetched from the X and Y
address space. The result is sign-extended (when at least one operand is
considered signed) or zero-extended (when both operands are unsigned) to
72-bits and added to the specified accumulator. Fractional or integer
operation (defined by CORCON.IF) will determine if the result is scaled
or not prior to the accumulator update. Fractional operation will scale
the result to align the operand and accumulator (msw) fractional points
(see note 3). Integer operation will align the LSb of the result with
the LSb of the accumulator. When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address. The optional AWB specifies the direct or indirect (see note 4) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MAC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size. AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 1 |
Example:1 | MAC.l | [W2] += 4, [W5] -= 4, A, W13 | ;Multiply the contents of W2 and W5 and accumulate the results to ACCA ;Increment W2 by 4; Decrement W5 by 4; ;Write back ACCB to W13 | ||||
---|---|---|---|---|---|---|---|
Before execution | After execution | ||||||
W2 | 0x5000 | W2 | 0x5004 | ||||
W5 | 0x7010 | W5 | 0x700C | ||||
W13 | 0x00000000 | W13 | 0x40210242 | ||||
CORCON[7:0] | 8'b10110000 | (Super saturation enabled.) | CORCON[7:0] | 8'b10110000 | (Super saturation enabled.) | ||
ACCA | 0x00_40000000_00000000 | ACCA | 0x00_60000000_00000000 | ||||
ACCB | 0x00_40210242_29220124 | ACCB | 0x00_40210242_29220124 | ||||
Data @0x5000 | 0x40000000 | Data @0x5000 | 0x40000000 | ||||
Data @0x7010 | 0x20000000 | Data @0x7010 | 0x20000000 |
Example:2 | MAC.l | [W2+=4], [W5+=4], B | ;Increment W2 and W5 by 4; ;Multiply the contents of W2 and W5 and accumulate the results to ACCB | ||||
---|---|---|---|---|---|---|---|
Before execution | After execution | ||||||
W2 | 0x5000 | W2 | 0x5004 | ||||
W5 | 0x7010 | W5 | 0x7014 | ||||
W13 | 0x00000000 | W13 | 0x40210242 | ||||
CORCON[7:0] | 8'b11110000 | (Super saturation enabled.) | CORCON[7:0] | 8'b11110000 | (Super saturation enabled.) | ||
ACCA | 0x00_40000000_00000000 | ACCA | 0x00_40000000_00000000 | ||||
ACCB | 0xFF_E0000000_00000000 | ACCB | 0x00_1FFFFFFF_00000000 | ||||
Data @0x5000 | 0x40000000 | Data @0x5000 | 0x40000000 | ||||
Data @0x7010 | 0x20000000 | Data @0x7010 | 0x20000000 | ||||
Data @0x5004 | 0x7FFFFFFF | Data @0x5004 | 0x7FFFFFFF | ||||
Data @0x7014 | 0x40000000 | Data @0x7014 | 0x40000000 |
MAX | Force (Signed) Maximum Data Range Limit | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MAX{.w} | Wb, | Ws | ||||
MAX.l | [Ws] | |||||||
[Ws++] | ||||||||
[Ws--] | ||||||||
[++Ws] | ||||||||
[--Ws] | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] | |||||||
Operation: | IF (Ws) > (Wb) THEN {
(Wb) → (Ws); 0→ Z; 0→ N; 0→ OV } ELSE { 1→ Z; 0→ N; 0→ OV } | |||||||
Status Affected: | N, Z, OV | |||||||
Encoding: | 1110 | 010L | UUUU | ssss | pppU | UUww | wwUU | 1111 |
Description: | Compare any size of signed data value in Ws to a maximum signed limit value held in Wb. For long word data size, if Ws[31:0] is greater than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is greater than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are set such that a subsequent BGT instruction will take a branch. If Ws[31:0] is less than or equal to the maximum limit value in Wb[31:0] (for long word data size), or if Ws[15:0] is less than or equal to the maximum limit value in Wb[15:0] (word data size), the data limit is not applied such that contents of Ws will not change (for the given data size). The Z, N and OV status bits are set such that a subsequent BZ or BLE instruction will take a branch. The OV status bit is always cleared by this instruction. The ‘s’ bits select the source (data value) register. The ‘w’ bits select the base (data limit) register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MAX | Accumulator Force Maximum Data Range Limit | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MAX | A | |||||
B | ||||||||
Operands: | None | |||||||
Operation: | IF (MAX A) THEN ( IF ACCA - ACCB > 0 THEN ( ACCB → ACCA; 0→ Z; 0→ N; 0→ OV; ) ELSE ( 1→ Z; 0→ N; 0→ OV; ) ) IF (MAX B) THEN ( IF ACCB - ACCA > 0 THEN ( ACCA → ACCB; 0→ Z; 0→ N; 0→ OV; ) ELSE ( 1→ Z; 0→ N; 0→ OV; ) ) | |||||||
Status Affected: | N, OV, Z | |||||||
Encoding: | 0111 | 001A | UUUU | 1101 | ||||
Description: | Clamp the target accumulator (defined in the instruction) to the maximum limit value previously loaded into the other accumulator. The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation). If the target accumulator is greater than the limit accumulator, load the target accumulator with the contents of the limit accumulator. The Z and N status bits are set such that a subsequent BGT instruction will take a branch. If the target accumulator is not greater than the limit accumulator, the target accumulator is unaffected. The Z status bit is set such that a subsequent BZ instruction will take a branch. The OV status bit is always cleared by this instruction. The ‘A’ bit specifies the destination accumulator. Note:
| |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
MAX | Accumulator Force Maximum Data Range Limit with Limit Excess Result | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MAX{.w}{.v} A, | Wd | |||||
MAX.l{v} | B, | [Wd] | ||||||
[Wd++] | ||||||||
[Wd--] | ||||||||
[++Wd] | ||||||||
[--Wd] | ||||||||
[Wd+Wb] | ||||||||
Operands: | Wd ∈ [W0 ... W15] (see note 4); Wb ∈ [W0 ... W15] | |||||||
Operation: | IF (MAX A) THEN ( IF ACCA - ACCB > 0 THEN ( +1 → Wd OR ACCA - ACCB → Wd (see text); ACCB → ACCA; 0→ Z; 0→ N; 0→ OV; ) ELSE ( 0 → Wd; 1→ Z; 0→ N; 0→ OV; ) ) IF (MAX B) THEN ( IF ACCB - ACCA > 0 THEN ( +1 → Wd OR ACCB - ACCA → Wd (see text); ACCA → ACCB; 0→ Z; 0→ N; 0→ OV; ) ELSE ( 0→ Wd; 1→ Z; 0→ N; 0→ OV; ) ) | |||||||
Status Affected: | N, OV, Z | |||||||
Encoding: | 1100 | 10AL | wwww | dddd | UUUq | qqUU | UUUV | 1011 |
Description: | Clamp the target accumulator (defined in the instruction) to the maximum limit value previously loaded into the other accumulator. The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation). If the target accumulator is greater than the limit accumulator, load the target accumulator with the contents of the limit accumulator. For MAX (instruction bit field V = 0, default when not declared), set Wd to +1. For MAX.v (instruction bit field V = 1), write the (signed) value by which the limit is exceeded to Wd: - Word operation: Consider only bits [47:32] of the compare result and write to Wd (destination is also word-sized, see note 3). If the limit is exceeded by a value greater than that which can be represented by a signed 16-bit number, saturate the Wd write to the maximum 16-bit positive value (i.e., set Wd[15:0] to 0x7FFF). - Long word operation: Consider only bits [31:0] of the compare result and write to Wd. If the limit is exceeded by a value greater than that which can be represented by a signed 32-bit number, saturate the Wd write to the maximum positive value (i.e., set Wd to 0x7FFFFFFF). The Z and N status bits are set such that a subsequent BGT instruction will take a branch if the limit is exceeded. If the target accumulator is not greater than the limit accumulator, the target accumulator is unaffected, and Wd is cleared. The Z status bit is set such that a subsequent BZ instruction will take a branch. The OV status bit is always cleared by this instruction. The ‘L’ bit selects word or long word operation. The ‘A’ bit specifies the destination accumulator. The ‘d’ bits select the destination register. The ‘q’ bits select the destination addressing mode. The ‘w’ bits define the offset Wb. The ‘V’ bit defines the presence and result format for Wd. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
MIN | Force (Signed) Minimum Data Range Limit | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MIN{.w} | Wb, | Ws | ||||
MIN.l | [Ws] | |||||||
[Ws++] | ||||||||
[Ws--] | ||||||||
[++Ws] | ||||||||
[--Ws] | ||||||||
Operands: | Ws ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] | |||||||
Operation: | IF (Ws) < (Wb) THEN {
(Wb) → (Ws); 0→ Z; 1→ N; 0→ OV } ELSE { 1→ Z; 0→ N; 0→ OV } | |||||||
Status Affected: | N, Z, OV | |||||||
Encoding: | 1110 | 010L | UUUU | ssss | pppU | UUww | wwUU | 1011 |
Description: | Compare a word or long word signed data value in Ws to a minimum signed limit value held in Wb. For long word data size, if Ws[31:0] is less than Wb[31:0], set Ws[31:0] to the limit value held in Wb[31:0]. For word data sizes, if Ws[15:0] is less than Wb[15:0], set Ws[15:0] to the limit value held in Wb[15:0] (Ws[31:16] is ignored). The Z, N and OV status bits are set such that a subsequent BLT instruction will take a branch. If Ws[31:0] is greater than or equal to the minimum limit value in Wb[31:0] (for long word data size), or if Ws[15:0] is greater than or equal to the minimum limit value in Wb[15:0] (word data size), the data limit is not applied such that contents of Ws will not change (for the given data size). The Z, N and OV status bits are set such that a subsequent BZ or BGE instruction will take a branch. For word sized register direct operations, Ws is always zero extended to 32-bits (even if greater than or equal to the limit value in Wb)2. The OV status bit is always cleared by this instruction. The ‘s’ bits select the source (data value) register. The ‘w’ bits select the base (data limit) register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MIN | Accumulator Force Minimum Data Range Limit (unconditional execution) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MIN | A | |||||
B | ||||||||
Operands: | None | |||||||
Operation: | IF (MIN A) THEN ( IF ACCA - ACCB < 0 THEN ( ACCB → ACCA; 0→ Z; 1→ N; 0→ OV; ) ELSE ( 1→ Z; 0→ N; 0→ OV; ) ) IF (MIN B) THEN ( IF ACCB - ACCA < 0 THEN ( ACCA→ ACCB; 0→ Z; 1→ N; 0→ OV; ) ELSE ( 1→ Z; 0→ N; 0→ OV; ) ) | |||||||
Status Affected: | N, OV, Z | |||||||
Encoding: | 0111 | 001A | UUUU | 1011 | ||||
Description: | Clamp the target accumulator (defined in the instruction) to the minimum limit value previously loaded into the other accumulator. The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation). If the target accumulator is less than the limit accumulator, load the target accumulator with the contents of the limit accumulator. The Z and N status bits are set such that a subsequent BLT instruction will take a branch. If the target accumulator is not less than the limit accumulator, the target accumulator is unaffected. The Z status bit is set (Z = 1) such that a subsequent BLT instruction will take a branch. The OV status bit is always cleared by this instruction. The ‘A’ bit specifies the destination accumulator. Note:
| |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
MIN | Accumulator Force Minimum Data Range Limit with Limit Excess Result (unconditional execution) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MIN{.w}{.v} A, | Wd | |||||
MIN.l{v} | B, | [Wd] | ||||||
[Wd++] | ||||||||
[Wd--] | ||||||||
[++Wd] | ||||||||
[--Wd] | ||||||||
[Wd+Wb] | ||||||||
Operands: | Wd ∈ [W0 ... W15] (see note 4); Wb ∈ [W0 ... W15] | |||||||
Operation: | IF (MIN A) THEN ( IF ACCA - ACCB < 0 THEN ( -1 → Wd OR ACCA - ACCB → Wd (see text); ACCB→ ACCA; 0→ Z; 1→ N; 0→ OV; ) ELSE ( 0→ Wd; 1→ Z; 0→ N; 0→ OV; ) IF (MIN B) THEN ( IF ACCB - ACCA < 0 THEN ( -1 → Wd OR ACCB - ACCA → Wd (see text); ACCA→ ACCB; 0→ Z; 1→ N; 0→ OV; ) ELSE ( 0→ Wd; 1→ Z; 0→ N; 0→ OV; ) ) | |||||||
Status Affected: | N, OV, Z | |||||||
Encoding: | 1100 | 10AL | wwww | dddd | UUUq | qqUU | UUUV | 0011 |
Description: | Clamp the target accumulator (defined in the instruction) to the minimum limit value previously loaded into the other accumulator. The compare examines the full 72-bit value of the target accumulator and will therefore clamp an overflowed accumulator (variable saturation). If the target accumulator is less than the limit accumulator, load the target accumulator with the contents of the limit accumulator. For MIN (instruction bit field V = 0, default when not declared), set Wd to -1. For MIN.v (instruction bit field V = 1), write the (signed) value by which the limit is exceeded to Wd: - Word operation: consider only bits [47:32] of the compare result and write to Wd (destination is also word sized, see note 3). If the limit is exceeded by a value greater than that which can be represented by a signed 16-bit number, saturate the Wd write to the maximum 16-bit negative value (i.e., set Wd[15:0] to 0x8000). - Long word operation: consider only bits [31:0] of the compare result and write to Wd. If the limit is exceeded by a value greater than that which can be represented by a signed 32-bit number, saturate the Wd write to the maximum negative value (i.e., set Wd to 0x80000000). The Z and N status bits are set such that a subsequent BLT instruction will take a branch if the limit is exceeded. If the target accumulator is not less than the limit accumulator, the target accumulator is unaffected, and Wd is cleared. The Z status bit is set such that a subsequent BZ instruction will take a branch. The OV status bit is always cleared by this instruction. The ‘L’ bit selects word or long word operation. The ‘A’ bit specifies the destination accumulator. The ‘d’ bits select the destination register. The ‘q’ bits select the destination addressing mode. The ‘w’ bits define the offset Wb. The ‘V’ bit defines the result format for Wd. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 2 |
MOV | Move f to Wnd (Word or Long) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV{.w} | f, | Wnd | ||||
MOV.l | ||||||||
Operands: | f ∈ [0 ... 1MB]; Wnd ∈ [W0 ... W15] | |||||||
Operation: | (f) → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 00dd | ffff | ffff | ffff | ffff | fffL | dd01 |
Description: | Moves the contents of any file register to the specified W register. The file address is a word address. Word data will be zero-extended to 32-bits prior to destination write. The ‘L’ bit selects word or long word operation. The ‘f’ bits select the address of the file register. The ‘d’ bits select the destination register. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move f to Wnd (Byte) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.bz | f, | Wnd | ||||
Operands: | f ∈ [0 ... 1MB]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | (f) → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 10dd | ffff | ffff | ffff | ffff | ffff | dd01 |
Description: | Moves contents of any file register to the specified W register. The file address is a byte address. The byte data will be zero-extended to 32-bits prior to destination write. The ‘f’ bits select the address of the file register. The ‘d’ bits select the destination register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Wns to f (Byte) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.b | Wns | f | ||||
Operands: | f ∈ [0 ... 1MB]; Wns ∈ [W0 ... W15] | |||||||
Operation: | Wns → (f) | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 11ss | ffff | ffff | ffff | ffff | ffff | ss01 |
Description: | Moves contents of the specified W register to any file register. The file address is a byte address. The ‘f’ bits select the address of the file register. The ‘s bits select the source register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Wns to f (Word/Long) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV{.w} | Wns | f | ||||
MOV.l | ||||||||
Operands: | f ∈ [0 ... 1MB]; Wns ∈ [W0 ... W15] | |||||||
Operation: | Wns → (f) | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 01ss | ffff | ffff | ffff | ffff | fffL | ss01 |
Description: | Moves contents of the specified W register to any file register. The file address is a word address. The ‘L’ bit selects word or long word operation. The ‘f’ bits select the address of the file register. The ‘s bits select the source register. Note: The file address is always either word or long word aligned. The opcode does not store the LSb because it is always 1’b0. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Wns with Signed Literal Offset to Wnd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.b | [Wns+Slit12], Wnd | |||||
MOV.bz | [Wns+Slit12], Wnd | |||||||
MOV{.w} | [Wns+Slit13], Wnd | |||||||
MOV.l | [Wns+Slit14], Wnd | |||||||
Operands: | Wns ∈ [W0 ... W15] Wnd ∈ [W0 ... W15] | |||||||
Operation: | [Wns+Slit12/13/14] → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 110L | dddd | ssss | kkkk | kkkk | kkkk | B011 |
Description: | Moves contents of the source Effective Address to a
specified W register. The contents of Wns are not modified by this
operation. The instruction encoding includes space for a 12-bit literal which is scaled accordingly for byte, word and long word data moves in order to generate the corresponding byte offset value. The ‘L’ and ‘B’ bits select operation data width. The ‘d’ bits select the destination register. The ‘s’ bits select the source register. The ‘k’ bits specify the literal operand. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Ws to f (extended) | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.l | Ws, | f | ||||
MOV{.w} | [Ws], | |||||||
MOV{.b} | [Ws++], | |||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | f ∈ [1MB1 ... 4GB]; Ws ∈ [W0 ... W15] | |||||||
Operation: | Ws → (f) | |||||||
Status Affected: | None | |||||||
Encoding: | ||||||||
1st word | 1111 | 001U | ffff | ffff | ffff | ffff | ffff | U011 |
2nd word | 1111 | 001L | ssss | Ufff | pppf | ffff | ffff | B111 |
Description: | Moves contents of Ws to any file register. The file address is a byte address. The ‘s’ bits select the Working register. The ‘p’ bits select the source addressing mode. The ‘f’ bits select the address of the file register: file[31:0] = Word1[18:13], Word2[9:4], Word1[23:4] | |||||||
I-Words: | 2 | |||||||
Cycles: | 2 |
MOV | Move Wns to Wnd with Signed Literal Offset | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.b | Wns, [Wnd+Slit12] | |||||
MOV{.w} | Wns, [Wnd+Slit13] | |||||||
MOV.l | Wns, [Wnd+Slit14] | |||||||
Operands: | Wnd ∈ [W0 ... W15] Wns ∈ [W0 ... W15] | |||||||
Operation: | Wns → [Wnd+Slit12/13/14] | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 110L | dddd | ssss | kkkk | kkkk | kkkk | B111 |
Description: | Moves contents of a specified W register to the
destination Effective Address. The contents of Wnd are not modified by
this operation. The instruction encoding includes space for a 12-bit literal which is scaled accordingly for byte, word and long word data moves in order to generate the corresponding byte offset value. The ‘L’ and ‘B’ bits select operation data width. The ‘d’ bits select the destination register. The ‘s’ bits select the source register. The ‘k’ bits specify the literal operand. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Ws to Wd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.b | Ws, | Wd | ||||
MOV.bz | [Ws], | [Wd] | ||||||
MOV{.w} | [Ws++] | [Wd++] | ||||||
MOV.l | [Ws--] | [Wd--] | ||||||
[--Ws], | [--Wd] | |||||||
[++Ws], | [++Wd] | |||||||
[Ws+Wb], [Wd+Wb] | ||||||||
SR | SR | |||||||
Operands: | Ws ∈ [W0 ... W15]; Wd ∈ [W0 ... W15]; Wb ∈ [W0 ... W14] (see Note 6) | |||||||
Operation: | (EAs) → (EAd) | |||||||
Status Affected: | None (see note 3) | |||||||
Encoding: | S000 | 001L | dddd | ssss | pppq | qqww | wwUU | B000 |
Description: | Move the contents of the source register into the destination register. The ‘S’ bit selects instruction size. The ‘L’ and ‘B’ bits select operation data width. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. The ‘w’ bits define the offset Wb. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |
Example 1: | MOV.B [W0--], W4 ; Move [W0] to W4 (Byte mode) ; Post-decrement W0 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W0 | 0A01 | W0 | 0A00 | ||||||||||
W4 | 2976 | W4 | 2989 | ||||||||||
Data 0A00 | 8988 | Data 0A00 | 8988 | ||||||||||
SR | 0000 | SR | 0000 |
MOV | Move Literal to Wnd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.bz | lit8 | Wnd | ||||
MOV{.w} | lit16 | |||||||
MOV.sl | lit24 | |||||||
Operands: | lit8∈ [0 ... 255]; lit16 ∈ [0 ... 65535]; lit24 ∈ [0 ... 16MB]; Wnd ∈ [W0 ... W15] | |||||||
Operation: | 8’h00, lit24 → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 10dd | ddkk | kkkk | kkkk | kkkk | kkkk | kkkk | kk11 |
Description: | The literal ‘k’ is zero-extended to 32-bits then loaded into the Wnd register. The ‘d’ bits select the Working register. The ‘k’ bits specify the value of the 8-bit, 16-bit or 24-bit literal. The 8-bit and 16-bit literals are zero extended by the assembler to generate the 24-bit value for the opcode. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move Long Literal to Wd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.l | lit32, | Wd | ||||
[Wd] | ||||||||
[Wd++] | ||||||||
[Wd--] | ||||||||
[++Wd] | ||||||||
[--Wd] | ||||||||
Operands: | lit32 ∈ [0 ... 4GB]; Wd ∈ [W0 ... W15] | |||||||
Operation: | lit32 → Wd | |||||||
Status Affected: | None | |||||||
Encoding: | ||||||||
1st word | 1000 | 000U | kkkk | kkkk | kkkk | kkkk | kkkk | U001 |
2nd word | 1000 | 000U | dddd | Ukkk | kkkq | qqkk | kkkk | U101 |
Description: | The literal ‘k’ is loaded into the Wd register. The ‘d’ bits select the Working register. The ‘q’ bits select the destination addressing mode. The ‘k’ bits specify the value of the 32-bit literal: lit32[31:0] = Word2[18:13], Word2[9:4], Word1[23:4] | |||||||
I-Words: | 2 | |||||||
Cycles: | 2 |
MOV | Move Short Literal to Wnd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.l | lit5, | Wnd | ||||
Operands: | lit5 ∈ [0 ... 31]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | 27’h0000000, lit5 → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 0001 | 000k | kkkk | dddd | ||||
Description: | The literal ‘k’ is zero-extended to 32-bits then loaded into the Wnd register. The ‘d’ bits select the Working register. The ‘k’ bits specify the value of the 5-bit literal. | |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
MOV | Move Ws to Wd with Bit-Reversed Addressing | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOVR{.w} Ws, | [Wd++] | |||||
MOVR.l | [Ws], | [++Wd] | ||||||
[Ws++], | ||||||||
[++Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W14]; Wd ∈ [W0 ... W14] | |||||||
Operation: | (EAs) → (EAd) with Bit-Reversed Addressing | |||||||
Status Affected: | None | |||||||
Encoding: | 1000 | 001L | dddd | ssss | pppq | qqUU | UUUU | 1100 |
Description: | Move the contents of the source address to the destination address using Bit-Reversed Addressing to generate the destination EA. The destination Bit-Reversed Addressing modifier is sourced from XBREV.XB[14:0]. The ‘L’ bit selects operation data width. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘q’ bits select the destination addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MOV | Move from Stack with Literal Offset to Wnd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.l | [W15-lit7], Wnd | |||||
[W14+slit7], Wnd | ||||||||
Operands: | Wnd ∈ [W0 ... W14]; lit7 ∈ [4, 8 .... 124, 128] (see note 2) slit7 ∈ [-64, -60 .... +56, +60] | |||||||
Operation: | ([W15 - lit7]) → Wnd or ([W14 + slit7]) → Wnd | |||||||
Status Affected: | None | |||||||
Encoding: | 0000 | 11Fk | kkkk | dddd | ||||
Description: | Move the contents of the system stack to the
destination register using the SP (W15) or FP (W14) as source address
with a (byte) offset. The stack source Effective Address is defined as
[W15 - lit7] or [W14 + slit7], but is aligned to a 32-bit boundary
(i.e., long word data moves only). The offset used by the CPU is a signed value generated from the 5-bit literal stored within the opcode. The Effective Address is long word aligned such that the LS 2-bits of the address are always 2’b00.
| |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
MOV | Move Wns to Stack with Literal Offset | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOV.l | Wns, | [W15 - lit7] | ||||
[W14 + slit7] | ||||||||
Operands: | Wns ∈ [W0 ... W14]; lit8 ∈ [4, 8 .... 124, 128] (see note 2) slit7 ∈ [-64, -60 .... +56, +60] | |||||||
Operation: | Wns → ([W15 - lit7]) or Wns → ([W14 + slit7]) | |||||||
Status Affected: | None | |||||||
Encoding: | 0000 | 10Fk | kkkk | ssss | ||||
Description: | Move the contents of the system stack to the
destination register using the SP (W15) or FP (W14) as destination
address with a (byte) offset. The stack destination Effective Address is
defined as [W15 - lit7] or [W14 + slit7], but is aligned to a 32-bit
boundary (i.e., long word data moves only). The offset used by the CPU is a signed value generated from the 5-bit literal stored within the opcode. The Effective Address is long word aligned such that the LS 2-bits of the address are always 2’b00.
| |||||||
I-Words: | 0.5 | |||||||
Cycles: | 1 |
MOVIF | Conditionally Move Wb or Wns to Wd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOVIF.b | CC, | Wb, | Wns, | Wd | ||
MOVIF.bz | [Wd] | |||||||
MOVIF{.w} | [Wd++] | |||||||
MOVIF.l | [Wd--] | |||||||
[--Wd] | ||||||||
[++Wd] | ||||||||
Operands: | Wb ∈ [W0 ... W15]; Wns ∈ [W0 ... W15]; Wd ∈ [W0 ... W15] CC ∈ Z, N, C, OV, GT, LT, GTU | |||||||
Operation: | If CC = true then Wb → (EAd) Else Wns → (EAd) | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 011L | dddd | ssss | rrrq | qqww | wwUU | B011 |
Description: | Test the specified condition. If true, move the contents of the Wb source register into the destination, else move the contents of the Wns source register into the destination. The ‘L’ and ‘B’ bits select operation data width. The ‘w’ bits select the (condition true) Wb source register. The ‘s’ bits select the (condition false) Ws source register. The ‘d’ bits select the destination register. The ‘q’ bits select the destination addressing mode. The ‘r’ bits select the move condition. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example:1 | MOVIF | Z, W5, W6, W1 | ;Move W5 to W1 if Z == 1; else move W6 to W1 | |||
---|---|---|---|---|---|---|
Before execution | After execution | |||||
W5 | 0x11111111 | W5 | 0x11111111 | |||
W6 | 0x22222222 | W6 | 0x22222222 | |||
W1 | 0x00000000 | W1 | 0x11111111 | |||
SR[7:0] | 8'bxxxxxxx1x | (Z = 1) | SR[7:0] | 8'bxxxxxxx1x | (Z = 1) |
Example:2 | MOVIF | C, W5, W6, W1 | ;Move W5 to W1 if C == 1; else move W6 to W1 | |||
---|---|---|---|---|---|---|
Before execution | After execution | |||||
W5 | 0x11111111 | W5 | 0x11111111 | |||
W6 | 0x22222222 | W6 | 0x22222222 | |||
W1 | 0x00000000 | W1 | 0x22222222 | |||
SR[7:0] | 8'bxxxxxxxx0 | (C = 0) | SR[7:0] | 8'bxxxxxxxx0 | (C = 0) |
MOVS | Move Signed Literal to Wd | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MOVS.b | slit16, | Wd | ||||
MOVS{.w} | [Wd] | |||||||
MOVS.l | [Wd++] | |||||||
[Wd--] | ||||||||
[++Wd] | ||||||||
[--Wd] | ||||||||
SR | ||||||||
Operands: | slit16 ∈ [-32768 ... 32767]; Wd ∈ [W0 ... W15] | |||||||
Operation: | Byte: slit16[7:0] → (EAd[7:0]) Word: slit16[15:0] → (EAd[15:0]) Long or Word Register Direct: {16{slit16[15]}}, slit16[15:0] → (EAd[31:0]) | |||||||
Status Affected: | None (see note 4) | |||||||
Encoding: | 1000 | 1kkk | dddd | kkkk | kkkq | qqkk | kkkk | LB01 |
Description: | Write a signed literal value to the destination. MOVS.b will move the LS 8-bits of the literal to the destination. For Register Direct Addressing, the remaining bits of the register will be unaffected. MOVS.w will move the 16-bit literal to the destination (see Note 1). For Register Direct Addressing, the value will be sign-extended to 32-bits. MOVS.l will sign extend the literal to 32-bits prior to moving the value to the destination. The ‘L’ and ‘B’ bits select operation data width. The ‘d’ bits select the Working register. The ‘q’ bits select the destination addressing mode. The ‘k’ bits specify the value of the literal. For .b mode, the 8-bit literal value is zero extended by the assembler to generate the 16-bit value for the opcode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MPY | Multiply to Accumulator | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label:} | MPY{.w} | Wx | , Wy, | A | {,AWB} | |||||
MPY.l | [Wx] | , [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3} | |||||||||
Operation: | ((Wx) * (Wy)) → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modification Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 01AL | wwww | ssss | IIIi | iJJJ | jjaa | a011 | ||
Description: | Signed/unsigned (defined by CORCON.US) multiply of
data read from Wx and Wy or concurrently fetched from the X and Y
address space. The result is sign-extended (when at least one operand is
considered signed) or zero-extended (when both operands are unsigned) to
72-bits then written to the specified accumulator. Fractional results
are also scaled prior to the accumulator update to align the operand and
accumulator (msw) fractional points. When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address. The optional AWB specifies the direct or indirect (see note 2) store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MPY operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 3). AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 1 |
Example:1 | MPY.L | [w4]+=4, [w5]+=4, A | ; Multiply W4*W5 and store to ACCA; Post-increment W4 by 4; Post-increment W5 by 4; CORCON = 0x0000 (fractional multiply, no saturation) | ||||
---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||
W4 | 4014 | W4 | 4018 | ||||
W5 | 402C | W5 | 4030 | ||||
ACCA | FF F780 2087 0000 0000 | ACCA | 00 3800 0000 0000 0000 | ||||
Data | 4014 C0000000 | Data | 4014 C0000000 | ||||
Data | 402C 90000000 | Data | 402C 90000000 | ||||
CORCON | 0000 | CORCON | 0000 | ||||
SR | 0000 | SR | 0000 |
Example:2 | MPY.L | [w4]+=4, [w5+=4], B | ; increment W5 by 4; Multiply W4*W5 and store to ACCB; Post-increment W4 by 4; CORCON = 0x0000 (fractional multiply, no saturation) | ||||
---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||
W4 | 4014 | W4 | 4018 | ||||
W5 | 4028 | W5 | 402C | ||||
ACCB | 00 9834 4500 0000 0055 | ACCB | FF E954 3748 0000 0000 | ||||
Data | 4014 671F0000 | Data | 4014 671F0000 | ||||
Data | 402C E3DC0000 | Data | 402C E3DC0000 | ||||
CORCON | 0000 | CORCON | 0000 | ||||
SR | 0000 | SR | 0000 |
MPYN | Negated Multiply to Accumulator | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label:} | MPYN{.w} Wx | , Wy, | A | {,AWB} | ||||||
MPYN.l | [Wx] | , [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]2} | |||||||||
Operation: | - ((Wx) * (Wy)) → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modification Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 01AL | wwww | ssss | IIIi | iJJJ | jjaa | a111 | ||
Description: | Signed/unsigned (defined by CORCON.US) multiply of
data read from Wx and Wy or concurrently fetched from the X and Y
address space. The result is sign-extended (when at least one operand is
considered signed) or zero-extended (when both operands are unsigned) to
72-bits, negated and then written to the specified accumulator.
Fractional results are also scaled prior to the accumulator update to
align the operand and accumulator (msw) fractional points. When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address. The optional AWB specifies the direct or indirect store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MPYN operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 3). AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 1 |
MSC | Multiply and Subtract from Accumulator | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Syntax: {label:} | MSC{.w} | Wx | , Wy, | A | {,AWB} | |||||
MSC.l | [Wx] | , [Wy], | B | |||||||
[Wx]+=kx | , [Wy]+=ky, | |||||||||
[Wx]-=kx | , [Wy]-=ky, | |||||||||
[Wx+=kx] | , [Wy+=ky], | |||||||||
[Wx-=kx] | , [Wy-=ky], | |||||||||
[Wx+W12] | , [Wy+W12], | |||||||||
Operands: | Wx ∈ {W0 ... W14}; Wy ∈ {W0 ... W14} Word mode: kx ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; ky ∈ {-8, -6, -4, -2, 2, 4, 6, 8}; Long Word mode: kx ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; ky ∈ {-16, -12, -8, -4, 4, 8, 12, 16}; AWB ∈ {W0, W1, W2, W3, W13, [W13++], [W15++]3} | |||||||||
Operation: | (ACC(A or B)) − ((Wx) * (Wy)) → ACC(A or B); (ACC(B or A)) rounded → AWB When Indirect Pre/Post Modified Addressing: (Wx)+kx→Wx or (Wx)-kx→Wx; (Wy)+ky→Wy or (Wy)-ky→Wy; | |||||||||
Status Affected: | OA,SA or OB,SB | |||||||||
Encoding: | 1101 | 00AL | wwww | ssss | IIIi | iJJJ | jjaa | a111 | ||
Description: | Signed/unsigned (defined by CORCON.US) multiply of
data read from Wx and Wy or concurrently fetched from the X and Y
address space. The result is sign-extended (when at least one operand is
considered signed) or zero-extended (when both operands are unsigned) to
72-bits, and then subtracted from the specified accumulator. Fractional
or integer operation (defined by CORCON.IF) will determine if the result
is scaled or not prior to the accumulator update. Fractional operation
will scale the result to align the operand and accumulator (msw)
fractional points. Integer operation will align the LSb of the result
with the LSb of the accumulator. For word sized operand operations, ACCx[31:0] (Integer mode) or ACCx[32:0] (Fractional mode) is preserved (see note 2). When indirect addressing is selected for either or both the X and Y address space, Wx and Wy registers provide the corresponding indirect addresses. The address modifier values are kx and ky, respectively, and represent the number of data bytes by which to modify the Effective Address. The optional AWB specifies the direct or indirect store of the (32-bit) rounded fractional contents of the accumulator not targeted by the MSC operation. Rounding mode is defined by CORCON.RND. Write data width is determined by selected instruction data size (see note 4). AWB is not intended for use when the DSP engine is operating in Integer mode. Data read may be 16-bit or 32-bit values. All indirect address modification is scaled accordingly. The ‘L’ bit selects word or long word operation. The ‘A’ bit selects the accumulator for the result. The ‘I’ bits select the Operation.X-Space Addressing mode. The ‘i’ bits select the kx modification value. The ‘J’ bits select the Operation.Y-Space Addressing mode. The ‘j’ bits select the ky modification value. The ‘s’ bits select the Wx register The ‘w’ bits select the Wy register. The ‘a’ bits select the accumulator write-back destination and addressing mode. Note:
| |||||||||
I-Words: | 1 | |||||||||
Cycles: | 1 |
Example:1 | MSC.L | [W6]-=4, [W7]-=4, A, W7 | ; Multiply [W6]*[W7] and subtract theresult from ACCA ; W6 Post-decrement by 4 ;Post-decrement W7 by 4 ; CORCON = 0x0001 (integer multiply, no saturation) | ||||
---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||
W6 | 4C00 0000 | W6 | 4BFC 0000 | ||||
W7 | 4800 0000 | W7 | 48FC 0000 | ||||
W8 | 0C00 0000 | W8 | 0BFC 0000 | ||||
ACCA | 00 0567 8000 0000 0000 | ACCA | 00 3738 5ED0 0000 0000 | ||||
Data | 4C00 9051 0000 | Data | 4BFC D309 0000 | ||||
Data | 4800 7230 0000 | Data | 48FC 100B 0000 | ||||
CORCON | 0001 | CORCON | 0001 | ||||
SR | 0000 | SR | 0000 |
Example:2 | MSC.L | [W4+=12], [W5+w12], B, [W13] | ; Multiply W4*W5 and subtract the resultfrom ACCB ; Fetch [W11+W12] to W5 ; Write Back ACCA to W13 ; CORCON = 0x0000 (fractional multiply, no saturation) | ||||
---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||
W4 | 4000 | W4 | 4000 | ||||
W5 | 5000 | W5 | 5000 | ||||
W12 | 0800 | W12 | 0800 | ||||
W13 | 6233 1356 | W13 | 3738 5ED0 | ||||
ACCA | 00 3738 5ED0 0000 0000 | ACCA | 00 3738 5ED0 0000 0000 | ||||
ACCB | 00 1000 0000 0000 0000 | ACCB | 00 0EC0 0000 0000 0000 | ||||
Data | 4800 0500 0000 | Data | 4800 0500 0000 | ||||
Data | 5800 2000 0000 | Data | 5800 2000 0000 | ||||
CORCON | 0000 | CORCON | 0000 | ||||
SR | 0000 | SR | 0000 |
MUL | Multiply f by Wn | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MUL.b | f, | Wns | ||||
MUL{.w} | ||||||||
MUL.l | ||||||||
Operands: | f ∈ [0 ... 64KB]; Wn ∈ [W0 ... W14] | |||||||
Operation: | If Byte mode:
(Wn)[7:0] * (f)[7:0] → 16’b0, W2[15:0]. If Word mode: (Wn)[15:0] * (f)[15:0] → W2 If Long Word mode: (Wn) * (f) → W2 | |||||||
Status Affected: | None | |||||||
Encoding: | 1011 | 101L | ssss | ffff | ffff | ffff | ffff | BU01 |
Description: | Unsigned integer multiply of Wn and the file register, then write the result to the default destination register W2. For long word operations, the LS 32-bits of the 64-bit result is written to W2. The ‘L’ and ‘B’ bits select operation data width. The ‘f’ bits select the address of the file register. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULISS/MULFSS | Signed-Signed Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULISS.w Wb, | Ws, | A | ||||
MULFSS.w | [Ws], | B | ||||||
MULISS.l | [Ws++], | |||||||
MULFSS.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15] | |||||||
Operation: | Signed (Wb) * signed (Ws) → ACC(A or B)[63:0] 8{ACC(A or B)[63]} → ACC(A or B)[71:64] | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 100L | wwww | ssss | pppA | UUUU | UUUU | I010 |
Description: | Performs word or long word integer (MULISS) or fractional (MULFSS) multiply of the signed contents of Wb and Ws. The source operands are interpreted as a two’s-complement signed values. For MULISS.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULFSS.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared. For MULISS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULFSS.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared. The ‘L bit selects word or long word operation. The ‘I’ bit selects between integer and fractional operation. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘p’ bits select the source addressing mode. Note: The state of the Multiplier Mode bit (CORCON.US) has no effect upon the operation of this instruction. | |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULISU/MULFSU | Signed-Unsigned Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULISU.w Wb, | Ws, | A | ||||
MULFSU.w | [Ws], | B | ||||||
MULISU.l | [Ws++], | |||||||
MULFSU.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15] | |||||||
Operation: | signed (Wb) * unsigned (Ws) → ACC(A or B)[63:0] 8{ACC(A or B)[63]} → ACC(A or B)[71:64] | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 101L | wwww | ssss | pppA | UUUU | UUUU | I110 |
Description: | Performs a word or long word integer (MULISU) or fractional (MULFSU) multiply of the signed contents of Wb and unsigned contents of Ws. Wb is interpreted as a two’s-complement signed value. For MULISU.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULFSU.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared. For MULISU.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULFSU.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared. The ‘L bit selects word or long word operation. The ‘I’ bit selects between integer and fractional operation. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULISU/MULIUU | Signed/Unsigned - Unsigned Literal Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULISU.w Ws, | lit8, | A | ||||
MULIUU.w [Ws], | B | |||||||
MULISU.l | [Ws++], | |||||||
MULIUU.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; lit8 ∈ [0 ... 255] | |||||||
Operation: | MULISU: signed (Ws) * unsigned lit8 → ACC(A or B)[63:0]
8{ACC(A or B)[63]} → ACC(A or B)[71:64] MULIUU: unsigned (Ws) * unsigned lit8 → ACC(A or B)[63:0] 8’b00 → ACC(A or B)[71:64] Note: The literal is zero-extended to the selected data size of the operation | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 111L | UUUU | ssss | pppA | kkkk | kkkk | 1V10 |
Description: | Performs a word or long word integer multiply of the signed (MULISU) or unsigned (MULIUU) contents of Ws and unsigned lit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value. For MULISU.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULIUU.l, the 64-bit result will be zero-extended and written to ACCx[71:0]. For MULISU.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULIUU.w, the 32-bit result will be zero-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. The ‘L bit selects word or long word operation. The ‘V’ bit selects between a signed or unsigned Ws value. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘p’ bits select the source addressing mode. The ‘k’ bits determine the 8-bit literal value. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULIUU/MULFUU | Unsigned-Unsigned Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULIUU.w Wb, | Ws, | A | ||||
MULFUU.w | [Ws], | B | ||||||
MULIUU.l | [Ws++], | |||||||
MULFUU.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15] | |||||||
Operation: | unsigned (Wb) * unsigned (Ws) → ACC(A or B)[63:0] 8’h00 → ACC(A or B)[71:64] | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 101L | wwww | ssss | pppA | UUUU | UUUU | I010 |
Description: | Performs a word or long word integer (MULIUU) or fractional (MULFUU) multiply of the unsigned contents of Wb and unsigned contents of Ws (see Note 2). For MULIUU.l, the 64-bit result will be zero-extended and written to ACCx[71:0]. For MULFUU.l, the 64-bit result will be zero-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared. For MULIUU.w, the 32-bit result will be zero-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULFUU.w, the 32-bit result will be zero-extended, shifted left by 33 bits (to align the result and accumulator fractional points) and written to ACCx[71:33]. ACCx[32:0] will always be cleared. The ‘L bit selects word or long word operation. The ‘I’ bit selects between integer and fractional operation. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULIUS/MULFUS | Unsigned-Signed Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULIUS.w Wb, | Ws, | A | ||||
MULFUS.w | [Ws], | B | ||||||
MULIUS.l | [Ws++], | |||||||
MULFUS.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W14]; Ws ∈ [W0 ... W15] | |||||||
Operation: | unsigned (Wb) * signed (Ws) → ACC(A or B)[63:0] 8{ACC(A or B)[63]} → ACC(A or B)[71:64] | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 100L | wwww | ssss | pppA | UUUU | UUUU | I110 |
Description: | Performs a word or long word integer (MULIUS) or fractional (MULFUS) multiply of the unsigned contents of Wb and signed contents of Ws (see Note 2). For MULIUS.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULFUS.l, the 64-bit result will be sign-extended, shifted left by one (to align the result and accumulator fractional points), and written to ACCx[71:0]. ACCx[0] will always be cleared. For MULIUS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULFUS.w, the 32-bit result will be sign-extended, shifted left by 33 bits (to align the result and accumulator fractional points), and written to ACCx[71:33]. ACCx[32:0] will always be cleared. The ‘L bit selects word or long word operation. The ‘I’ bit selects between integer and fractional operation. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULISS/MULIUS | Signed/Unsigned-Signed Literal Multiply to Accumulator | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULISS.w Ws, | slit8, | A | ||||
MULIUS.w [Ws], | B | |||||||
MULISS.l | [Ws++], | |||||||
MULIUS.l | [Ws--], | |||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; slit8 ∈ [-128 ... 127] | |||||||
Operation: | MULxUS : unsigned (Ws) * signed slit8 → ACC(A or B)[63:0] MULxSS : signed (Ws) * signed slit8 → ACC(A or B)[63:0] 8{ACC(A or B)[63]} → ACC(A or B)[71:64] Note: The literal is sign-extended to the selected data size of the operation | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 110L | UUUU | ssss | pppA | kkkk | kkkk | 1V10 |
Description: | Performs a word or long word integer multiply of the signed (MULISS) or unsigned (MULIUS) contents of Ws and signed slit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value. For MULISS.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULIUS.l, the 64-bit result will be sign-extended and written to ACCx[71:0]. For MULISS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. For MULIUS.w, the 32-bit result will be sign-extended and written to ACCx[71:32]. ACCx[31:0] will hold the multiply result. The ‘L bit selects word or long word operation. The ‘V’ bit selects between a signed or unsigned Ws value. The ‘A’ bit selects the destination accumulator. The ‘s’ bits select the source register. The ‘p’ bits select the source addressing mode. The ‘k’ bits determine the 8-bit literal value. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULSS/MULUS | Signed/Unsigned-Signed Literal Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULSS.d | Ws, | slit8, | Wnd | |||
MULSS.l [Ws], | ||||||||
MULSS.w [Ws++], | ||||||||
MULUS.d | [Ws--], | |||||||
MULUS.l [++Ws], | ||||||||
MULUS.w [--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; slit8 ∈ [-128 ... 127]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULSS.d : signed (Ws) * signed slit8 → {Wnd+1[31:0], Wnd[31:0]} MULSS.l : signed (Ws) * signed slit8 → {Wnd[31:0]} MULSS.w : signed (Ws[15:0]) * signed slit8 → {Wnd[31:0]} MULUS.d : unsigned (Ws) * signed slit8 → {Wnd+1[31:0], Wnd[31:0]} MULUS.l : unsigned (Ws) * signed slit8 → {Wnd[31:0]} MULUS.w : unsigned (Ws[15:0]) * signed slit8 → {Wnd[31:0]} Note: The literal is sign-extended to the selected data size of the operation | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 010L | dddd | ssss | pppE | kkkk | kkkk | 0V10 |
Description: | Performs a 32-bit x 32-bit or a 16-bit x 16-bit integer multiply of the signed or unsigned contents of Ws and sign-extended slit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value. For MULSS.d and MULUS.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Ws and sign-extended slit8 is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULSS.l and MULUS.l (L = 1, E = 0), a 32-bit x 32-bit multiply of Ws and sign-extended slit8 is executed. The LS 32-bits of the 64-bit result will be written to Wnd. For MULSS.w and MULUS.w (L = 0, E = 0), a 16-bit x 16-bit multiply of the lsw of Ws and sign-extended slit8 is executed. The result will be 32-bits and is written to Wnd. The ‘L’ bit selects the operand date size. The ‘V’ bit selects between a signed or unsigned Ws value. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘k’ bits determine the 8-bit literal value. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULSS | Signed-Signed Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULSS.d | Wb, | Ws, | Wnd | |||
MULSS.l | [Ws], | |||||||
MULSS.w | [Ws++], | |||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULSS.d : signed (Wb) * signed (Ws) → {Wnd+1[31:0], Wnd[31:0]} MULSS.l : signed (Wb) * signed (Ws) → {Wnd[31:0]} MULSS.w : signed (Wb[15:0]) * signed (Ws[15:0]) → {Wnd[31:0]} | |||||||
Status Affected: | None | |||||||
Encoding: | S001 | 010L | dddd | ssss | pppE | UUww | wwUU | 0000 |
Description: | Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed contents of Wb and Ws. For MULSS.d (L=1, E=1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULSS.l (L=1, E=0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the 64-bit result will be written to Wnd. For MULSS.w (L=0, E=0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd. Both source operands are interpreted as two’s-complement integer signed values. The ‘S’ bit selects instruction size. The ‘L’ bit selects the operand data size. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |
MULSU | Signed-Unsigned Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULSU.d | Wb, | Ws, | Wnd | |||
MULSU.l | [Ws], | |||||||
MULSU.w | [Ws++], | |||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULSU.d : signed (Wb) * unsigned (Ws) → {Wnd+1[31:0], Wnd[31:0]} MULSU.l : signed (Wb) * unsigned (Ws) → {Wnd[31:0]} MULSU.w : signed (Wb[15:0]) * unsigned (Ws[15:0]) → {Wnd[31:0]} | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 011L | dddd | ssss | pppE | UUww | wwUU | 0100 |
Description: | Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed contents of Wb and unsigned contents of Ws. Wb is interpreted as a two’s-complement signed value. For MULSU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULSU.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd. For MULSU.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd. The ‘L’ bit selects the operand date size. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
Example 1: | MUL.SU W8, [W9], W0 ; Multiply W8*[W9] ; Store the result to W0:W1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W0 | 68DC | W0 | 0000 | ||||||||||
W1 | AA40 | W1 | F100 | ||||||||||
W8 | F000 | W8 | F000 | ||||||||||
W9 | 178C | W9 | 178C | ||||||||||
Data 178C | F000 | Data 178C | F000 | ||||||||||
SR | 0000 | SR | 0000 |
Example 2: | MUL.SU W2, [++W3], W4 ; Pre-Increment W3 ; Multiply W2*[W3] ; Store the result to W4:W5 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Before Instruction | After Instruction | ||||||||||||
W2 | 0040 | W2 | 0040 | ||||||||||
W3 | 0280 | W3 | 0282 | ||||||||||
W4 | 1819 | W4 | 1A00 | ||||||||||
W5 | 2021 | W5 | 0000 | ||||||||||
Data 0282 | 0068 | Data 0282 | 0068 | ||||||||||
SR | 0000 | SR | 0000 |
MULSU/MULUU | Signed/Unsigned-Unsigned Short Literal Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULSU.d | Ws, | lit8, | Wnd | |||
MULSU.l | [Ws], | |||||||
MULSU.w [Ws++], | ||||||||
MULUU.d | [Ws--], | |||||||
MULUU.l [++Ws], | ||||||||
MULUU.w [--Ws], | ||||||||
Operands: | Ws ∈ [W0 ... W15]; lit8 ∈ [0...255]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULSU.d : signed (Ws) * unsigned lit8 → {Wnd+1[31:0], Wnd[31:0]} MULSU.l : signed (Ws) * unsigned lit8 → {Wnd[31:0]} MULSU.w : signed (Ws[15:0]) * unsigned lit8 → {Wnd[31:0]} MULUU.d : unsigned (Ws) * unsigned lit8 → {Wnd+1[31:0], Wnd[31:0]} MULUU.l : unsigned (Ws) * unsigned lit8 → {Wnd[31:0]} MULUU.w : unsigned (Ws[15:0]) * unsigned lit8 → {Wnd[31:0]} Note: The literal is zero-extended to the selected data size of the operation | |||||||
Status Affected: | None | |||||||
Encoding: | 1111 | 011L | dddd | ssss | pppE | kkkk | kkkk | 0V10 |
Description: | Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the signed or unsigned contents of Ws and unsigned lit8. The ‘V’ bit is set to 1’b1 to select a signed Ws value and set to 1’b0 to select an unsigned Ws value. For MULSU.d and MULUU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Ws and zero-extended lit8 is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULSU.l and MULUU.l (L = 1, E = 0), a 32-bit x 32-bit multiply of Ws and zero-extended lit8 is executed. The LS 32-bits of the 64-bit result will be written to Wnd. For MULSU.w and MULUU.w (L = 0, E = 0), a 16-bit x 16-bit multiply of the lsw of Ws and zero-extended lit8 is executed. The result will be 32-bits and is written to Wnd. The ‘L’ bit selects the operand date size. The ‘V’ bit selects between a signed or unsigned Ws value. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. The ‘k’ bits determine the 8-bit literal value. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULUS | Unsigned-Signed Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULUS.d | Wb, | Ws, | Wnd | |||
MULUS.l | [Ws], | |||||||
MULUS.w | [Ws++], | |||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULUS.d : unsigned (Wb) * signed (Ws) → {Wnd+1[31:0], Wnd[31:0]} MULUS.l : unsigned (Wb) * signed (Ws) → {Wnd[31:0]} MULUS.w : unsigned (Wb[15:0]) * signed (Ws[15:0]) → {Wnd[31:0]} | |||||||
Status Affected: | None | |||||||
Encoding: | 1001 | 010L | dddd | ssss | pppE | UUww | wwUU | 0100 |
Description: | Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the unsigned contents of Wb and signed contents of Ws. Ws is interpreted as a two’s-complement signed value. For MULUS.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULUS.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd. For MULUS.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd. The ‘L’ bit selects the operand date size. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 | |||||||
Cycles: | 1 |
MULUU | Unsigned-Unsigned Integer Multiply | |||||||
---|---|---|---|---|---|---|---|---|
Syntax: | {label:} | MULUU.d | Wb, | Ws, | Wnd | |||
MULUU.l | [Ws], | |||||||
MULUU.w | [Ws++], | |||||||
[Ws--], | ||||||||
[++Ws], | ||||||||
[--Ws], | ||||||||
Operands: | Wb ∈ [W0 ... W15]; Ws ∈ [W0 ... W15]; Wnd ∈ [W0 ... W14] | |||||||
Operation: | MULUU.d : unsigned (Wb) * unsigned (Ws) → {Wnd+1[31:0], Wnd[31:0]} MULUU.l : unsigned (Wb) * unsigned (Ws) → {Wnd[31:0]} MULUU.w : unsigned (Wb[15:0]) * unsigned (Ws[15:0]) → {Wnd[31:0]} | |||||||
Status Affected: | None | |||||||
Encoding: | S001 | 011L | dddd | ssss | pppE | UUww | wwUU | 0000 |
Description: | Performs a 16-bit x 16-bit or 32-bit x 32-bit integer multiply of the unsigned contents of Wb and Ws. For MULUU.d (L = 1, E = 1), a 32-bit x 32-bit multiply of Wb and Ws is executed. The MS 32-bits of the 64-bit result will be written to Wnd+1, and the LS 32-bits of the result will be written to Wnd. For MULUU.l (L=1, E = 0), a 32-bit x 32-bit multiply of Wb and Ws is executed. The LS 32-bits of the result will be written to Wnd. For MULUU.w (L=0, E = 0), a 16-bit x 16-bit multiply of the lsw of Wb and the lsw of Ws is executed. The result will be 32-bits and is written to Wnd. The ‘S’ bit selects instruction size. The ‘L’ bit selects the operand date size. The ‘E’ bit selects between a 32-bit and 64-bit result write. The ‘s’ bits select the source register. The ‘w’ bits select the base register. The ‘d’ bits select the destination register. The ‘p’ bits select the source addressing mode. Note:
| |||||||
I-Words: | 1 or 0.5 | |||||||
Cycles: | 1 |