aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc32/power4/fpu
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-03-08 16:55:52 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-06-12 11:46:26 -0300
commite41d66e41ae0626156b3eace8e15aecff3044695 (patch)
tree870f599d3daea03e6de16399c7b4a270332ee738 /sysdeps/powerpc/powerpc32/power4/fpu
parent21bd039bb41a59cdbd6c93670433e3b473720653 (diff)
downloadglibc-e41d66e41ae0626156b3eace8e15aecff3044695.tar
glibc-e41d66e41ae0626156b3eace8e15aecff3044695.tar.gz
glibc-e41d66e41ae0626156b3eace8e15aecff3044695.tar.bz2
glibc-e41d66e41ae0626156b3eace8e15aecff3044695.zip
powerpc: copysign cleanup
GCC always expand copysign{f} for all possible cpus, so calling the libm is only done if user explicitly states to disable the builtin (which is done usually not for performance reason). So to provide ifunc variant for copysign is just unrequired complexity, since libm will be called on non-performance critical code. This patch removes both powerpc32 and powerpc64 ifunc variants and consolidates the powerpc implementation on sysdeps/powerpc/fpu/s_copysign{f}.c using compiler builtins. Checked on powerpc-linux-gnu (built without --with-cpu, with --with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch), powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+ and --disable-multi-arch). * sysdeps/powerpc/fpu/s_copysign.c: New file. * sysdeps/powerpc/fpu/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Remove file. * sysdeps/powerpc/powerpc32/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile (sysdep_routines, libm-sysdep_routines): Remove s_copysign-power6 and s_copysign-ppc32. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S: Remove file. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c: Likewise. * sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc32/power6/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile (sysdeps_calls): Remove s_copysign-power6 s_copysign-ppc64. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-power6.S: Remove file. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysign.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/multiarch/s_copysignf.c: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc64/fpu/s_copysignf.S: Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysign.S: Likewise. * sysdeps/powerpc/powerpc64/power6/fpu/s_copysignf.S: Likewise. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Diffstat (limited to 'sysdeps/powerpc/powerpc32/power4/fpu')
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile6
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S33
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S34
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c45
-rw-r--r--sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c34
5 files changed, 3 insertions, 149 deletions
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
index cf38e347f2..7008e775b7 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
@@ -2,8 +2,8 @@ ifeq ($(subdir),math)
sysdep_routines += s_isnan-power7 s_isnan-power6 s_isnan-power5 s_isnan-ppc32 \
s_isnanf-power6 s_isnanf-power5 s_isinf-power7 \
s_isinf-ppc32 s_isinff-ppc32 s_finite-power7 \
- s_finite-ppc32 s_finitef-ppc32 s_copysign-power6 \
- s_copysign-ppc32 s_modf-power5+ s_modf-ppc32 \
+ s_finite-ppc32 s_finitef-ppc32 \
+ s_modf-power5+ s_modf-ppc32 \
s_modff-power5+ s_modff-ppc32
libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \
@@ -18,7 +18,7 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-ppc32 s_llrint-power6 \
s_floorf-ppc32 s_round-power5+ s_round-ppc32 \
s_roundf-power5+ s_roundf-ppc32 s_trunc-power5+ \
s_trunc-ppc32 s_truncf-power5+ s_truncf-ppc32 \
- s_copysign-power6 s_copysign-ppc32 s_lround-power6x \
+ s_lround-power6x \
s_lround-power5+ s_lround-ppc32 s_lrint-power6x \
s_lrint-ppc32 s_modf-power5+ s_modf-ppc32 \
s_modff-power5+ s_modff-ppc32 s_logbl-power7 \
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S
deleted file mode 100644
index 24ab12e41e..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-power6.S
+++ /dev/null
@@ -1,33 +0,0 @@
-/* copysign(). PowerPC32/POWER6 version.
- Copyright (C) 2013-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef hidden_def
-#define hidden_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, alias, ver)
-
-#define __copysign __copysign_power6
-
-#include <sysdeps/powerpc/powerpc32/power6/fpu/s_copysign.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S
deleted file mode 100644
index 0c283c65b0..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign-ppc32.S
+++ /dev/null
@@ -1,34 +0,0 @@
-/* copysign(). PowerPC32 default version.
- Copyright (C) 2013-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a, b, c, d)
-
-#define __copysign __copysign_ppc32
-#undef hidden_def
-#define hidden_def(name)
- strong_alias (__copysign_ppc32, __GI___copysign)
-
-#include <sysdeps/powerpc/powerpc32/fpu/s_copysign.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
deleted file mode 100644
index f9d1795732..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysign.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Multiple versions of copysign.
- Copyright (C) 2013-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define NO_MATH_REDIRECT
-/* Redefine copysign so that the compiler won't complain about the type
- mismatch with the IFUNC selector in strong_alias below. */
-#undef __copysign
-#define __copysign __redirect_copysign
-#include <math.h>
-#include <math_ldbl_opt.h>
-#undef __copysign
-#include <shlib-compat.h>
-#include "init-arch.h"
-#include <libm-alias-double.h>
-
-extern __typeof (__redirect_copysign) __copysign_ppc32 attribute_hidden;
-extern __typeof (__redirect_copysign) __copysign_power6 attribute_hidden;
-
-extern __typeof (__redirect_copysign) __libm_copysign;
-libc_ifunc (__libm_copysign,
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __copysign_power6
- : __copysign_ppc32);
-
-strong_alias (__libm_copysign, __copysign)
-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/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c
deleted file mode 100644
index 12354d0872..0000000000
--- a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_copysignf.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Multiple versions of copysignf.
- Copyright (C) 2013-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#define NO_MATH_REDIRECT
-#include <math.h>
-#include <shlib-compat.h>
-#include "init-arch.h"
-#include <libm-alias-float.h>
-
-/* It's safe to use double-precision implementation for single-precision. */
-extern __typeof (__copysignf) __copysign_ppc32 attribute_hidden;
-extern __typeof (__copysignf) __copysign_power6 attribute_hidden;
-
-libc_ifunc (__copysignf,
- (hwcap & PPC_FEATURE_ARCH_2_05)
- ? __copysign_power6
- : __copysign_ppc32);
-
-libm_alias_float (__copysign, copysign)