6.1.7 Inexact Result
The FPCP provides two inexact bits (INEX1 and INEX2) to help distinguish between inexact
results generated by decimal input (INEX1) and other inexact results (INEX2). Two inexact
bits are useful in instructions in which both types of inexacts can occur, such as:
FDIV.P #7E - 1,FP3
In this case, the packed decimal to extended precision conversion of the immediate source
operand causes an inexact error to occur which is signaled as INEXI. Furthermore, the
subsequent divide might also produce an inexact result and cause INEX2 to be set. There-
fore, the FPCP provides two inexact bits in the FPSR exception status byte to distinguish
these two cases.
Note that only one inexact exception vector number is generated by the FPCP. If either of
the two inexact exceptions is enabled, the MPU fetches the inexact exception vector, and
the exception handler routine is initiated. Refer to 6.1.8 Inexact Result on Decimal Input
for a discussion of INEXI.
In a general sense, INEX2 is the condition that exists when any operation, except the input
of a packed decimal number, creates a floating-point intermediate result whose infinitely
precise mantissa has too many significant bits to be represented exactly in the selected
rounding precision (refer to 2.2.2 FPCR Mode Control Byte) or in the destination data format.
If this condition occurs, the INEX2 bit is set in the FPSR exception status byte, and the
infinitely precise result is rounded as described in the next paragraph.
The FPCP supports the four rounding modes specified by the IEEE standard. These modes
are round to nearest (RN), round toward zero (RZ), round toward plus infinity (RP), and
round toward minus infinity (RM). The rounding definitions are:
Rounding
Mode Result
RN The representable value nearest to the infinitely precise intermediate
value is the result. If the two nearest representable values are equally
near (a tie), then the one with the least significant bit equal to zero (even)
is the result. This is sometimes referred to as "round nearest, even".
RZ The result is the value closest to, and no greater in magnitude than, the
infinitely precise intermediate result. This is sometimes referred to as
the "chop mode", since the effect is to clear the bits to the right of the
rounding point.
RM The result is the value closest to and no greater than the infinitely precise
intermediate result (possibly minus infinity).
RP The result is the value closest to and no less than the infinitely precise
intermediate result (possibly plus infinity).
The RM and RP rounding modes are often referred to as "directed rounding modes" and
are useful in interval arithmetic. Rounding is accomplished using the intermediate result
format shown in Figure 6-2.
Depending on the selected rounding precision or destination data format in effect, the
location of the least significant bit of the fraction and the locations of the guard, round,
and sticky bits in the 67-bit intermediate result mantissa varies.
MC68881/MC68882 USER'S MANUAL FREESCALE
6-15