TriCore
®
TC1.6P & TC1.6E
32-bit Unified Processor Core
Instruction Set
V1.0 2013-07
User Manual (Volume 2) 3-386
UNPACK
Unpack Floating Point
Description
Take an IEEE-754-1985 single precision floating point number in data register D[a] and unpack it as exponent and
mantissa into data register pair E[c], such that it can be more easily processed through regular instructions.
The odd register E[c][63:32] receives the unbiased exponent. The even register E[c][31:0] receives the mantissa.
Note that the sign-bit of the floating point number is available in bit 31 of data register D[a].
To compute the mantissa and the exponent, the input number is first checked for special cases: Infinity, NAN, Zero
& Denormalised. If the input number is not one of these special cases it is a normalised number. Bits [22:0] of D[a]
are then copied to bits [29:7] of E[c], with bits [6:0] of E[c] cleared to 0. Bit 30 is set to one, as the implicit high order
bit for a normalized mantissa. Bit 31 becomes zero, since the unpacked mantissa is always positive. The bias is
removed from the exponent, by subtracting 127, and the result placed in bits [63:32] of E[c].
Note:For both normalised and denormalised input numbers the output mantissa is in a fractional 2.30 format.
The special cases are handled as shown in the operation, described below.
UNPACKE[c], D[a] (RR)
fp_exp[7:0] = D[a][30:23];
fp_frac[22:0] = D[a][22:0];
if (fp_exp == 255) then {
// Infinity or NaN
int_exp = +255;
int_mant = {2'b00, fp_frac[22:0], 7'b0000000};
} else if ((fp_exp == 0) AND (fp_frac == 0)) then {
// Zero
int_exp = -127;
int_mant = 0;
} else if ((fp_exp == 0) AND (fp_frac != 0)) then {
// Denormalised
int_exp = -126;
int_mant = {2'b00, fp_frac[22:0], 7'b0000000};
} else {
// Normalized
int_exp = fp_exp - 127;
int_mant = {2'b01, fp_frac[22:0], 7'b0000000};
}
E[c][63:32] = int_exp;
E[c][31:0] = int_mant;
31
c
28 27
08
H
20 19
-
18 17
0
H
16 15
-
12 11
a
8 7
4B
H
0