diff options
| author | Elliott Hughes <enh@google.com> | 2013-10-02 17:02:58 -0700 |
|---|---|---|
| committer | Elliott Hughes <enh@google.com> | 2013-10-02 17:02:58 -0700 |
| commit | 361847f9aca0b77a09e52cb1cbc8218132ea9b3a (patch) | |
| tree | 62c7a025554b70465258b12552830fe3157965ba | |
| parent | f741e1c2ed27f153e92a2a36c9db3b189f9a6388 (diff) | |
| download | bionic-361847f9aca0b77a09e52cb1cbc8218132ea9b3a.zip bionic-361847f9aca0b77a09e52cb1cbc8218132ea9b3a.tar.gz bionic-361847f9aca0b77a09e52cb1cbc8218132ea9b3a.tar.bz2 | |
Fix the x86_64 fenv.h.
We should clean all the fenv.h files up, but not now. I've raised
bug 11050744 as a reminder.
Change-Id: I640c15b0f0477ec1a7891c031860404875bbe4b5
| -rw-r--r-- | libm/include/amd64/fenv.h | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/libm/include/amd64/fenv.h b/libm/include/amd64/fenv.h index 037778e..1dc4215 100644 --- a/libm/include/amd64/fenv.h +++ b/libm/include/amd64/fenv.h @@ -1,6 +1,3 @@ -/* $OpenBSD: fenv.h,v 1.4 2011/05/25 21:46:49 martynas Exp $ */ -/* $NetBSD: fenv.h,v 1.1 2010/07/31 21:47:54 joerg Exp $ */ - /*- * Copyright (c) 2004-2005 David Schultz <das (at) FreeBSD.ORG> * All rights reserved. @@ -33,6 +30,14 @@ #include <sys/types.h> /* + * This file combines the OpenBSD include/fenv.h and machine/fenv.h to fit + * the style of the other architectures (where we couldn't just take an + * upstream fenv.h and had to write our own). + */ + +__BEGIN_DECLS + +/* * Each symbol representing a floating point exception expands to an integer * constant expression with values, such that bitwise-inclusive ORs of _all * combinations_ of the constants result in distinct values. @@ -95,9 +100,7 @@ typedef struct { * that manage the floating-point environment, namely fesetenv() and * feupdateenv(). */ -__BEGIN_DECLS extern fenv_t __fe_dfl_env; -__END_DECLS #define FE_DFL_ENV ((const fenv_t *)&__fe_dfl_env) /* @@ -114,4 +117,31 @@ __END_DECLS */ typedef unsigned int fexcept_t; +/* C99 floating-point exception functions */ +int feclearexcept(int excepts); +int fegetexceptflag(fexcept_t *flagp, int excepts); +int fesetexceptflag(const fexcept_t *flagp, int excepts); +/* feraiseexcept does not set the inexact flag on overflow/underflow */ +int feraiseexcept(int excepts); +int fetestexcept(int excepts); + +/* C99 rounding control functions */ +int fegetround(void); +int fesetround(int round); + +/* C99 floating-point environment functions */ +int fegetenv(fenv_t *__envp); +int feholdexcept(fenv_t *__envp); +int fesetenv(const fenv_t *envp); +int feupdateenv(const fenv_t *__envp); + +#if __BSD_VISIBLE +/* Additional support functions to set/query floating point traps */ +int feenableexcept(int __mask); +int fedisableexcept(int __mask); +int fegetexcept(void); +#endif /* __BSD_VISIBLE */ + +__END_DECLS + #endif /* !_AMD64_FENV_H_ */ |
