public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/sfp-exceptions] Use libc_fe* macros in ldbl-128/s_nearbyintl.c
@ 2020-04-17 12:07 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2020-04-17 12:07 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b48ff1b0c1083ea8f010867b252547cbaa5cb75
commit 2b48ff1b0c1083ea8f010867b252547cbaa5cb75
Author: Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org>
Date: Fri Apr 17 08:49:51 2020 -0300
Use libc_fe* macros in ldbl-128/s_nearbyintl.c
The calls to feholdexcept and fesetenv are replaced
by the libc_fe* macros as it is also done in nearbyintf
and nearbyint.
Diff:
---
sysdeps/ieee754/float128/float128_private.h | 10 ++++++++++
sysdeps/ieee754/ldbl-128/s_nearbyintl.c | 9 +++++----
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. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-17 12:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 12:07 [glibc/azanella/sfp-exceptions] Use libc_fe* macros in ldbl-128/s_nearbyintl.c Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).