From 5de606387b60d57399e61bdb78d6697139ceb445 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 28 Nov 2017 00:07:56 +0000 Subject: Use libm_alias_double for alpha. Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes alpha libm function implementations use libm_alias_double to define function aliases. This also simplifies the code because the compatibility for long double = double is handled by libm_alias_double instead of locally in each source file. Tested with build-many-glibcs.py for alpha-linux-gnu that installed stripped shared libraries are unchanged by the patch. * sysdeps/alpha/fpu/s_ceil.c: Include . (ceil): Define using libm_alias_double. * sysdeps/alpha/fpu/s_copysign.c: Include . (copysign): Define using libm_alias_double. * sysdeps/alpha/fpu/s_fabs.c: Include . (fabs): Define using libm_alias_double. * sysdeps/alpha/fpu/s_floor.c: Include . (floor): Define using libm_alias_double. * sysdeps/alpha/fpu/s_fmax.S: Include . (fmax): Define using libm_alias_double. * sysdeps/alpha/fpu/s_fmin.S: Include . (fmin): Define using libm_alias_double. * sysdeps/alpha/fpu/s_lrint.c: Include . (lrint): Define using libm_alias_double. (llrint): Likewise. * sysdeps/alpha/fpu/s_lround.c: Include . (lround): Define using libm_alias_double. (llround): Likewise. * sysdeps/alpha/fpu/s_rint.c: Include . (rint): Define using libm_alias_double. * sysdeps/alpha/fpu/s_trunc.c: Include . (trunc): Define using libm_alias_double. --- sysdeps/alpha/fpu/s_ceil.c | 10 ++-------- sysdeps/alpha/fpu/s_copysign.c | 13 +++---------- sysdeps/alpha/fpu/s_fabs.c | 10 ++-------- sysdeps/alpha/fpu/s_floor.c | 10 ++-------- sysdeps/alpha/fpu/s_fmax.S | 10 ++-------- sysdeps/alpha/fpu/s_fmin.S | 10 ++-------- sysdeps/alpha/fpu/s_lrint.c | 15 +++------------ sysdeps/alpha/fpu/s_lround.c | 15 +++------------ sysdeps/alpha/fpu/s_rint.c | 10 ++-------- sysdeps/alpha/fpu/s_trunc.c | 10 ++-------- 10 files changed, 23 insertions(+), 90 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c index 029ee09315..38ba34e9ce 100644 --- a/sysdeps/alpha/fpu/s_ceil.c +++ b/sysdeps/alpha/fpu/s_ceil.c @@ -18,6 +18,7 @@ #include #include +#include /* Use the -inf rounding mode conversion instructions to implement ceil, via something akin to -floor(-x). This is much faster than @@ -46,11 +47,4 @@ __ceil (double x) return x; } -weak_alias (__ceil, ceil) -#ifdef NO_LONG_DOUBLE -strong_alias (__ceil, __ceill) -weak_alias (__ceil, ceill) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __ceil, ceill, GLIBC_2_0); -#endif +libm_alias_double (__ceil, ceil) diff --git a/sysdeps/alpha/fpu/s_copysign.c b/sysdeps/alpha/fpu/s_copysign.c index 3bd3dd48df..d5d1f9bfbb 100644 --- a/sysdeps/alpha/fpu/s_copysign.c +++ b/sysdeps/alpha/fpu/s_copysign.c @@ -18,6 +18,7 @@ #include #include +#include double __copysign (double x, double y) @@ -25,15 +26,7 @@ __copysign (double x, double y) return __builtin_copysign (x, y); } -weak_alias (__copysign, copysign) -#ifdef NO_LONG_DOUBLE -strong_alias (__copysign, __copysignl) -weak_alias (__copysign, copysignl) -#endif -#if IS_IN (libm) -# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __copysign, copysignl, GLIBC_2_0); -# endif -#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0) +libm_alias_double (__copysign, copysign) +#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0) compat_symbol (libc, __copysign, copysignl, GLIBC_2_0); #endif diff --git a/sysdeps/alpha/fpu/s_fabs.c b/sysdeps/alpha/fpu/s_fabs.c index abcc6e7c75..8be9de4fb6 100644 --- a/sysdeps/alpha/fpu/s_fabs.c +++ b/sysdeps/alpha/fpu/s_fabs.c @@ -18,6 +18,7 @@ #include #include +#include double __fabs (double x) @@ -25,11 +26,4 @@ __fabs (double x) return __builtin_fabs (x); } -weak_alias (__fabs, fabs) -#ifdef NO_LONG_DOUBLE -strong_alias (__fabs, __fabsl) -weak_alias (__fabs, fabsl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __fabs, fabsl, GLIBC_2_0); -#endif +libm_alias_double (__fabs, fabs) diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c index 49a0c760a9..746957c55d 100644 --- a/sysdeps/alpha/fpu/s_floor.c +++ b/sysdeps/alpha/fpu/s_floor.c @@ -18,6 +18,7 @@ #include #include +#include /* Use the -inf rounding mode conversion instructions to implement @@ -47,11 +48,4 @@ __floor (double x) return x; } -weak_alias (__floor, floor) -#ifdef NO_LONG_DOUBLE -strong_alias (__floor, __floorl) -weak_alias (__floor, floorl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __floor, floorl, GLIBC_2_0); -#endif +libm_alias_double (__floor, floor) diff --git a/sysdeps/alpha/fpu/s_fmax.S b/sysdeps/alpha/fpu/s_fmax.S index 8a65ae4963..d6c275943f 100644 --- a/sysdeps/alpha/fpu/s_fmax.S +++ b/sysdeps/alpha/fpu/s_fmax.S @@ -18,6 +18,7 @@ #include #include +#include .set noat .set noreorder @@ -47,11 +48,4 @@ END (__fmax) strong_alias (__fmax, __fmaxf) weak_alias (__fmaxf, fmaxf) -weak_alias (__fmax, fmax) -#ifdef NO_LONG_DOUBLE -strong_alias (__fmax, __fmaxl) -weak_alias (__fmaxl, fmaxl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1); -#endif +libm_alias_double (__fmax, fmax) diff --git a/sysdeps/alpha/fpu/s_fmin.S b/sysdeps/alpha/fpu/s_fmin.S index 926bd32ec4..6da4a93a6e 100644 --- a/sysdeps/alpha/fpu/s_fmin.S +++ b/sysdeps/alpha/fpu/s_fmin.S @@ -18,6 +18,7 @@ #include #include +#include .set noat .set noreorder @@ -47,11 +48,4 @@ END (__fmin) strong_alias (__fmin, __fminf) weak_alias (__fminf, fminf) -weak_alias (__fmin, fmin) -#ifdef NO_LONG_DOUBLE -strong_alias (__fmin, __fminl) -weak_alias (__fminl, fminl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __fmin, fminl, GLIBC_2_1); -#endif +libm_alias_double (__fmin, fmin) diff --git a/sysdeps/alpha/fpu/s_lrint.c b/sysdeps/alpha/fpu/s_lrint.c index 2a644c57df..37cfbac508 100644 --- a/sysdeps/alpha/fpu/s_lrint.c +++ b/sysdeps/alpha/fpu/s_lrint.c @@ -19,6 +19,7 @@ #define llrint not_llrint #include #include +#include #undef __llrint #undef llrint @@ -33,15 +34,5 @@ __lrint (double x) } strong_alias (__lrint, __llrint) -weak_alias (__lrint, lrint) -weak_alias (__llrint, llrint) -#ifdef NO_LONG_DOUBLE -strong_alias (__lrint, __lrintl) -strong_alias (__lrint, __llrintl) -weak_alias (__lrintl, lrintl) -weak_alias (__llrintl, llrintl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __lrint, lrintl, GLIBC_2_1); -compat_symbol (libm, __llrint, llrintl, GLIBC_2_1); -#endif +libm_alias_double (__lrint, lrint) +libm_alias_double (__llrint, llrint) diff --git a/sysdeps/alpha/fpu/s_lround.c b/sysdeps/alpha/fpu/s_lround.c index 78a067daf1..bd32bf8c25 100644 --- a/sysdeps/alpha/fpu/s_lround.c +++ b/sysdeps/alpha/fpu/s_lround.c @@ -19,6 +19,7 @@ #define llround not_llround #include #include +#include #undef __llround #undef llround @@ -33,15 +34,5 @@ __lround (double x) } strong_alias (__lround, __llround) -weak_alias (__lround, lround) -weak_alias (__llround, llround) -#ifdef NO_LONG_DOUBLE -strong_alias (__lround, __lroundl) -strong_alias (__lround, __llroundl) -weak_alias (__lroundl, lroundl) -weak_alias (__llroundl, llroundl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __lround, lroundl, GLIBC_2_1); -compat_symbol (libm, __llround, llroundl, GLIBC_2_1); -#endif +libm_alias_double (__lround, lround) +libm_alias_double (__llround, llround) diff --git a/sysdeps/alpha/fpu/s_rint.c b/sysdeps/alpha/fpu/s_rint.c index fca35cf961..737988adca 100644 --- a/sysdeps/alpha/fpu/s_rint.c +++ b/sysdeps/alpha/fpu/s_rint.c @@ -18,6 +18,7 @@ #include #include +#include double @@ -41,11 +42,4 @@ __rint (double x) return x; } -weak_alias (__rint, rint) -#ifdef NO_LONG_DOUBLE -strong_alias (__rint, __rintl) -weak_alias (__rint, rintl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0) -compat_symbol (libm, __rint, rintl, GLIBC_2_0); -#endif +libm_alias_double (__rint, rint) diff --git a/sysdeps/alpha/fpu/s_trunc.c b/sysdeps/alpha/fpu/s_trunc.c index 68a013d222..ba3af86e4d 100644 --- a/sysdeps/alpha/fpu/s_trunc.c +++ b/sysdeps/alpha/fpu/s_trunc.c @@ -18,6 +18,7 @@ #include #include +#include /* Use the chopped rounding mode conversion instructions to implement trunc. */ @@ -41,11 +42,4 @@ __trunc (double x) return copysign (r, x); } -weak_alias (__trunc, trunc) -#ifdef NO_LONG_DOUBLE -strong_alias (__trunc, __truncl) -weak_alias (__trunc, truncl) -#endif -#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1) -compat_symbol (libm, __trunc, truncl, GLIBC_2_1); -#endif +libm_alias_double (__trunc, trunc) -- cgit 1.4.1