Open as PDF
Subtract Two Signed Integers Without Saturation SUB
3-251 Instruction SetSPRU733
Opcode .D unit
31 292827 2322 1817 1312 76543210
creg z dst src2 src1 op 1 0 0 0 0 s p
3 1 5 5 5 6 1 1
Opcode map field used... For operand type... Unit Opfield
.D1, .D2 01 0001
.D1, .D2 01 0011
Description for .D1, .D2 Opcodes
src1 is subtracted from src2. The result is placed in dst.
Execution for .D1, .D2 Opcodes
src2 − src1
Subtraction with a signed constant on the .L and .S units allows either the first
or the second operand to be the signed 5-bit constant.
SUB (.unit) src1, scst5, dst is encoded as ADD (.unit) −scst5, src2, dst where
the src1 register is now src2 and scst5 is now −scst5.
However, the .D unit provides only the second operand as a constant since
it is an unsigned 5-bit constant. ucst5 allows a greater offset for addressing
with the .D unit.
Read src1, src2
Unit in use
.L, .S, or .D