TriCore
®
TC1.6P & TC1.6E
32-bit Unified Processor Core
Instruction Set
V1.0 2013-07
User Manual (Volume 2) 3-92
DVSTEP
Divide-Step
DVSTEP.U
Divide-Step Unsigned
Description
The DVSTEP(.U) instruction divides the contents of the formatted data register E[d] by the divisor in D[b],
producing 8-bits of quotient at a time. E[d] contains a partially calculated remainder and partially calculated
quotient (in ones complement format) in bit fields that depend on the number of DVSTEP instructions required to
produce a final result (see DVSTEP).
DVSTEP uses a modified restoring division algorithm to calculate 8-bits of the final remainder and quotient results.
The size of the bit fields of the output register E[c] depend on the size of the bit fields in the input register E[d].
Resultant bit field sizes of E[c]:
• If E[d][63:0] = partially calculated remainder then E[c][63:8] = partially calculated remainder and E[c][7:0] =
partially calculated quotient.
• If E[d][63:8] = partially calculated remainder then E[c][63:16] = partially calculated remainder and E[c][15:0] =
partially calculated quotient.
• If E[d][63:16] = partially calculated remainder then E[c][63:24] = partially calculated remainder and E[c][23:0]
= partially calculated quotient.
• If E[d][63:24] = partially calculated remainder then E[c][63:32] = final remainder and E[c][31:0] = final quotient.
The DVSTEP and DVSTEP.U operate on signed and unsigned operands respectively. A DVSTEP instruction that
yields the final remainder and final quotient should be followed by a DVADJ instruction (see DVADJ).
DVSTEPE[c], E[d], D[b] (RRR)
dividend_sign = E[d][63];
divisor_sign = D[b][31];
quotient_sign = dividend_sign != divisor_sign;
addend = quotient_sign ? D[b] : 0 - D[b];
dividend_quotient = E[d][31:0];
remainder = E[d][63:32];
for i = 0 to 7 {
remainder = (remainder << 1) | dividend_quotient[31];
dividend_quotient <<= 1;
temp = remainder + addend;
remainder = ((temp < 0) == dividend_sign) ? temp :: remainder;
dividend_quotient = dividend_quotient | (((temp < 0) == dividend_sign) ? !quotient_sign : quotient_sign);
}
E[c] = {remainder[31:0], dividend_quotient[31:0]};
DVSTEP.UE[c], E[d], D[b] (RRR)
31
c
28 27
d
24 23
0F
H
20 19
-
18 17
0
H
16 15
b
12 11
-
8 7
6B
H
0