10.3 ARM Post-Computation Exceptions

The floating-point post-computation behavior of the ARM architecture, as formalized by the functions
*arm-binary-post-comp*, *arm-sqrt-post-comp*,
and *arm-fma-post-comp*, is described below.
In addition to the absence of exception masks, there are several departures from SSE behavior in the detection and
handling of underflow.

If the computed value is infinite or 0, then no flags are set and the sign of the result is determined by the signs of the operands and the rounding mode FPSCR as described in Section 8.3.

Otherwise, the precise mathematical result of the operation is a finite non-zero value . This value is passed to
*arm-round*, which performs the rounding and detects exceptions as follows:

Unless is a denormal, it is rounded according to the rounding mode and the precision of the data format , producing a value . The returned value and the setting of exception flags are determined by the following case analysis. In all cases, the setting of a flag is understood to be contingent on the value of the corresponding trap enable bit, except in a certain case of underflow as noted below.

- Overflow ( is above the normal range of the target format, i.e.,
):
In all cases, OFC and IXC are set. The result depends on and the sign of .

If (a) , (b) and , or (c) and , then the final result is an infinity with the sign of .

Otherwise, the result is the encoding of the maximum normal value for the target format, , with the sign of .

- Underflow, which is detected before rounding ( is below the normal range, i.e.,
):
If FZ = 1 and is

*SP*or*DP*, then UFC is set. (IXC is not set.) UFE is ignored in this case, and FZ is ignored if is*HP*. The final result is a zero with the sign of .If FZ = 0 or is

*HP*, then is rounded to produce , which may be a denormal value, 0, or the smallest normal, . If , then both UFC and IXC are set; otherwise, neither flag is modified. The final result is the encoding of , with the sign of if . - Normal Case ( and are both within the normal range):
If , then IXC is set. The final result is the normal encoding of .

David Russinoff 2017-08-01