Two 16-Bit Integer Subtractions on Upper and Lower Register Halves
SUB2
3-135
TMS320C62x/C67x Fixed-Point Instruction Set
Syntax
SUB2 (.unit)
src1, src2, dst
.unit = .S1 or .S2
Opcode map field used...
For operand type...
Unit
src1
src2
dst
sint
xsint
sint
.S1, .S2
Opcode
31
29 28 27
23 22
18 17
creg
z
dst
13 12
5
4
3
2
1
0
0 1 0 0 0 1
0
0
0
s
p
3
5
5
5
6
6
1
11
x
src1
src2
Description
The upper and lower halves of
src2 are subtracted from the upper and lower
halves of
src1. Any borrow from the lower-half subtraction does not affect the
upper-half subtraction.
Execution
if (cond)
{
((lsb16(
src1) – lsb16(src2)) and FFFFh) or
((msb16(
src1) – msb16(src2))
<<
16)
→
dst
}
else
nop
Pipeline
Stage
E1
Read
src1, src2
Written
dst
Unit in use
.S
Instruction Type
Single-cycle
Delay Slots
0
Example
SUB2 .S2X
B1,A0,B2
Before instruction
1 cycle after instruction
A0
0021 3271h
†
33 12913
‡
A0
0021 3271h
B1
003A 1B48h
†
58 6984
‡
B1
003A 1B48h
B2
XXXX XXXXh
B2
0019 E8D7h
25
†
–5929
‡
† Signed 16-MSB integer
‡ Signed 16-LSB integer
Pipeline