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 floatingpoint
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 (see 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-significant
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.