Datasheet

Floating-point Support
5-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
__fp_status(_fpsr_IXE | _fpsr_UFE | _fpsr_OFE |
_fpsr_DZE | _fpsr_IOE, _fpsr_IOE);
To untrap the Inexact Result exception:
__fp_status(_fpsr_IXE, 0);
To clear the Underflow sticky flag:
__fp_status(_fpsr_UFC, 0);
5.3.3 Microsoft compatibility functions
The following three functions are implemented for compatibility with Microsoft
products, to ease porting of floating-point code to the ARM architecture. They are
defined in
float.h
.
The _controlfp function
The function
_controlfp
allows you to control exception traps and rounding modes:
unsigned int _controlfp(unsigned int new, unsigned int mask);
This function also modifies a control word using a mask to isolate the bits to modify.
For every bit of
mask
that is zero, the corresponding control word bit is unchanged. For
every bit of
mask
that is nonzero, the corresponding control word bit is set to the value
of the corresponding bit of
new
. The return value is the previous state of the control
word.
Note
This is not quite the same as the behavior of
__fp_status
and
__ieee_status
, where you
can toggle a bit by setting a zero in the mask word and a one in the flags word.
The macros you can use to form the arguments to
_controlfp
are given in Table 5-7.
Table 5-7 _controlfp argument macros
Macro Description
_MCW_EM
Mask containing all exception bits
_EM_INVALID
Bit describing the Invalid Operation exception
_EM_ZERODIVIDE
Bit describing the Divide by Zero exception
_EM_OVERFLOW
Bit describing the Overflow exception