An essential difference between x87 and SSE exceptions is that when an unmasked exceptional condition is detected during execution of an x87 instruction, the exception summary (ES) bit and busy bit (B) are set along with the indicated exception flag, but the exception itself is postponed until the next x87 instruction is encountered. That is, whenever an x87 instruction is initiated, other than the control instructions, the ES bit is examined and if set, execution is aborted and an exception is generated.
In the case of an unmasked pre-computation exception, execution is terminated and, as in the SSE case, no value is written to the destination. For an unmasked post-computation exception, however, execution proceeds and a value is written.
Another distinctive feature of the x87 architecture is the SF flag. The data stack is examined upon initiation of any instruction that requires access to the stack. When a stack fault is detected, SF is set along with IE. If IM = 0, then ES and B are set as well and execution is terminated; otherwise, the real indefinite QNaN is written to the destination. Thus, a stack fault may be viewed as a pre-computation exceptional condition with priority over all others. However, we shall view the stack access as well as the initial check of ES as extraneous to the execution of an instruction and exclude these features from our formal model.
Thus, we have the following two phases of execution:
David Russinoff 2017-08-01