libm: Set math_errhandling to match library and hardware [v2]
math_errhandling is specified to contain two bits of information: 1. MATH_ERRNO -- Set when the library sets errno 2. MATH_ERREXCEPT -- Set when math operations report exceptions MATH_ERRNO should match whether the original math code is compiled in _IEEE_LIBM mode and the new math code has WANT_ERRNO == 1. MATH_ERREXCEPT should match whether the underlying hardware has exception support. This patch adds configurations of this value for RISC-V, ARM, Aarch64, x86 and x86_64 when using HW float. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
committed by
Corinna Vinschen
parent
bb166cfc3e
commit
45efe659b8
@ -188,7 +188,17 @@ extern int isnan (double);
|
||||
# define MATH_ERREXCEPT 2
|
||||
#endif
|
||||
#ifndef math_errhandling
|
||||
# define math_errhandling MATH_ERRNO
|
||||
# ifdef _IEEE_LIBM
|
||||
# define _MATH_ERRHANDLING_ERRNO 0
|
||||
# else
|
||||
# define _MATH_ERRHANDLING_ERRNO MATH_ERRNO
|
||||
# endif
|
||||
# ifdef _SUPPORTS_ERREXCEPT
|
||||
# define _MATH_ERRHANDLING_ERREXCEPT MATH_ERREXCEPT
|
||||
# else
|
||||
# define _MATH_ERRHANDLING_ERREXCEPT 0
|
||||
# endif
|
||||
# define math_errhandling (_MATH_ERRHANDLING_ERRNO | _MATH_ERRHANDLING_ERREXCEPT)
|
||||
#endif
|
||||
|
||||
extern int __isinff (float x);
|
||||
|
Reference in New Issue
Block a user