From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id EE17B385B835; Fri, 17 Apr 2020 12:07:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE17B385B835 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/sfp-exceptions] Use libc_fe* macros in ldbl-128/s_nearbyintl.c X-Act-Checkin: glibc X-Git-Author: Stefan Liebler via Libc-alpha X-Git-Refname: refs/heads/azanella/sfp-exceptions X-Git-Oldrev: c98154a713eb157b67682dd1f77917996c893b88 X-Git-Newrev: 2b48ff1b0c1083ea8f010867b252547cbaa5cb75 Message-Id: <20200417120705.EE17B385B835@sourceware.org> Date: Fri, 17 Apr 2020 12:07:05 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 12:07:06 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b48ff1b0c1083ea8f010867b252547cbaa5cb75 commit 2b48ff1b0c1083ea8f010867b252547cbaa5cb75 Author: Stefan Liebler via Libc-alpha 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 #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 #include #include +#include #include #include @@ -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. */