9.5  x87 Post-Computation Exceptions

The procedure described in this section is formalized by the functions x87-binary-post-comp and x87-sqrt-post-comp. Each of these functions calls x87-round, which performs the rounding and detects exceptions.

In the absence of an unmasked exception, the post-computation behavior of the x87 instructions is the same as that of the corresponding SSE intructions with FTZ = 0, except that (a) results are rounded to the precision specified in the FCW and encoded in the double extended precision format, and (b) if a result if rounded away from 0 or replaced by an infinity, then the condition code C1 is set, and otherwise C1 is cleared.

Here we describe the response of an x87 instruction to an unmasked post-computation exceptional condition. We assume that the computation produces a finite non-zero value $ u$, which is rounded according to the rounding mode $ {\cal R}$ and the precision $ p$ indicated by the FCW, producing a value $ r = \mathit{rnd}(u, {\cal R}, p)$. If $ r$ lies outside the normal range, then the objective is to return a normal encoding of a shifted version $ r'$ of $ r$ from which $ r$ can be recovered:

David Russinoff 2017-08-01