8.3  SSE Pre-Computation Exceptions

The procedure described in this section is formalized by the functions sse-binary-pre-comp, sse-sqrt-pre-comp, and sse-fma-pre-comp.

The first step in the execution of any SSE floating-point instruction, before any exception checking is performed, is to examine the DAZ bit of MXCSR. If this bit is set, then any denormal operand is replaced by a zero of the same sign.

The conditions that may cause an exception flag to be set, or the operation to be terminated with a QNaN value, or both, prior to an SSE computation are as follows:

Note that these conditions are prioritized in the order listed: if any condition holds for a given operation, then any other of lower priority is ignored for that operation. For a packed instruction, all operands are examined in parallel for pre-computation exception conditions. Consequently, it is possible for different flags to be set for different operations.

If any exception flag is set during this process and the corresponding mask bit is clear, then all operations are terminated before any computation is performed, no result is written to the destination, and an exception is generated.

If an operation of a packed instruction is terminated with a default value, the value is not written to the destination until execution of the instruction is completed, since no value is written in the event of an unmasked post-computation exception.

The setting of status flags and the default values are summarized in Table 8.2.


Table 8.2: SSE Pre-computation Exceptions
\begin{table}
\setlength{\unitlength}{2mm}
\begin{picture}(50, 23)(-8,0)
\put(0...
...NaN Result}}
\put(30,16){\makebox(22,3){(masked case)}}
\end{picture}\end{table}


David Russinoff 2017-08-01