SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
There can be two codes for arithmetic and logical functions in each instruction. Each of the operations can involve one or two operands.
The location of each function field in an instruction is listed in Table 26-1073.
Bits | Description |
---|---|
23:20 | Single or Dual operand Arithmetic/Logic Function (function 0) |
19:16 | Single or Dual operand Arithmetic/Logic Function (function 1) |
The bit codes for each arithmetic/logic function that can be performed on the operands of an instruction are listed in Table 26-1074.
Code | Description | Operands Required | 32-bit result | 1-bit flag result |
---|---|---|---|---|
0x0 | Less Than | 2 | 0 | Set if true |
0x1 | Less Than Equal To | 2 | 0 | Set if true |
0x2 | Greater Than | 2 | 0 | Set if true |
0x3 | Greater Than Equal To | 2 | 0 | Set if true |
0x4 | Equal to Zero | 1 | 0 | Set if true |
0x5 | Not Equal to Zero | 1 | 0 | Set if true |
0x6 | Equal to One | 1 | 0 | Set if true |
0x7 | Not Equal to One | 1 | 0 | Set if true |
0x8 | Equal | 2 | 0 | Set if true |
0x9 | Not Equal | 2 | 0 | Set if true |
0xA | Add | 2 | Sum | Set if overflow |
0xB | Subtract | 2 | Difference | Set if output is negative |
0xC | Bitwise AND | 2 | Bitwise AND | 0 |
0xD | Bitwise OR | 2 | Bitwise OR | 0 |
0xE | Result is same as Operand | 1 | Same as operand | 0 |
0xF | No Function (NOF) | 0 | 0 | 0 |
The ALU0 and ALU1 are assigned function0 and function1 respectively. In case only one function is to be performed in an instruction, function0 field should be used to do that. An instruction with no function for ALU0 and a valid function for ALU1 will result in unspecified behavior.
The output of each function is in the form of a 32-bit number and a single bit value. The single bit value is either the carry bit from an add/subtract operation or the Boolean result from a comparison function. The single bit output from each function is referred as the flag0 or flag1 result. The 32-bit number is the outcome of arithmetic or a bitwise logical operation and it is referred to as the word0 or word1 result.