From e4602cba2fb919546bee0eacbd10ab8ade7b7b6f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 29 Nov 2017 00:10:35 +0000 Subject: Use libm_alias_float for i386. Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes i386 libm function implementations use libm_alias_float (or libm_alias_float_other in cases where the main symbol name is defined with versioned_symbol) to define function aliases. Tested with build-many-glibcs.py for all its i386 configurations that installed stripped shared libraries are unchanged by the patch, as well as running the full glibc testsuite for i686. * sysdeps/i386/fpu/s_asinhf.S: Include . (asinhf): Define using libm_alias_float. * sysdeps/i386/fpu/s_atanf.S: Include . (atanf): Define using libm_alias_float. * sysdeps/i386/fpu/s_cbrtf.S: Include . (cbrtf): Define using libm_alias_float. * sysdeps/i386/fpu/s_ceilf.S: Include . (ceilf): Define using libm_alias_float. * sysdeps/i386/fpu/s_copysignf.S: Include . (copysignf): Define using libm_alias_float. * sysdeps/i386/fpu/s_expm1f.S: Include . (expm1f): Define using libm_alias_float. * sysdeps/i386/fpu/s_fabsf.S: Include . (fabsf): Define using libm_alias_float. * sysdeps/i386/fpu/s_floorf.S: Include . (floorf): Define using libm_alias_float. * sysdeps/i386/fpu/s_fmaxf.S: Include . (fmaxf): Define using libm_alias_float. * sysdeps/i386/fpu/s_fminf.S: Include . (fminf): Define using libm_alias_float. * sysdeps/i386/fpu/s_frexpf.S: Include . (frexpf): Define using libm_alias_float. * sysdeps/i386/fpu/s_llrintf.S: Include . (llrintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_logbf.S: Include . (logbf): Define using libm_alias_float. * sysdeps/i386/fpu/s_lrintf.S: Include . (lrintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_nearbyintf.S: Include . (nearbyintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_remquof.S: Include . (remquof): Define using libm_alias_float. * sysdeps/i386/fpu/s_rintf.S: Include . (rintf): Define using libm_alias_float. * sysdeps/i386/fpu/s_truncf.S: Include . (truncf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_expf.c: Include . (expf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Include . (log2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_logf.c: Include . (logf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/e_powf.c: Include . (powf): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/i386/i686/fpu/multiarch/s_cosf.c: Include . (cosf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/s_sincosf.c: Include . (sincosf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/multiarch/s_sinf.c: Include . (sinf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/s_fmaxf.S: Include . (fmaxf): Define using libm_alias_float. * sysdeps/i386/i686/fpu/s_fminf.S: Include . (fminf): Define using libm_alias_float. * sysdeps/i386/i686/multiarch/s_fmaf.c: Include . (fmaf): Define using libm_alias_float. --- sysdeps/i386/i686/fpu/multiarch/e_exp2f.c | 4 +++- sysdeps/i386/i686/fpu/multiarch/e_expf.c | 4 +++- sysdeps/i386/i686/fpu/multiarch/e_log2f.c | 4 +++- sysdeps/i386/i686/fpu/multiarch/e_logf.c | 4 +++- sysdeps/i386/i686/fpu/multiarch/e_powf.c | 4 +++- sysdeps/i386/i686/fpu/multiarch/s_cosf.c | 3 ++- sysdeps/i386/i686/fpu/multiarch/s_sincosf.c | 3 ++- sysdeps/i386/i686/fpu/multiarch/s_sinf.c | 3 ++- sysdeps/i386/i686/fpu/s_fmaxf.S | 3 ++- sysdeps/i386/i686/fpu/s_fminf.S | 3 ++- sysdeps/i386/i686/multiarch/s_fmaf.c | 3 ++- 11 files changed, 27 insertions(+), 11 deletions(-) (limited to 'sysdeps/i386/i686') diff --git a/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c index 0a5727f7de..ed7a84da7e 100644 --- a/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c +++ b/sysdeps/i386/i686/fpu/multiarch/e_exp2f.c @@ -23,11 +23,13 @@ extern float __redirect_exp2f (float); libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ()); +#include #ifdef SHARED # include versioned_symbol (libm, __exp2f, exp2f, GLIBC_2_27); +libm_alias_float_other (__exp2, exp2) #else -weak_alias (__exp2f, exp2f) +libm_alias_float (__exp2, exp2) #endif strong_alias (__exp2f, __ieee754_exp2f) diff --git a/sysdeps/i386/i686/fpu/multiarch/e_expf.c b/sysdeps/i386/i686/fpu/multiarch/e_expf.c index bd4240e560..5c0f84a098 100644 --- a/sysdeps/i386/i686/fpu/multiarch/e_expf.c +++ b/sysdeps/i386/i686/fpu/multiarch/e_expf.c @@ -23,14 +23,16 @@ extern float __redirect_expf (float); libc_ifunc_redirected (__redirect_expf, __expf, IFUNC_SELECTOR ()); +#include #ifdef SHARED __hidden_ver1 (__expf_ia32, __GI___expf, __redirect_expf) __attribute__ ((visibility ("hidden"))); # include versioned_symbol (libm, __expf, expf, GLIBC_2_27); +libm_alias_float_other (__exp, exp) #else -weak_alias (__expf, expf) +libm_alias_float (__exp, exp) #endif strong_alias (__expf, __ieee754_expf) diff --git a/sysdeps/i386/i686/fpu/multiarch/e_log2f.c b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c index 2c4794932a..af089dea1b 100644 --- a/sysdeps/i386/i686/fpu/multiarch/e_log2f.c +++ b/sysdeps/i386/i686/fpu/multiarch/e_log2f.c @@ -23,14 +23,16 @@ extern float __redirect_log2f (float); libc_ifunc_redirected (__redirect_log2f, __log2f, IFUNC_SELECTOR ()); +#include #ifdef SHARED __hidden_ver1 (__log2f_ia32, __GI___log2f, __redirect_log2f) __attribute__ ((visibility ("hidden"))); # include versioned_symbol (libm, __log2f, log2f, GLIBC_2_27); +libm_alias_float_other (__log2, log2) #else -weak_alias (__log2f, log2f) +libm_alias_float (__log2, log2) #endif strong_alias (__log2f, __ieee754_log2f) diff --git a/sysdeps/i386/i686/fpu/multiarch/e_logf.c b/sysdeps/i386/i686/fpu/multiarch/e_logf.c index 1414d17d25..f69065e9e7 100644 --- a/sysdeps/i386/i686/fpu/multiarch/e_logf.c +++ b/sysdeps/i386/i686/fpu/multiarch/e_logf.c @@ -23,14 +23,16 @@ extern float __redirect_logf (float); libc_ifunc_redirected (__redirect_logf, __logf, IFUNC_SELECTOR ()); +#include #ifdef SHARED __hidden_ver1 (__logf_ia32, __GI___logf, __redirect_logf) __attribute__ ((visibility ("hidden"))); # include versioned_symbol (libm, __logf, logf, GLIBC_2_27); +libm_alias_float_other (__log, log) #else -weak_alias (__logf, logf) +libm_alias_float (__log, log) #endif strong_alias (__logf, __ieee754_logf) diff --git a/sysdeps/i386/i686/fpu/multiarch/e_powf.c b/sysdeps/i386/i686/fpu/multiarch/e_powf.c index 4dc4c87326..281563fefd 100644 --- a/sysdeps/i386/i686/fpu/multiarch/e_powf.c +++ b/sysdeps/i386/i686/fpu/multiarch/e_powf.c @@ -26,14 +26,16 @@ libc_ifunc_redirected (__redirect_powf, __powf, IFUNC_SELECTOR ()); +#include #ifdef SHARED __hidden_ver1 (__powf_ia32, __GI___powf, __redirect_powf) __attribute__ ((visibility ("hidden"))); # include versioned_symbol (libm, __powf, powf, GLIBC_2_27); +libm_alias_float_other (__pow, pow) #else -weak_alias (__powf, powf) +libm_alias_float (__pow, pow) #endif strong_alias (__powf, __ieee754_powf) diff --git a/sysdeps/i386/i686/fpu/multiarch/s_cosf.c b/sysdeps/i386/i686/fpu/multiarch/s_cosf.c index af588de9dc..d16b05b6c5 100644 --- a/sysdeps/i386/i686/fpu/multiarch/s_cosf.c +++ b/sysdeps/i386/i686/fpu/multiarch/s_cosf.c @@ -17,13 +17,14 @@ . */ #include +#include extern float __cosf_sse2 (float); extern float __cosf_ia32 (float); float __cosf (float); libm_ifunc (__cosf, HAS_CPU_FEATURE (SSE2) ? __cosf_sse2 : __cosf_ia32); -weak_alias (__cosf, cosf); +libm_alias_float (__cos, cos); #define COSF __cosf_ia32 #include diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c b/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c index 9428f9b4ea..5cedffb2e2 100644 --- a/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c +++ b/sysdeps/i386/i686/fpu/multiarch/s_sincosf.c @@ -17,6 +17,7 @@ . */ #include +#include extern void __sincosf_sse2 (float, float *, float *); extern void __sincosf_ia32 (float, float *, float *); @@ -24,7 +25,7 @@ void __sincosf (float, float *, float *); libm_ifunc (__sincosf, HAS_CPU_FEATURE (SSE2) ? __sincosf_sse2 : __sincosf_ia32); -weak_alias (__sincosf, sincosf); +libm_alias_float (__sincos, sincos); #define SINCOSF __sincosf_ia32 #include diff --git a/sysdeps/i386/i686/fpu/multiarch/s_sinf.c b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c index 8ccdd2f34d..9bde8fabe4 100644 --- a/sysdeps/i386/i686/fpu/multiarch/s_sinf.c +++ b/sysdeps/i386/i686/fpu/multiarch/s_sinf.c @@ -17,12 +17,13 @@ . */ #include +#include extern float __sinf_sse2 (float); extern float __sinf_ia32 (float); float __sinf (float); libm_ifunc (__sinf, HAS_CPU_FEATURE (SSE2) ? __sinf_sse2 : __sinf_ia32); -weak_alias (__sinf, sinf); +libm_alias_float (__sin, sin); #define SINF __sinf_ia32 #include diff --git a/sysdeps/i386/i686/fpu/s_fmaxf.S b/sysdeps/i386/i686/fpu/s_fmaxf.S index 3a25951a09..73da61ddab 100644 --- a/sysdeps/i386/i686/fpu/s_fmaxf.S +++ b/sysdeps/i386/i686/fpu/s_fmaxf.S @@ -18,6 +18,7 @@ . */ #include +#include .text ENTRY(__fmaxf) @@ -36,4 +37,4 @@ ENTRY(__fmaxf) ret END(__fmaxf) -weak_alias (__fmaxf, fmaxf) +libm_alias_float (__fmax, fmax) diff --git a/sysdeps/i386/i686/fpu/s_fminf.S b/sysdeps/i386/i686/fpu/s_fminf.S index 52ea892bad..4c9dc9f460 100644 --- a/sysdeps/i386/i686/fpu/s_fminf.S +++ b/sysdeps/i386/i686/fpu/s_fminf.S @@ -18,6 +18,7 @@ . */ #include +#include .text ENTRY(__fminf) @@ -34,4 +35,4 @@ ENTRY(__fminf) ret END(__fminf) -weak_alias (__fminf, fminf) +libm_alias_float (__fmin, fmin) diff --git a/sysdeps/i386/i686/multiarch/s_fmaf.c b/sysdeps/i386/i686/multiarch/s_fmaf.c index 00b0fbcfc5..9b9785fd85 100644 --- a/sysdeps/i386/i686/multiarch/s_fmaf.c +++ b/sysdeps/i386/i686/multiarch/s_fmaf.c @@ -21,13 +21,14 @@ #include #include +#include extern float __fmaf_ia32 (float x, float y, float z) attribute_hidden; extern float __fmaf_fma (float x, float y, float z) attribute_hidden; libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma : __fmaf_ia32); -weak_alias (__fmaf, fmaf) +libm_alias_float (__fma, fma) #define __fmaf __fmaf_ia32 -- cgit v1.2.3-65-gdbad