diff options
author | Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> | 2020-04-20 08:13:05 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-04-20 15:28:59 -0300 |
commit | df92ae2187035d06150bce45f798201be6698ab3 (patch) | |
tree | 1092cadd5794517d8368ad915416966c7b7110f3 | |
parent | f721171632d67f397e712db52b9ce36bb46fdd96 (diff) | |
download | glibc-df92ae2187035d06150bce45f798201be6698ab3.tar.gz |
Use libc_fe* macros in ldbl-128/s_nearbyintl.c.
-rw-r--r-- | sysdeps/ieee754/float128/float128_private.h | 10 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_nearbyintl.c | 9 | ||||
-rw-r--r-- | sysdeps/x86/fpu/fenv_private.h | 4 |
3 files changed, 19 insertions, 4 deletions
diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h index f97463d9dc..af1ed8f3c0 100644 --- a/sysdeps/ieee754/float128/float128_private.h +++ b/sysdeps/ieee754/float128/float128_private.h @@ -66,6 +66,16 @@ # define libc_feupdateenv_testl(ENV, EX) libc_feupdateenv_testf128 (ENV, EX) #endif +#ifdef libc_feholdexceptf128 +# undef libc_feholdexceptl +# define libc_feholdexceptl(ENV) libc_feholdexceptf128 (ENV) +#endif + +#ifdef libc_fesetenvf128 +# undef libc_fesetenvl +# define libc_fesetenvl(ENV) libc_fesetenvf128 (ENV) +#endif + /* misc macros from the header below. */ #include <fix-fp-int-convert-overflow.h> #undef FIX_LDBL_LONG_CONVERT_OVERFLOW diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c index 8d26786f78..c0bc6fbd6d 100644 --- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c +++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c @@ -27,6 +27,7 @@ #include <math.h> #include <math-barriers.h> #include <math_private.h> +#include <fenv_private.h> #include <libm-alias-ldouble.h> #include <math-use-builtins.h> @@ -53,11 +54,11 @@ __nearbyintl (_Float128 x) { if (j0 < 0) { - feholdexcept (&env); + libc_feholdexceptl (&env); w = TWO112[sx] + math_opt_barrier (x); t = w - TWO112[sx]; math_force_eval (t); - fesetenv (&env); + libc_fesetenvl (&env); GET_LDOUBLE_MSW64 (i0, t); SET_LDOUBLE_MSW64 (t, (i0 & 0x7fffffffffffffffLL) | (sx << 63)); return t; @@ -70,11 +71,11 @@ __nearbyintl (_Float128 x) else return x; /* x is integral */ } - feholdexcept (&env); + libc_feholdexceptl (&env); w = TWO112[sx] + math_opt_barrier (x); t = w - TWO112[sx]; math_force_eval (t); - fesetenv (&env); + libc_fesetenvl (&env); return t; #endif /* ! USE_NEARBYINTL_BUILTIN */ } diff --git a/sysdeps/x86/fpu/fenv_private.h b/sysdeps/x86/fpu/fenv_private.h index 4b081e015b..23a430362a 100644 --- a/sysdeps/x86/fpu/fenv_private.h +++ b/sysdeps/x86/fpu/fenv_private.h @@ -300,12 +300,16 @@ libc_feresetround_387 (fenv_t *e) SET_RESTORE_ROUND_GENERIC (RM, libc_feholdsetround_sse, libc_feresetround_sse) # define libc_feholdexcept_setroundf128 libc_feholdexcept_setround_sse # define libc_feupdateenv_testf128 libc_feupdateenv_test_sse +# define libc_feholdexceptf128 libc_feholdexcept_sse +# define libc_fesetenvf128 libc_fesetenv_sse #else /* The 387 rounding mode is used by soft-fp for 32-bit, but whether 387 or SSE exceptions are used depends on whether libgcc was built for SSE math, which is not known when glibc is being built. */ # define libc_feholdexcept_setroundf128 default_libc_feholdexcept_setround # define libc_feupdateenv_testf128 default_libc_feupdateenv_test +# define libc_feholdexceptf128 default_libc_feholdexcept +# define libc_fesetenvf128 default_libc_fesetenv #endif /* We have support for rounding mode context. */ |