Datasheet
Floating-point Support
5-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
To untrap the Inexact Result exception:
__ieee_status(FE_IEEE_MASK_INEXACT, 0);
To clear the Underflow sticky flag:
__ieee_status(FE_IEEE_UNDERFLOW, 0);
5.3.2 The __fp_status function
Previous versions of the ARM libraries implemented a function called
__fp_status
, that
manipulated a status word in the floating-point environment. ARM still supports this
function, for backwards compatibility. It is defined in
stdlib.h
.
__fp_status
has the following prototype:
unsigned int __fp_status(unsigned int mask, unsigned int flags);
The function modifies the writable parts of the status word according to the parameters,
and returns the previous value of the whole word.
The writable bits are modified by setting them to
new = (old & ~mask) ^ flags;
Four different operations can be performed on each bit of the status word, depending on
the corresponding bits in mask and flags (Table 5-6).
The layout of the status word as seen by
__fp_status
is shown in Figure 5-2.
Figure 5-2 Floating-point status word layout
Table 5-6 Status word bit modification
Bit of mask Bit of flags Effect
0 0 Leave alone
01Toggle
1 0 Set to 0
1 1 Set to 1
031 24 23 21 20 16 15 13 12 8 7 5 4
System ID Masks Sticky
FPA onlyR R R