diff options
Diffstat (limited to 'newlib/libc/machine/riscv/include/fenv.h')
-rw-r--r-- | newlib/libc/machine/riscv/include/fenv.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/newlib/libc/machine/riscv/include/fenv.h b/newlib/libc/machine/riscv/include/fenv.h new file mode 100644 index 000000000..4709c02cb --- /dev/null +++ b/newlib/libc/machine/riscv/include/fenv.h @@ -0,0 +1,42 @@ +/* Copyright (c) 2017 SiFive Inc. All rights reserved. + + This copyrighted material is made available to anyone wishing to use, + modify, copy, or redistribute it subject to the terms and conditions + of the BSD License. This program is distributed in the hope that + it will be useful, but WITHOUT ANY WARRANTY expressed or implied, + including the implied warranties of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. A copy of this license is available at + http://www.opensource.org/licenses. +*/ + +#ifndef _FENV_H +#define _FENV_H + +#include <sys/fenv.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exception */ +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); + +/* Rounding mode */ +int fegetround(void); +int fesetround(int rounding_mode); + +/* Float environment */ +int fegetenv(fenv_t *envp); +int feholdexcept(fenv_t *envp); +int fesetenv(const fenv_t *envp); +int feupdateenv(const fenv_t *envp); + +#ifdef __cplusplus +} +#endif + +#endif |