diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-11-18 16:31:14 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-11-18 16:31:14 -0500 |
commit | 75c450cff34b5206aca6aab14b7ad909168b8f50 (patch) | |
tree | 10d0a696a03195f52b7b22e190cf6aeb305be20f /arch/powerpc/bits | |
parent | 0b52bf5c78435f3af4e0c1cbbe4177861e599847 (diff) | |
download | musl-75c450cff34b5206aca6aab14b7ad909168b8f50.tar.gz musl-75c450cff34b5206aca6aab14b7ad909168b8f50.tar.xz musl-75c450cff34b5206aca6aab14b7ad909168b8f50.zip |
fenv support for ppc, untested
based on code sent to the mailing list by nsz, with minor changes.
Diffstat (limited to 'arch/powerpc/bits')
-rw-r--r-- | arch/powerpc/bits/fenv.h | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/powerpc/bits/fenv.h b/arch/powerpc/bits/fenv.h index edbdea2a..b0af1ffe 100644 --- a/arch/powerpc/bits/fenv.h +++ b/arch/powerpc/bits/fenv.h @@ -1,10 +1,31 @@ -#define FE_ALL_EXCEPT 0 -#define FE_TONEAREST 0 +#define FE_TONEAREST 0 +#define FE_TOWARDZERO 1 +#define FE_UPWARD 2 +#define FE_DOWNWARD 3 -typedef unsigned long fexcept_t; +#define FE_INEXACT 0x02000000 +#define FE_DIVBYZERO 0x04000000 +#define FE_UNDERFLOW 0x08000000 +#define FE_OVERFLOW 0x10000000 +#define FE_INVALID 0x20000000 -typedef struct { - unsigned long __cw; -} fenv_t; +#define FE_ALL_EXCEPT 0x3e000000 -#define FE_DFL_ENV ((const fenv_t *) -1) +#ifdef _GNU_SOURCE +#define FE_INVALID_SNAN 0x01000000 +#define FE_INVALID_ISI 0x00800000 +#define FE_INVALID_IDI 0x00400000 +#define FE_INVALID_ZDZ 0x00200000 +#define FE_INVALID_IMZ 0x00100000 +#define FE_INVALID_COMPARE 0x00080000 +#define FE_INVALID_SOFTWARE 0x00000400 +#define FE_INVALID_SQRT 0x00000200 +#define FE_INVALID_INTEGER_CONVERSION 0x00000100 + +#define FE_ALL_INVALID 0x01f80700 +#endif + +typedef unsigned fexcept_t; +typedef double fenv_t; + +#define FE_DFL_ENV ((fenv_t *)-1) |