7-43
FLOATING-POINT UNIT
7.5.13.Unsupported FPU Instructions
The Intel 8087 instructions FENI and FDISI and the Intel 287 math coprocessor instruction
FSETPM perform no function in the Intel 387 math coprocessor, or the Intel486, Pentium
®
,
or Pentium
®
Pro processors. If these opcodes are detected in the instruction stream, the FPU
performs no specific operation and no internal FPU states are affected.
7.6.OPERATING ON NANS
As was described in Section 7.2.3.4., NaNs, the FPU supports two types of NaNs: SNaNs and
QNaNs. An SNaN is any NaN value with its most-significant fraction bit set to 0 and at least
one other fraction bit set to 1. (If all the fraction bits are set to 0, the value is an
?
.) A QNaN is
any NaN value with the most-significant fraction bit set to 1. The sign bit of a NaN is not inter-
preted.
As a general rule, when a QNaN is used in one or more arithmetic floating-point instructions, it
is allowed to propagate through a computation. An SNaN on the other hand causes a floating-
point invalid operation exception to be signaled. SNaNs are typically used to trap or invoke an
exception handler. They must be inserted by software; that is, the FPU never generates an SNaN
as a result.
The floating-point invalid operation exception has a flag and a mask bit associated with it in the
FPU status and control registers, respectively (refer to Section 7.7., Floating-Point Exception
Handling). The mask bit determines how the FPU handles an SNaN value. If the floating-point
invalid operation mask bit is set, the SNaN is converted to a QNaN by setting the most-signifi-
cant fraction bit of the value to 1. The result is then stored in the destination operand and the
floating-point invalid operation flag is set. If the invalid operation mask is clear, a floating-point
invalid operation fault is signaled and no result is stored in the destination operand.
When a real operation or exception delivers a QNaN result, the value of the result depends on
the source operands, as shown in Table 7-18.
Except for the rules given at the beginning of this section for encoding SNaNs and QNaNs, soft-
ware is free to use the bits in the significand of a NaN for any purpose. Both SNaNs and QNaNs
can be encoded to carry and store data, such as diagnostic information.