Main Page | Alphabetical List | Class List | File List | Class Members | File Members

fenv.h File Reference

access to the floating-point environment More...

#include <nlibc.h>

Include dependency graph for fenv.h:

Include dependency graph

Go to the source code of this file.

Classes

struct  fenv_t

Defines

#define FE_AU_BAD_OP_H   0x00001
#define FE_AU_BAD_OP_L   0x00002
#define FE_AU_DEN_IN_H   0x00004
#define FE_AU_DEN_IN_L   0x00008
#define FE_AU_DEN_OUT_H   0x00010
#define FE_AU_DEN_OUT_L   0x00020
#define FE_AU_OVERFLOW_H   0x00040
#define FE_AU_OVERFLOW_L   0x00080
#define FE_LUT_BAD_OP_H   0x00100
#define FE_LUT_BAD_OP_L   0x00200
#define FE_LUT_DEN_IN_H   0x00400
#define FE_LUT_DEN_IN_L   0x00800
#define FE_LUT_DEN_OUT_H   0x01000
#define FE_LUT_DEN_OUT_L   0x02000
#define FE_LUT_OVFLW_H   0x04000
#define FE_LUT_OVFLW_L   0x08000
#define FE_AGU_MULT_OVF   0x10000
#define FE_AGU_ADD_OVF   0x20000
#define FE_AGU_ILLEGAL_INSTRUCTION   0x40000
#define FE_ALL_EXCEPT

Typedefs

typedef int fexcept_t
typedef int fmask_t

Functions

int feclearexcept (int excepts)
int fegetexceptflag (fexcept_t *flagp, int excepts)
int feraiseexcept (int excepts)
int fesetexceptflag (const fexcept_t *flagp, int excepts)
int fetestexcept (int excepts)
int fegetenv (fenv_t *envp)
int feholdexcept (fenv_t *envp)
int fesetenv (const fenv_t *envp)
int feupdateenv (const fenv_t *envp)
int feclearmask (int mask)
int fegetmaskflag (fmask_t *flagp, int mask)
int feraisemask (int mask)
int fesetmaskflag (const fmask_t *flagp, int mask)
int fetestmask (int mask)


Detailed Description

access to the floating-point environment

NAME
fenv - C99 floating point exception handling
NOTE
The implementation is very specific for apeNEXT.
Not all Exceptions of the ISO norm can be implemented for apeNEXT.
fegetround and fesetround is not implemented as the rounding mode cannot
be changed on apeNEXT.

IMPLEMENTATION for APEnext: done, needs to be tested (fenv.h) [completed yes]

VERSION

Id
fenv.h,v 1.24 2005/06/08 14:06:53 pleiter Exp


ISO/IEC 9899:1999/Cor.1:2001(E) Standard

Author:
Olaf Kaczmarek (okacz@physik.uni-bielefeld.de)


Definition in file fenv.h.


Define Documentation

#define FE_AGU_ADD_OVF   0x20000
 

Definition at line 51 of file fenv.h.

#define FE_AGU_ILLEGAL_INSTRUCTION   0x40000
 

Definition at line 52 of file fenv.h.

#define FE_AGU_MULT_OVF   0x10000
 

Definition at line 50 of file fenv.h.

#define FE_ALL_EXCEPT
 

Value:

Definition at line 54 of file fenv.h.

Referenced by fegetenv(), and feholdexcept().

#define FE_AU_BAD_OP_H   0x00001
 

Definition at line 34 of file fenv.h.

#define FE_AU_BAD_OP_L   0x00002
 

Definition at line 35 of file fenv.h.

#define FE_AU_DEN_IN_H   0x00004
 

Definition at line 36 of file fenv.h.

#define FE_AU_DEN_IN_L   0x00008
 

Definition at line 37 of file fenv.h.

#define FE_AU_DEN_OUT_H   0x00010
 

Definition at line 38 of file fenv.h.

#define FE_AU_DEN_OUT_L   0x00020
 

Definition at line 39 of file fenv.h.

#define FE_AU_OVERFLOW_H   0x00040
 

Definition at line 40 of file fenv.h.

#define FE_AU_OVERFLOW_L   0x00080
 

Definition at line 41 of file fenv.h.

#define FE_LUT_BAD_OP_H   0x00100
 

Definition at line 42 of file fenv.h.

#define FE_LUT_BAD_OP_L   0x00200
 

Definition at line 43 of file fenv.h.

#define FE_LUT_DEN_IN_H   0x00400
 

Definition at line 44 of file fenv.h.

#define FE_LUT_DEN_IN_L   0x00800
 

Definition at line 45 of file fenv.h.

#define FE_LUT_DEN_OUT_H   0x01000
 

Definition at line 46 of file fenv.h.

#define FE_LUT_DEN_OUT_L   0x02000
 

Definition at line 47 of file fenv.h.

#define FE_LUT_OVFLW_H   0x04000
 

Definition at line 48 of file fenv.h.

#define FE_LUT_OVFLW_L   0x08000
 

Definition at line 49 of file fenv.h.


Typedef Documentation

typedef int fexcept_t
 

Definition at line 81 of file fenv.h.

typedef int fmask_t
 

Definition at line 82 of file fenv.h.


Function Documentation

int feclearexcept int  excepts  ) 
 

NAME
feclearexcept() - clear floating-point exception
SYNOPSIS
#include <fenv.h>

int feclearexcept(int excepts)
DESCRIPTION
The feclearexcept() function clears the exception represented by
its argument (int except).
RETURN VALUE
Zero if excepts argument is zero or if all the specified flags
were successfully set to the appropriate state.
Otherwise, it returns a nonzero value.
IMPLEMENTATION for APEnext: done, needs to be tested (feclearexcept)

Definition at line 131 of file fenv.h.

int feclearmask int  mask  ) 
 

NAME
feclearmask() - clear floating-point mask
SYNOPSIS
#include <fenv.h>

int feclearmask(int mask)
DESCRIPTION
The feclearmask() function clears the exception mask represented by
its argument (int mask):
RETURN VALUE
Zero if excepts argument is zero or if all the specified flags
were successfully set to the appropriate state.
Otherwise, it returns a nonzero value.
IMPLEMENTATION for APEnext: done, needs to be tested (feclearmask)

Definition at line 471 of file fenv.h.

int fegetenv fenv_t envp  ) 
 

NAME
fegetenv() - get floating-point environment
SYNOPSIS
#include <fenv.h>

int fegetenv(fenv_t *envp)
DESCRIPTION
The fegetenv() function stores the current floating-point environment
(rounding mode, precision mode, and exceptions) in the object pointed
to by the argument envp.
RETURN VALUE
Zero if the environment was successfully stored.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (fegetenv)

Definition at line 313 of file fenv.h.

References fenv_t::__exc_reg, fenv_t::__msk_reg, FE_ALL_EXCEPT, fetestexcept(), and fetestmask().

Referenced by feholdexcept().

int fegetexceptflag fexcept_t flagp,
int  excepts
 

NAME
fegetexceptflag() - get floating-point exception flag
SYNOPSIS
#include <fenv.h>

int fegetexceptflag(fexcept_t *flagp, int excepts)
DESCRIPTION
The fegetexceptflag() function stores the exception flag indicated by
the argument excepts in the object pointed to by the argument flagp.
RETURN VALUE
Zero if the representation was successfully stored.
Otherwise, it returns a nonzero value.
IMPLEMENTATION for APEnext: done, needs to be tested (fegetexceptflag)

Definition at line 165 of file fenv.h.

int fegetmaskflag fmask_t flagp,
int  mask
 

NAME
fegetmaskflag() - get floating-point mask flag
SYNOPSIS
#include <fenv.h>

int fegetmaskflag(fmask_t *flagp, int mask)
DESCRIPTION
The fegetmaskflag() function stores the mask flag indicated by
the argument mask in the object pointed to by the argument flagp.
RETURN VALUE
Zero if the representation was successfully stored.
Otherwise, it returns a nonzero value.
IMPLEMENTATION for APEnext: done, needs to be tested (fegetmaskflag)

Definition at line 505 of file fenv.h.

int feholdexcept fenv_t envp  ) 
 

NAME
feholdexcept() - save current floating-point environment
SYNOPSIS
#include <fenv.h>

int feholdexcept(fenv_t *envp)
DESCRIPTION
The feholdexcept() function saves the current floating-point
environment (rounding mode, precision mode, and exceptions)
in the object pointed to by the argument envp. It clears the
exception flags, and disables all traps.
RETURN VALUE
The feholdexcept() function returns a zero value, indicating
the successful disabling of any traps
NOTES
Use feholdexcept() with feupdateenv() to hide spurious exceptions.
Use it with fesetenv() to hide all exceptions
IMPLEMENTATION for APEnext: done, needs to be tested (feholdexcept)

Definition at line 350 of file fenv.h.

References fenv_t::__exc_reg, FE_ALL_EXCEPT, fegetenv(), and fesetenv().

int feraiseexcept int  excepts  ) 
 

NAME
feraiseexcept() - raise floating-point exceptions

SYNOPSIS
#include <fenv.h>

int feraiseexcept(int excepts)
DESCRIPTION
The feraiseexcept() function raises the supported floating-point exceptions
represented by the argument (excepts).
RETURN VALUE
Zero if excepts argument is zero or if all the specified exceptions
were successfully raised.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (feraiseexcept)

Definition at line 199 of file fenv.h.

Referenced by feupdateenv().

int feraisemask int  mask  ) 
 

NAME
feraisemask() - raise floating-point mask
SYNOPSIS
#include <fenv.h>

int feraisemask(int mask)
DESCRIPTION
The feraisemask() function raises the supported floating-point mask
represented by the argument (mask).
RETURN VALUE
Zero if mask argument is zero or if all the specified mask
were successfully raised.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (feraisemask)

Definition at line 538 of file fenv.h.

Referenced by feupdateenv().

int fesetenv const fenv_t envp  ) 
 

NAME
fesetenv() - set floating-point environment
SYNOPSIS
#include <fenv.h>

int fesetenv(const fenv_t *envp)
DESCRIPTION
The fesetenv() function sets/establishes the floating-point environment
(rounding mode, precision mode, and exceptions) represented by the
object pointed to by envp. The argument envp must point to an object
set by a call to fegetenv() or feholdexcept().
RETURN VALUE
Zero if the environment was successfully established.
Otherwise, it returns a nonzero value.
NOTES
Note that fesetenv() merely installs the state of the exception flags
represented through its argument, and does not raise these exceptions.
IMPLEMENTATION for APEnext: done, needs to be tested (fesetenv)

Definition at line 391 of file fenv.h.

References fenv_t::__exc_reg, and fenv_t::__msk_reg.

Referenced by feholdexcept().

int fesetexceptflag const fexcept_t flagp,
int  excepts
 

NAME
fesetexceptflag() - set floating-point exception flags

SYNOPSIS
#include <fenv.h>

int fesetexceptflag(const fexcept_t *flagp, int excepts)
DESCRIPTION
The fesetexceptflag() function sets the status for the exception flags
indicated by the argument excepts according to the representation in
the object pointed to by flagp. The value of *flagp must have been
set by a previous call to fegetexceptflag(); otherwise, the effect on
the indicated exception flags is undefined. This function does not
raise exceptions, but only sets the state of the flags.
RETURN VALUE
Zero if the excepts argument is zero or if all specified flags were
successfully set to the appropriate state.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (fesetexceptflag)

Definition at line 240 of file fenv.h.

int fesetmaskflag const fmask_t flagp,
int  mask
 

NAME
fesetmaskflag() - set floating-point mask flags
SYNOPSIS
#include <fenv.h>

int fesetmaskflag(const fmask_t *flagp, int mask)
DESCRIPTION
The fesetmaskflag() function sets the status for the mask flags
indicated by the argument mask according to the representation in
the object pointed to by flagp. The value of *flagp must have been
set by a previous call to fegetmaskflag(); otherwise, the effect on
the indicated mask flags is undefined. This function does not
raise mask, but only sets the state of the flags.
RETURN VALUE
Zero if the mask argument is zero or if all specified flags were
successfully set to the appropriate state.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (fesetmaskflag)

Definition at line 578 of file fenv.h.

int fetestexcept int  excepts  ) 
 

NAME
fetestexcept() - test floating-point exceptions
SYNOPSIS
#include <fenv.h>

int fetestexcept(int excepts)
DESCRIPTION
The fetestexcept() function tests/determines which of a specified subset of
the exception are currently set. The excepts argument specifies
the exception to be queried.
RETURN VALUE
The fetestexcept() function returns the bitwise AND of the exception
macros corresponding to the currently set exceptions included in
excepts.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (fetestexcept)

Definition at line 278 of file fenv.h.

Referenced by fegetenv().

int fetestmask int  mask  ) 
 

NAME
fetestmask() - test floating-point mask
SYNOPSIS
#include <fenv.h>

int fetestmask(int mask)
DESCRIPTION
The fetestmask() function tests/determines which of a specified subset of
the mask are currently set. The mask argument specifies
the mask to be queried.
RETURN VALUE
The fetestmask() function returns the bitwise AND of the mask
macros corresponding to the currently set mask included in mask.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (fetestmask)

Definition at line 615 of file fenv.h.

Referenced by fegetenv().

int feupdateenv const fenv_t envp  ) 
 

NAME
feupdateenv() - update floating-point environment
SYNOPSIS
#include <fenv.h>

int feupdateenv(const fenv_t *envp)
DESCRIPTION
The feupdateenv function installs the floating-point environment represented
by the object *envp, except that currently raised exceptions are not cleared.
After calling this function, the raised exceptions will be a bitwise OR
of those previously set with those in *envp. As before, the object *envp
must be known to be valid.
RETURN VALUE
Zero if all the actions were successfully carried out.
Otherwise, it returns a nonzero value.
NOTES
IMPLEMENTATION for APEnext: done, needs to be tested (feupdateenv)

Definition at line 427 of file fenv.h.

References fenv_t::__exc_reg, fenv_t::__msk_reg, feraiseexcept(), and feraisemask().


Generated on Mon Feb 20 15:54:25 2006 for nlibc by doxygen 1.3.5