MicrOS
|
#include <stddef.h>
Go to the source code of this file.
Classes | |
struct | fcontrol_t |
Type represent state of floating point control word. More... | |
struct | fexcept_t |
Type represent state of floating point status word. More... | |
struct | ftag_word_t |
Tag words. More... | |
struct | fenv_t |
Type represent state of floating point environment. More... | |
Macros | |
#define | FE_INVALID 1 |
Invalid argument exception. More... | |
#define | FE_DENORMAL 2 |
Denormal operand exception. More... | |
#define | FE_DIVBYZERO 4 |
Pole error exception. More... | |
#define | FE_OVERFLOW 8 |
Overflow exception. More... | |
#define | FE_UNDERFLOW 16 |
Underflow exception. More... | |
#define | FE_INEXACT 32 |
Pole error exception. More... | |
#define | FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) |
All exceptions. More... | |
#define | FE_TONEAREST 0 |
Rounding to nearest. More... | |
#define | FE_DOWNWARD 1 |
Rounding downward. More... | |
#define | FE_UPWARD 2 |
Rounding upward. More... | |
#define | FE_TOWARDZERO 3 |
Rounding towards zero. More... | |
#define | FE_DFL_ENV (env) |
macro that provides access to pointer to environment. More... | |
#define | __FPU_TAG_WORD_VALID 0 |
Number value in tag word. More... | |
#define | __FPU_TAG_ZERO 1 |
Zero value in tag word. More... | |
#define | __FPU_TAG_SPECIAL 2 |
Sepcial value in tag word. More... | |
#define | __FPU_TAG_EMPTY 3 |
Empty value in tag word. More... | |
#define | __FPU_PRECISION_SINGLE 0 |
Single precision. (32 bit) More... | |
#define | __FPU_PRECISION_DOUBLE 1 |
Double precision. (53 bit) More... | |
#define | __FPU_PRECISION_EXTENDED 3 |
Extended precision. (64 bit) More... | |
#define | __FPU_ROUNDING_NEAREST_EVEN 0 |
Rounding to nearest. More... | |
#define | __FPU_ROUNDING_FLOOR 1 |
Rounding downward. More... | |
#define | __FPU_ROUNDING_CEIL 2 |
Rounding upward. More... | |
#define | __FPU_ROUNDING_TRUNCATE 3 |
Rounding towards zero. More... | |
#define | __FPU_INFINITY_CONTROL_PROJECTIVE 0 |
Projective infinity control. More... | |
#define | __FPU_INFINITY_CONTROL_AFFINE 1 |
Affine infinity control. More... | |
Functions | |
int | feclearexcept (int excepts) |
Clear FPU exception flags. More... | |
int | fegetexceptflag (fexcept_t *flagp, int excepts) |
Get exception flags. More... | |
int | feraiseexcept (int excepts) |
Raise FPU exception flags. More... | |
int | fesetexceptflag (const fexcept_t *flagp, int excepts) |
Set exception flags. More... | |
int | fetestexcept (int excepts) |
Test for floating-point exceptions. More... | |
int | fegetround (void) |
Get current rounding direction. More... | |
int | fesetround (int round) |
Set rounding direction. More... | |
int | fegetenv (fenv_t *envp) |
Get entire environment. More... | |
int | fesetenv (const fenv_t *envp) |
Set entire environment. More... | |
int | feholdexcept (fenv_t *envp) |
Hold floating-point exceptions. More... | |
int | feupdateenv (const fenv_t *envp) |
Update floating-point environment. More... | |
fcontrol_t | __FPU_read_control_word () |
Read FPU control word. More... | |
void | __FPU_write_control_word (fcontrol_t control_word) |
Write FPU control word. More... | |
fenv_t | __FPU_read_environment () |
Read FPU environment. More... | |
void | __FPU_write_environment (fenv_t environment) |
Write FPU environment. More... | |
fexcept_t | __FPU_read_status_word () |
Read FPU status word. More... | |
void | __FPU_clear_exceptions () |
Clear all FPU exceptions. More... | |
Variables | |
const fenv_t * | env |
Pointer to environment. More... | |
#define __FPU_INFINITY_CONTROL_AFFINE 1 |
Affine infinity control.
#define __FPU_INFINITY_CONTROL_PROJECTIVE 0 |
Projective infinity control.
#define __FPU_PRECISION_DOUBLE 1 |
Double precision. (53 bit)
#define __FPU_PRECISION_EXTENDED 3 |
Extended precision. (64 bit)
#define __FPU_PRECISION_SINGLE 0 |
Single precision. (32 bit)
#define __FPU_ROUNDING_CEIL 2 |
Rounding upward.
#define __FPU_ROUNDING_FLOOR 1 |
Rounding downward.
#define __FPU_ROUNDING_NEAREST_EVEN 0 |
Rounding to nearest.
#define __FPU_ROUNDING_TRUNCATE 3 |
Rounding towards zero.
#define __FPU_TAG_EMPTY 3 |
Empty value in tag word.
Set when given FPU register is empty.
#define __FPU_TAG_SPECIAL 2 |
Sepcial value in tag word.
Set when value at given FPU register is invalid (NaN, unsupported), infinity or denormal.
#define __FPU_TAG_WORD_VALID 0 |
Number value in tag word.
Set when value at given FPU register is valid number.
#define __FPU_TAG_ZERO 1 |
Zero value in tag word.
Set when value at given FPU register is zero.
#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) |
All exceptions.
#define FE_DENORMAL 2 |
Denormal operand exception.
#define FE_DFL_ENV (env) |
macro that provides access to pointer to environment.
Points to default environment. It's set during program startup.
#define FE_DIVBYZERO 4 |
Pole error exception.
#define FE_DOWNWARD 1 |
Rounding downward.
#define FE_INEXACT 32 |
Pole error exception.
#define FE_INVALID 1 |
Invalid argument exception.
#define FE_OVERFLOW 8 |
Overflow exception.
#define FE_TONEAREST 0 |
Rounding to nearest.
#define FE_TOWARDZERO 3 |
Rounding towards zero.
#define FE_UNDERFLOW 16 |
Underflow exception.
#define FE_UPWARD 2 |
Rounding upward.
void __FPU_clear_exceptions | ( | ) |
Clear all FPU exceptions.
fcontrol_t __FPU_read_control_word | ( | ) |
Read FPU control word.
fenv_t __FPU_read_environment | ( | ) |
Read FPU environment.
fexcept_t __FPU_read_status_word | ( | ) |
Read FPU status word.
void __FPU_write_control_word | ( | fcontrol_t | control_word | ) |
Write FPU control word.
It also clears FPU exception before write value.
control_word | Control word to write into FPU. |
void __FPU_write_environment | ( | fenv_t | environment | ) |
Write FPU environment.
environment | environment to write into FPU. |
int feclearexcept | ( | int | excepts | ) |
Clear FPU exception flags.
Function attempts to clear the supported floating-point exceptions represented by its argument.
excepts | Exception flags to clear. |
int fegetenv | ( | fenv_t * | envp | ) |
Get entire environment.
Function attempts to store the current floating-point environment in the object pointed to by envp/
envp | Pointer to struct where environment will be stored. |
int fegetexceptflag | ( | fexcept_t * | flagp, |
int | excepts | ||
) |
Get exception flags.
Function attempts to store an implementation-defined representation of the states of the floating-point status flags indicated by the argument excepts in the object pointed to by the argument flagp.
flagp | Pointer to structure where expection flags will be stored. |
excepts | Defines which excepts will be checked. |
int fegetround | ( | void | ) |
Get current rounding direction.
int feholdexcept | ( | fenv_t * | envp | ) |
Hold floating-point exceptions.
Function saves the current floating-point environment in the object pointed to by envp, clears the floating-point status flags, and then installs a non-stop (continue on floating-point exceptions) mode, if available, for all floating-point exceptions.
envp | Pointer to struct where environment will be saved. |
int feraiseexcept | ( | int | excepts | ) |
Raise FPU exception flags.
Function attempts to raise the supported floating-point exceptions represented by its argument.
excepts | Exception flags to raise. |
int fesetenv | ( | const fenv_t * | envp | ) |
Set entire environment.
The fesetenv function attempts to establish the floating-point environment represented by the object pointed to by envp. The argument envp shall point to an object set by a call to fegetenv or feholdexcept, or equal a floating-point environment macro. Note that fesetenv merely installs the state of the floating-point status flags represented through its argument, and does not raise these floating-point exceptions.
envp | Pointer to struct from where environment will read environment. |
int fesetexceptflag | ( | const fexcept_t * | flagp, |
int | excepts | ||
) |
Set exception flags.
Function attempts to set the floating-point status flags indicated by the argument excepts to the states stored in the object pointed to by flagp. The value of *flagp shall have been set by a previous call to fegetexceptflag whose second argument represented at least those floating-point exceptions represented by the argument excepts. This function does not raise floatingpoint exceptions, but only sets the state of the flags.
flagp | Pointer to structure from where we will read expection. |
excepts | Defines which excepts will be set. |
int fesetround | ( | int | round | ) |
Set rounding direction.
Function establishes the rounding direction represented by its argument round. If the argument is not equal to the value of a rounding direction macro, the rounding direction is not changed.
round | Rounding direction to set. |
int fetestexcept | ( | int | excepts | ) |
Test for floating-point exceptions.
Function determines which of a specified subset of the floatingpoint exception flags are currently set. The excepts argument specifies the floatingpoint status flags to be queried.
excepts | Exception flags to check. |
int feupdateenv | ( | const fenv_t * | envp | ) |
Update floating-point environment.
function attempts to save the currently raised floating-point exceptions in its automatic storage, install the floating-point environment represented by the object pointed to by envp, and then raise the saved floating-point exceptions. The argument envp shall point to an object set by a call to feholdexcept or fegetenv, or equal a floating-point environment macro.
envp | Pointer to struct from where environment will read environment. |
const fenv_t* env |
Pointer to environment.
Points to default environment. It's set during program startup.