]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use libm_alias_float for x86_64.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 29 Nov 2017 21:25:41 +0000 (21:25 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 29 Nov 2017 21:25:41 +0000 (21:25 +0000)
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.

* sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_expf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_log2f.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_logf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/e_powf.c: Include
<libm-alias-float.h>.
(exp2f): Define using libm_alias_float, or libm_alias_float_other
if [SHARED].
* sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Include
<libm-alias-float.h>.
(ceilf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_floorf.c: Include
<libm-alias-float.h>.
(floorf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Include
<libm-alias-float.h>.
(fmaf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Include
<libm-alias-float.h>.
(nearbyintf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_rintf.c: Include
<libm-alias-float.h>.
(rintf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/multiarch/s_truncf.c: Include
<libm-alias-float.h>.
(truncf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_copysignf.S: Include <libm-alias-float.h>.
(copysignf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_cosf.S: Include <libm-alias-float.h>.
(cosf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fabsf.c: Include <libm-alias-float.h>.
(fabsf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
(fmaxf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_fminf.S: Include <libm-alias-float.h>.
(fminf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_llrintf.S: Include <libm-alias-float.h>.
(llrintf): Define using libm_alias_float.
[!__ILP32__] (lrintf): Likewise.
* sysdeps/x86_64/fpu/s_sincosf.S: Include <libm-alias-float.h>.
(sincosf): Define using libm_alias_float.
* sysdeps/x86_64/fpu/s_sinf.S: Include <libm-alias-float.h>.
(sinf): Define using libm_alias_float.
* sysdeps/x86_64/x32/fpu/s_lrintf.S: Include <libm-alias-float.h>.
(lrintf): Define using libm_alias_float.

21 files changed:
ChangeLog
sysdeps/x86_64/fpu/multiarch/e_exp2f.c
sysdeps/x86_64/fpu/multiarch/e_expf.c
sysdeps/x86_64/fpu/multiarch/e_log2f.c
sysdeps/x86_64/fpu/multiarch/e_logf.c
sysdeps/x86_64/fpu/multiarch/e_powf.c
sysdeps/x86_64/fpu/multiarch/s_ceilf.c
sysdeps/x86_64/fpu/multiarch/s_floorf.c
sysdeps/x86_64/fpu/multiarch/s_fmaf.c
sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c
sysdeps/x86_64/fpu/multiarch/s_rintf.c
sysdeps/x86_64/fpu/multiarch/s_truncf.c
sysdeps/x86_64/fpu/s_copysignf.S
sysdeps/x86_64/fpu/s_cosf.S
sysdeps/x86_64/fpu/s_fabsf.c
sysdeps/x86_64/fpu/s_fmaxf.S
sysdeps/x86_64/fpu/s_fminf.S
sysdeps/x86_64/fpu/s_llrintf.S
sysdeps/x86_64/fpu/s_sincosf.S
sysdeps/x86_64/fpu/s_sinf.S
sysdeps/x86_64/x32/fpu/s_lrintf.S

index 0cd4b5f1bf5a3e9a2e4a9bf3f71da42ac277d35e..cdd73a8541948c324b1d3c72d21ba8ea0e2f95d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,63 @@
 2017-11-29  Joseph Myers  <joseph@codesourcery.com>
 
+       * sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Include
+       <libm-alias-float.h>.
+       (exp2f): Define using libm_alias_float, or libm_alias_float_other
+       if [SHARED].
+       * sysdeps/x86_64/fpu/multiarch/e_expf.c: Include
+       <libm-alias-float.h>.
+       (exp2f): Define using libm_alias_float, or libm_alias_float_other
+       if [SHARED].
+       * sysdeps/x86_64/fpu/multiarch/e_log2f.c: Include
+       <libm-alias-float.h>.
+       (exp2f): Define using libm_alias_float, or libm_alias_float_other
+       if [SHARED].
+       * sysdeps/x86_64/fpu/multiarch/e_logf.c: Include
+       <libm-alias-float.h>.
+       (exp2f): Define using libm_alias_float, or libm_alias_float_other
+       if [SHARED].
+       * sysdeps/x86_64/fpu/multiarch/e_powf.c: Include
+       <libm-alias-float.h>.
+       (exp2f): Define using libm_alias_float, or libm_alias_float_other
+       if [SHARED].
+       * sysdeps/x86_64/fpu/multiarch/s_ceilf.c: Include
+       <libm-alias-float.h>.
+       (ceilf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/multiarch/s_floorf.c: Include
+       <libm-alias-float.h>.
+       (floorf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Include
+       <libm-alias-float.h>.
+       (fmaf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/multiarch/s_nearbyintf.c: Include
+       <libm-alias-float.h>.
+       (nearbyintf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/multiarch/s_rintf.c: Include
+       <libm-alias-float.h>.
+       (rintf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/multiarch/s_truncf.c: Include
+       <libm-alias-float.h>.
+       (truncf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_copysignf.S: Include <libm-alias-float.h>.
+       (copysignf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_cosf.S: Include <libm-alias-float.h>.
+       (cosf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_fabsf.c: Include <libm-alias-float.h>.
+       (fabsf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_fmaxf.S: Include <libm-alias-float.h>.
+       (fmaxf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_fminf.S: Include <libm-alias-float.h>.
+       (fminf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_llrintf.S: Include <libm-alias-float.h>.
+       (llrintf): Define using libm_alias_float.
+       [!__ILP32__] (lrintf): Likewise.
+       * sysdeps/x86_64/fpu/s_sincosf.S: Include <libm-alias-float.h>.
+       (sincosf): Define using libm_alias_float.
+       * sysdeps/x86_64/fpu/s_sinf.S: Include <libm-alias-float.h>.
+       (sinf): Define using libm_alias_float.
+       * sysdeps/x86_64/x32/fpu/s_lrintf.S: Include <libm-alias-float.h>.
+       (lrintf): Define using libm_alias_float.
+
        * sysdeps/x86_64/fpu/multiarch/s_atan.c: Include
        <libm-alias-double.h>.
        (atan): Define using libm_alias_double.
index 13cfcf9b8c4095b1e74dd4dae73f58fc927a516a..06764a2a9e4d034f19a577a2766b759ac3017651 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 extern float __redirect_exp2f (float);
 
 #define SYMBOL_NAME exp2f
@@ -26,8 +28,9 @@ libc_ifunc_redirected (__redirect_exp2f, __exp2f, IFUNC_SELECTOR ());
 #ifdef SHARED
 # include <shlib-compat.h>
 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)
index 18451a0f77b64b5b586587e7c36b190be90f1354..0ac39a2a2f62792e793ceec128c0e2c307689588 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 extern float __redirect_expf (float);
 
 #define SYMBOL_NAME expf
@@ -29,8 +31,9 @@ __hidden_ver1 (__expf, __GI___expf, __redirect_expf)
 
 # include <shlib-compat.h>
 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)
index be12c4529e5c7ff52ed0a13fb10f6080d59e4ef4..f0b20048acdc59a3fbc80211f7dc1ae0e91fa0c1 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 extern float __redirect_log2f (float);
 
 #define SYMBOL_NAME log2f
@@ -29,8 +31,9 @@ __hidden_ver1 (__log2f, __GI___log2f, __redirect_log2f)
 
 # include <shlib-compat.h>
 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)
index 6b29473f4cb3ff835fda9e12986dc4f4b72c1a81..c684bc9655003c2171af28bb456a6ca66851fdbd 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 extern float __redirect_logf (float);
 
 #define SYMBOL_NAME logf
@@ -29,8 +31,9 @@ __hidden_ver1 (__logf, __GI___logf, __redirect_logf)
 
 # include <shlib-compat.h>
 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)
index c110dbaffbe62f951dbe62a30ace39037684f368..7e9cde08d0a6f217e407c3fe78f2a3abfcb53f60 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define powf __redirect_powf
 #define __DECL_SIMD___redirect_powf
 #include <math.h>
@@ -32,8 +34,9 @@ __hidden_ver1 (__powf, __GI___powf, __redirect_powf)
 
 # include <shlib-compat.h>
 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)
index 090de048b3d8d76f04b4de7556ffa929894708d7..623e68e96838efa692253f7f690fc9430154db5a 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define ceilf __redirect_ceilf
 #define __ceilf __redirect___ceilf
 #include <math.h>
@@ -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)
index d6cf14da6e76f03987c453b3caf1c9ba2370e5ba..a843b16e89495a25f679122f3dc530b9663c4c4a 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define floorf __redirect_floorf
 #define __floorf __redirect___floorf
 #include <math.h>
@@ -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)
index 1ae227c1d407714ae71069fc5af4e6e4c12be49e..1182796cf42173afc97def9a59a03ba0fefaaeeb 100644 (file)
@@ -19,6 +19,7 @@
 #include <config.h>
 #include <math.h>
 #include <init-arch.h>
+#include <libm-alias-float.h>
 
 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
 
index e716c940377d3e7c181bb07704d847286f253dbb..4aba3ea72cdfce830f63a409c26825ebdc470298 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define nearbyintf __redirect_nearbyintf
 #define __nearbyintf __redirect___nearbyintf
 #include <math.h>
@@ -27,4 +29,4 @@
 
 libc_ifunc_redirected (__redirect_nearbyintf, __nearbyintf,
                       IFUNC_SELECTOR ());
-weak_alias (__nearbyintf, nearbyintf)
+libm_alias_float (__nearbyint, nearbyint)
index 88f3052f33e035ff638f4b3f54503b08e2aee905..988993cf26371d444ad86941cbab75f29a6e4b33 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define rintf __redirect_rintf
 #define __rintf __redirect___rintf
 #include <math.h>
@@ -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)
index 6190c2ec7870a869b9d38f5edf0ae3f500b04739..a0531c3181e91df1bb08e9787ad4cf2b467a75c6 100644 (file)
@@ -16,6 +16,8 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <libm-alias-float.h>
+
 #define truncf __redirect_truncf
 #define __truncf __redirect___truncf
 #include <math.h>
@@ -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)
index 213c2d3c2c763652c97aa41728ec00ee6243f5c5..63ea8302390914285093fa709f6c9461b214e93e 100644 (file)
@@ -18,6 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <machine/asm.h>
+#include <libm-alias-float.h>
 
        .section .rodata
 
@@ -42,4 +43,4 @@ ENTRY(__copysignf)
        retq
 END (__copysignf)
 
-weak_alias (__copysignf, copysignf)
+libm_alias_float (__copysign, copysign)
index 7acafcd1be747f2bba58822695792c1091f12416..327fd27fd5c72441894999a9bd7aa1b0b3349a10 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <errno.h>
+#include <libm-alias-float.h>
 
 /* 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)
index 9956cce7576f6e900828f3b094753a6a1b1bda87..2a47baa9b077e422c2cc8c8ccca1a593fc0be66f 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <libm-alias-float.h>
 
 float
 __fabsf (float x)
 {
   return __builtin_fabsf (x);
 }
-weak_alias (__fabsf, fabsf)
+libm_alias_float (__fabs, fabs)
index 82989feb4bb7113f45c59d7d6558f5d59b24edf5..d5e66b863dd8892b80f4e7b32c24fe996d3dd55e 100644 (file)
@@ -18,6 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <libm-alias-float.h>
 
        .text
 ENTRY(__fmaxf)
@@ -49,4 +50,4 @@ ENTRY(__fmaxf)
 
 2:     ret
 END(__fmaxf)
-weak_alias (__fmaxf, fmaxf)
+libm_alias_float (__fmax, fmax)
index 8e8c9360ac681035cfa4f2434f151647aa49035f..aac433d18806f6d79a5bc97ef7bbba421cec7ce9 100644 (file)
@@ -18,6 +18,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <libm-alias-float.h>
 
        .text
 ENTRY(__fminf)
@@ -49,4 +50,4 @@ ENTRY(__fminf)
 
 2:     ret
 END(__fminf)
-weak_alias (__fminf, fminf)
+libm_alias_float (__fmin, fmin)
index 9edb78bf1deedb84ea41cab4e888d6eb14c0ee85..f1cbc86586668f2d6a471792b6b02308e98f1867 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <libm-alias-float.h>
 
        .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
index fd35a3153b369e918ea48e8096fe10283e291fdc..f608aa948fc299362d9d3cec025ad45c8baec853 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <errno.h>
+#include <libm-alias-float.h>
 
 /* 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)
index 253ba7d6f0bfa41a67eb14c020c69ad4643397ad..c505d6009112d5100cc589ec92a55bccd9b2f97d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <sysdep.h>
 #include <errno.h>
+#include <libm-alias-float.h>
 
 /* 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)
index 2e6f9aaf2b98593c141b837e6940892524c75102..5d237c248021a32a13fdfe94657f7f220db0e71e 100644 (file)
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <libm-alias-float.h>
 
        .text
 ENTRY(__lrintf)
        cvtss2si %xmm0,%eax
        ret
 END(__lrintf)
-weak_alias (__lrintf, lrintf)
+libm_alias_float (__lrint, lrint)