8.2 Overview of SSE Floating-Point Exceptions
When an exceptional floating-point condition is detected during the
execution of an SSE instruction, one of the exception flags
MXCSR[5:0] may be set. If an exception flag is set and the corresponding
mask bit in MXCSR[12:7] is 0, then execution of the instruction is terminated,
no value is written to the destination, and an exception is generated.
Otherwise, depending on the exceptional condition, either a default value is
determined or execution proceeds.
The exceptional conditions are partitioned into two classes
and are detected during two distinct phases of execution.
The following two-step procedure is followed by both packed and scalar
SSE floating-point instructions. Note that in the case of a
packed instruction, the procedure is complicated by the requirement of
- Pre-Computation (Subsection 8.3): The operands of
each operation are examined in parallel for a set of conditions, some
of which result in the setting of a flag, IE, DE, or ZE.
If a flag is set and the corresponding mask is clear, then execution is terminated for all
operations and no value is written to the destination. Otherwise, for
each operation, either a QNaN is selected as a default value (but not yet written),
or the computation proceeds.
- Post-Computation (Subsection 8.4): Unless an unmasked
exception is detected during the pre-computation phase, for each
computation performed, the result is examined for a set of conditions,
which may result in the setting of one or two of the flags OE, UE, and PE.
If a flag is set and the corresponding mask
bit is clear, then an exception is
generated and no value is written to the destination. Otherwise, a
result is written for each operation, either the pre-computation
default or a value derived from the computation.
Pre- and post-computation SSE exceptions are discussed in detail in
the following two subsections.