Datasheet

Floating-point Support
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-19
The flags contained in
edata
are:
edata & FE_EX_RDIR
is nonzero if the intermediate result in Underflow was
rounded down, and 0 if it was rounded up or not rounded. (The difference between
the last two is given in the Inexact Result bit.) This bit is meaningless for any other
type of exception.
edata & FE_EX_exception
is nonzero if the given
exception
(
INVALID
,
DIVBYZERO
,
OVERFLOW
,
UNDERFLOW
or
INEXACT
) occurred. This enables you to:
use the same handler function for more than one exception type (the
function can test these bits to tell what exception it is supposed to handle)
determine whether Overflow and Underflow intermediate results have been
rounded or are exact.
Because the
FE_EX_INEXACT
bit can be set in combination with either
FE_EX_OVERFLOW
or
FE_EX_UNDERFLOW
, you must determine the type of exception that
actually occurred by testing Overflow and Underflow before testing Inexact.
edata & FE_EX_FLUSHZERO
is nonzero if the
FZ
bit was set when the operation was
performed (see The __ieee_status function on page 5-8).
edata & FE_EX_ROUND_MASK
gives the rounding mode that applies to the operation.
This is normally the same as the current rounding mode, unless the operation that
caused the exception was a routine such as
_ffix
, that always rounds toward zero.
The available rounding mode values are
FE_EX_ROUND_NEAREST
,
FE_EX_ROUND_PLUSINF
,
FE_EX_ROUND_MINUSINF
and
FE_EX_ROUND_ZERO
.
edata & FE_EX_INTYPE_MASK
gives the type of the operands to the function, as one
of the type values shown in Table 5-8.
Table 5-8 FE_EX_INTYPE_MASK operand type flags
Flag Operand type
FE_EX_INTYPE_FLOAT float
FE_EX_INTYPE_DOUBLE double
FE_EX_INTYPE_INT int
FE_EX_INTYPE_UINT unsigned int
FE_EX_INTYPE_LONGLONG long long
FE_EX_INTYPE_ULONGLONG unsigned long long