From efeb2bd1ab49215325040aa53396a2c19dfd1402 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 1 Apr 2022 10:19:57 -0300 Subject: math: Add math-use-builtins-fabs (BZ#29027) Both float, double, and _Float128 are assumed to be supported (float and double already only uses builtins). Only long double is parametrized due GCC bug 29253 which prevents its usage on powerpc. It allows to remove i686, ia64, x86_64, powerpc, and sparc arch specific implementation. On ia64 it also fixes the sNAN handling: math/test-float64x-fabs math/test-ldouble-fabs Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu, powerpc64-linux-gnu, sparc64-linux-gnu, and ia64-linux-gnu. --- sysdeps/ieee754/ldbl-128ibm/s_fabsl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sysdeps/ieee754/ldbl-128ibm') diff --git a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c index cba7de6660..7f26315e84 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c @@ -24,9 +24,13 @@ static char rcsid[] = "$NetBSD: $"; #include #include #include +#include long double __fabsl(long double x) { +#if USE_FABSL_BUILTIN + return __builtin_fabsl (x); +#else uint64_t hx, lx; double xhi, xlo; @@ -39,5 +43,6 @@ long double __fabsl(long double x) INSERT_WORDS64 (xlo, lx); x = ldbl_pack (xhi, xlo); return x; +#endif } long_double_symbol (libm, __fabsl, fabsl); -- cgit 1.4.1