
4-12
ColdFire CF4e Core User’s Manual
For More Information On This Product,
Go to: www.freescale.com
FPU Programmer’s Model
complement, integer exponent. Detection of an intermediate result overflow or underflow
always converts the 12-bit exponent into a 11-bit biased exponent before being stored in a
floating-point data register. The FPU internally maintains a 56-bit mantissa for rounding
purposes. The mantissa is always rounded to 53 bits (or fewer, depending on the selected
rounding precision) before it is stored in a floating-point data register.
Figure 4-11. Intermediate Result Format
If the destination is a floating-point data register, the result is in double-precision format
but may be rounded to single-precision, if required by the rounding precision, before
being stored. If the single-precision mode is selected, the exponent value is in the correct
range even if it is stored in double-precision format. If the destination is a memory
location or an integer data register, rounding precision is ignored. In this case, a number in
the double-precision format is taken from the source floating-point data register, rounded
to the destination format precision, and then written to memory or the integer data register.
Depending on the selected rounding mode or destination data format, the location of the
lsb of the mantissa and the locations of the guard, round, and sticky bits in the 56-bit
intermediate result mantissa vary. Guard and round bits are calculated exactly. The sticky
bit creates the illusion of an infinitely wide intermediate result. As the arrow in
Figure 4-11 shows, the sticky bit is the logical OR of all bits to the right of the round bit in
the infinitely precise result. During calculation, nonzero bits generated to the right of the
round bit set the sticky bit. Because of the sticky bit, the rounded intermediate result for all
required IEEE arithmetic operations in RN mode can err by no more than one half unit in
the last place.
4.3.4.2 Rounding the Result
The FPU supports the four rounding modes specified by the IEEE-754 standard:
round-to-nearest (RN), round-toward-zero (RZ), round-toward-plus-infinity (RP), and
round-toward-minus-infinity (RM). The RM and RP modes are often referred to as
directed-rounding-modes and are useful in interval arithmetic. Rounding is accomplished
through the intermediate result. Single-precision results are rounded to a 24-bit mantissa
boundary; double-precision results are rounded to a 53-bit mantissa boundary.
The current floating-point instruction can specify rounding precision, overriding the
rounding precision specified in FPCR for the duration of the current instruction. For
52-Bit Fraction
Integer
lsb
Guard
Round
Sticky
12-Bit Exponent
56-Bit Intermediate Mantissa
F
Freescale Semiconductor, Inc.
n
.