From patchwork Wed Nov 29 21:26:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 24607 Received: (qmail 123556 invoked by alias); 29 Nov 2017 21:26:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 123534 invoked by uid 89); 29 Nov 2017 21:26:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, KAM_STOCKGEN, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Date: Wed, 29 Nov 2017 21:26:25 +0000 From: Joseph Myers To: Subject: Use libm_alias_float for x86_64 [committed] Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) Continuing the preparation for additional _FloatN / _FloatNx function aliases, this patch makes x86_64 libm function implementations use libm_alias_float to define function aliases, or libm_alias_float_other where the main name is defined with versioned_symbol. Tested with the glibc testsuite for x86_64, and tested with build-many-glibcs.py for all its x86_64 configurations that installed stripped shared libraries are unchanged by the patch. Committed. 2017-11-29 Joseph Myers * sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/x86_64/fpu/multiarch/e_expf.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/x86_64/fpu/multiarch/e_log2f.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/x86_64/fpu/multiarch/e_logf.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/x86_64/fpu/multiarch/e_powf.c: Include . (exp2f): Define using libm_alias_float, or libm_alias_float_other if [SHARED]. * sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Include . (ceilf): Define using libm_alias_float. * sysdeps/x86_64/fpu/multiarch/s_floorf.c: Include . (floorf): Define using libm_alias_float. * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Include . (fmaf): Define using libm_alias_float. * sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Include . (nearbyintf): Define using libm_alias_float. * sysdeps/x86_64/fpu/multiarch/s_rintf.c: Include . (rintf): Define using libm_alias_float. * sysdeps/x86_64/fpu/multiarch/s_truncf.c: Include . (truncf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_copysignf.S: Include . (copysignf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_cosf.S: Include . (cosf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_fabsf.c: Include . (fabsf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_fmaxf.S: Include . (fmaxf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_fminf.S: Include . (fminf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_llrintf.S: Include . (llrintf): Define using libm_alias_float. [!__ILP32__] (lrintf): Likewise. * sysdeps/x86_64/fpu/s_sincosf.S: Include . (sincosf): Define using libm_alias_float. * sysdeps/x86_64/fpu/s_sinf.S: Include . (sinf): Define using libm_alias_float. * sysdeps/x86_64/x32/fpu/s_lrintf.S: Include . (lrintf): Define using libm_alias_float. diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp2f.c b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c index 13cfcf9..06764a2 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_exp2f.c +++ b/sysdeps/x86_64/fpu/multiarch/e_exp2f.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + extern float __redirect_exp2f (float); #define SYMBOL_NAME exp2f @@ -26,8 +28,9 @@ libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ()); #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/x86_64/fpu/multiarch/e_expf.c b/sysdeps/x86_64/fpu/multiarch/e_expf.c index 18451a0..0ac39a2 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_expf.c +++ b/sysdeps/x86_64/fpu/multiarch/e_expf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + extern float __redirect_expf (float); #define SYMBOL_NAME expf @@ -29,8 +31,9 @@ __hidden_ver1 (__expf, __GI___expf, __redirect_expf) # 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/x86_64/fpu/multiarch/e_log2f.c b/sysdeps/x86_64/fpu/multiarch/e_log2f.c index be12c45..f0b2004 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_log2f.c +++ b/sysdeps/x86_64/fpu/multiarch/e_log2f.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + extern float __redirect_log2f (float); #define SYMBOL_NAME log2f @@ -29,8 +31,9 @@ __hidden_ver1 (__log2f, __GI___log2f, __redirect_log2f) # 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/x86_64/fpu/multiarch/e_logf.c b/sysdeps/x86_64/fpu/multiarch/e_logf.c index 6b29473..c684bc9 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_logf.c +++ b/sysdeps/x86_64/fpu/multiarch/e_logf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + extern float __redirect_logf (float); #define SYMBOL_NAME logf @@ -29,8 +31,9 @@ __hidden_ver1 (__logf, __GI___logf, __redirect_logf) # 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/x86_64/fpu/multiarch/e_powf.c b/sysdeps/x86_64/fpu/multiarch/e_powf.c index c110dba..7e9cde0 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_powf.c +++ b/sysdeps/x86_64/fpu/multiarch/e_powf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define powf __redirect_powf #define __DECL_SIMD___redirect_powf #include @@ -32,8 +34,9 @@ __hidden_ver1 (__powf, __GI___powf, __redirect_powf) # 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/x86_64/fpu/multiarch/s_ceilf.c b/sysdeps/x86_64/fpu/multiarch/s_ceilf.c index 090de04..623e68e 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_ceilf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_ceilf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define ceilf __redirect_ceilf #define __ceilf __redirect___ceilf #include @@ -26,4 +28,4 @@ #include "ifunc-sse4_1.h" libc_ifunc_redirected (__redirect_ceilf, __ceilf, IFUNC_SELECTOR ()); -weak_alias (__ceilf, ceilf) +libm_alias_float (__ceil, ceil) diff --git a/sysdeps/x86_64/fpu/multiarch/s_floorf.c b/sysdeps/x86_64/fpu/multiarch/s_floorf.c index d6cf14d..a843b16 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_floorf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_floorf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define floorf __redirect_floorf #define __floorf __redirect___floorf #include @@ -26,4 +28,4 @@ #include "ifunc-sse4_1.h" libc_ifunc_redirected (__redirect_floorf, __floorf, IFUNC_SELECTOR ()); -weak_alias (__floorf, floorf) +libm_alias_float (__floor, floor) diff --git a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c index 1ae227c..1182796 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c @@ -19,6 +19,7 @@ #include #include #include +#include extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden; @@ -42,7 +43,7 @@ __fmaf_fma4 (float x, float y, float z) libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma3 : (HAS_ARCH_FEATURE (FMA4_Usable) ? __fmaf_fma4 : __fmaf_sse2)); -weak_alias (__fmaf, fmaf) +libm_alias_float (__fma, fma) #define __fmaf __fmaf_sse2 diff --git a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c index e716c94..4aba3ea 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define nearbyintf __redirect_nearbyintf #define __nearbyintf __redirect___nearbyintf #include @@ -27,4 +29,4 @@ libc_ifunc_redirected (__redirect_nearbyintf, __nearbyintf, IFUNC_SELECTOR ()); -weak_alias (__nearbyintf, nearbyintf) +libm_alias_float (__nearbyint, nearbyint) diff --git a/sysdeps/x86_64/fpu/multiarch/s_rintf.c b/sysdeps/x86_64/fpu/multiarch/s_rintf.c index 88f3052..988993c 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_rintf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_rintf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define rintf __redirect_rintf #define __rintf __redirect___rintf #include @@ -26,4 +28,4 @@ #include "ifunc-sse4_1.h" libc_ifunc_redirected (__redirect_rintf, __rintf, IFUNC_SELECTOR ()); -weak_alias (__rintf, rintf) +libm_alias_float (__rint, rint) diff --git a/sysdeps/x86_64/fpu/multiarch/s_truncf.c b/sysdeps/x86_64/fpu/multiarch/s_truncf.c index 6190c2e..a0531c3 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_truncf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_truncf.c @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ +#include + #define truncf __redirect_truncf #define __truncf __redirect___truncf #include @@ -26,4 +28,4 @@ #include "ifunc-sse4_1.h" libc_ifunc_redirected (__redirect_truncf, __truncf, IFUNC_SELECTOR ()); -weak_alias (__truncf, truncf) +libm_alias_float (__trunc, trunc) diff --git a/sysdeps/x86_64/fpu/s_copysignf.S b/sysdeps/x86_64/fpu/s_copysignf.S index 213c2d3..63ea830 100644 --- a/sysdeps/x86_64/fpu/s_copysignf.S +++ b/sysdeps/x86_64/fpu/s_copysignf.S @@ -18,6 +18,7 @@ . */ #include +#include .section .rodata @@ -42,4 +43,4 @@ ENTRY(__copysignf) retq END (__copysignf) -weak_alias (__copysignf, copysignf) +libm_alias_float (__copysign, copysign) diff --git a/sysdeps/x86_64/fpu/s_cosf.S b/sysdeps/x86_64/fpu/s_cosf.S index 7acafcd..327fd27 100644 --- a/sysdeps/x86_64/fpu/s_cosf.S +++ b/sysdeps/x86_64/fpu/s_cosf.S @@ -18,6 +18,7 @@ #include #include +#include /* Short algorithm description: * @@ -529,4 +530,4 @@ L(SP_ONE): .type L(SP_ONE), @object ASM_SIZE_DIRECTIVE(L(SP_ONE)) -weak_alias(__cosf, cosf) +libm_alias_float (__cos, cos) diff --git a/sysdeps/x86_64/fpu/s_fabsf.c b/sysdeps/x86_64/fpu/s_fabsf.c index 9956cce..2a47baa 100644 --- a/sysdeps/x86_64/fpu/s_fabsf.c +++ b/sysdeps/x86_64/fpu/s_fabsf.c @@ -17,10 +17,11 @@ . */ #include +#include float __fabsf (float x) { return __builtin_fabsf (x); } -weak_alias (__fabsf, fabsf) +libm_alias_float (__fabs, fabs) diff --git a/sysdeps/x86_64/fpu/s_fmaxf.S b/sysdeps/x86_64/fpu/s_fmaxf.S index 82989fe..d5e66b8 100644 --- a/sysdeps/x86_64/fpu/s_fmaxf.S +++ b/sysdeps/x86_64/fpu/s_fmaxf.S @@ -18,6 +18,7 @@ . */ #include +#include .text ENTRY(__fmaxf) @@ -49,4 +50,4 @@ ENTRY(__fmaxf) 2: ret END(__fmaxf) -weak_alias (__fmaxf, fmaxf) +libm_alias_float (__fmax, fmax) diff --git a/sysdeps/x86_64/fpu/s_fminf.S b/sysdeps/x86_64/fpu/s_fminf.S index 8e8c936..aac433d 100644 --- a/sysdeps/x86_64/fpu/s_fminf.S +++ b/sysdeps/x86_64/fpu/s_fminf.S @@ -18,6 +18,7 @@ . */ #include +#include .text ENTRY(__fminf) @@ -49,4 +50,4 @@ ENTRY(__fminf) 2: ret END(__fminf) -weak_alias (__fminf, fminf) +libm_alias_float (__fmin, fmin) diff --git a/sysdeps/x86_64/fpu/s_llrintf.S b/sysdeps/x86_64/fpu/s_llrintf.S index 9edb78b..f1cbc86 100644 --- a/sysdeps/x86_64/fpu/s_llrintf.S +++ b/sysdeps/x86_64/fpu/s_llrintf.S @@ -19,14 +19,15 @@ . */ #include +#include .text ENTRY(__llrintf) cvtss2si %xmm0,%rax ret END(__llrintf) -weak_alias (__llrintf, llrintf) +libm_alias_float (__llrint, llrint) #ifndef __ILP32__ strong_alias (__llrintf, __lrintf) -weak_alias (__llrintf, lrintf) +libm_alias_float (__llrint, lrint) #endif diff --git a/sysdeps/x86_64/fpu/s_sincosf.S b/sysdeps/x86_64/fpu/s_sincosf.S index fd35a31..f608aa9 100644 --- a/sysdeps/x86_64/fpu/s_sincosf.S +++ b/sysdeps/x86_64/fpu/s_sincosf.S @@ -18,6 +18,7 @@ #include #include +#include /* Short algorithm description: * @@ -560,4 +561,4 @@ L(SP_ONE): .type L(SP_ONE), @object ASM_SIZE_DIRECTIVE(L(SP_ONE)) -weak_alias(__sincosf, sincosf) +libm_alias_float (__sincos, sincos) diff --git a/sysdeps/x86_64/fpu/s_sinf.S b/sysdeps/x86_64/fpu/s_sinf.S index 253ba7d..c505d60 100644 --- a/sysdeps/x86_64/fpu/s_sinf.S +++ b/sysdeps/x86_64/fpu/s_sinf.S @@ -18,6 +18,7 @@ #include #include +#include /* Short algorithm description: * @@ -555,4 +556,4 @@ L(SP_ABS_MASK): /* Mask for getting SP absolute value */ .type L(SP_ABS_MASK), @object ASM_SIZE_DIRECTIVE(L(SP_ABS_MASK)) -weak_alias(__sinf, sinf) +libm_alias_float (__sin, sin) diff --git a/sysdeps/x86_64/x32/fpu/s_lrintf.S b/sysdeps/x86_64/x32/fpu/s_lrintf.S index 2e6f9aa..5d237c2 100644 --- a/sysdeps/x86_64/x32/fpu/s_lrintf.S +++ b/sysdeps/x86_64/x32/fpu/s_lrintf.S @@ -18,10 +18,11 @@ . */ #include +#include .text ENTRY(__lrintf) cvtss2si %xmm0,%eax ret END(__lrintf) -weak_alias (__lrintf, lrintf) +libm_alias_float (__lrint, lrint)