Datasheet

Floating-point Support
5-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
5.3 Controlling the floating-point environment
This section describes the functions you can use to control the ARM floating-point
environment. With these functions, you can change the rounding mode, enable and
disable trapping of exceptions, and install your own custom exception trap handlers.
ARM supplies several different interfaces to the floating-point environment, for
compatibility and porting ease.
5.3.1 The __ieee_status function
ARM supports a second interface to the status word, similar to the
__fp_status
function,
but the second interface sees the same status word in a different layout. This call is
called
__ieee_status
, and it is generally the most efficient function to use for modifying
the status word for VFP. (
__fp_status
is more efficient on FPA systems.)
__ieee_status
is defined in
fenv.h
.
Like
__fp_status
,
__ieee_status
has the prototype:
unsigned int __ieee_status(unsigned int mask,
unsigned int flags);
However, the layout of the status word as seen by
__ieee_status
is different from that
seen by
__fp_status
(Figure 5-1).
Figure 5-1 IEEE status word layout
The fields in Figure 5-1 are as follows:
Bits 0 to 4 are the sticky flags, exactly as described in The __fp_status function
on page 5-10.
Bits 8 to 12 are the exception mask bits, exactly as described in The __fp_status
function on page 5-10, but in a different place.
Bits 16 to 18, and bits 20 and 21, are used by VFP hardware to control the VFP
vector capability. The
__ieee_status
call does not let you modify these bits.
031 24 23 21 20 16 15 13 12 8 7 5 4
Sticky
25 22 19 18
FZ RM Masks
R RRR VFPVFP