Format |
Syntax: |
Operation: |
Operands: |
Architecture revision |
Opcode | ||||||||||||
1 |
cp.w Rd, Rs |
Rd - Rs; |
{d, s} ∈ {0, 1, …, 15} |
Rev1+ |
| ||||||||||||
2 |
cp.w Rd, imm |
Rd - SE(imm6); |
d ∈ {0, 1, …, 15} imm ∈ {-32, -31, ..., 31} |
Rev1+ |
| ||||||||||||
3 |
cp.w Rd, imm |
Rd - SE(imm21); |
d ∈ {0, 1, …, 15} imm ∈ {-1048576, -104875, ..., 1048575} |
Rev1+ |
|
Performs a compare between the two operands specified. The operation is implemented by doing a subtraction without writeback of the difference. The operation sets the status flags according to the result of the subtraction, but does not affect the operand registers.
Format I: OP1 = Rd, OP2 = Rs |
|
Format II: OP1 = Rd, OP2 = SE(imm6) |
|
Format III:OP1 = Rd, OP2 = SE(imm21) |
|
Q: |
Not affected |
V: |
V = (OP1[31] AND ~OP2[31] AND ~RES[31]) OR (~OP1[31] AND OP2[31] AND RES[31]) |
N: |
N = RES[31] |
Z: |
Z = (RES[31:0] == 0) |
C: |
C = ~OP1[31] AND OP2[31] OR OP2[31] AND RES[31] OR ~OP1[31] AND RES[31] |