about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-10-12 19:43:50 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-11-29 08:18:00 -0200
commita55430cb0e261834ce7a4e118dd9e0f2b7fb14bc (patch)
tree97c4f0030873b741ebb67bada08444ee864f14bb /sysdeps/sparc/sparc32/sparcv9/fpu/multiarch
parent0609ec0a74f6360ebfb45d048f071a75dfcbc6c7 (diff)
downloadglibc-a55430cb0e261834ce7a4e118dd9e0f2b7fb14bc.tar.gz
glibc-a55430cb0e261834ce7a4e118dd9e0f2b7fb14bc.tar.xz
glibc-a55430cb0e261834ce7a4e118dd9e0f2b7fb14bc.zip
sparc: Assume VIS3 support
This patch assumes VIS3 support by binutils, which is supported since
version 2.22.  This leads to some code simplification, mostly on
multiarch build where there is only one variant instead of previously
two (whether binutils supports VIS3 instructions or not).

For multiarch files where HAVE_AS_VIS3_SUPPORT was checked and
the default implementation was built with a different name, a new
file with (implementation with -generic appended) is added.

Checked on sparc64-linux-gnu and sparcv9-linux-gnu.

	* config.h.in (HAVE_AS_VIS3_SUPPORT): Remove check for VIS3 support.
	* sysdeps/sparc/configure.ac (HAVE_AS_VIS3_SUPPORT): Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c: Likewise.
	* sysdeps//sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c: Likewise.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c: Likewise.
	* sysdeps/sparc/sparc-ifunc.h [!HAVE_AS_VIS3_SUPPORT]
	(SPARC_ASM_VIS3_IFUNC, SPARC_ASM_VIS3_VIS2_IFUNC): Remove macros.
	* sysdeps/sparc/sparc32/sparcv9/Makefile [$(have-as-vis3) != yes]
	(ASFLAGS.o, ASFLAGS-.os, ASFLAGS-.op, ASFLAGS-.oS): Remove rules.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
	($(have-as-vis3) == yes): Remove conditional.
	* sysdeps/sparc/sparc64/Makefile (($(have-as-vis3) == yes)):
	Likewise.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c: New
	file.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c: New
	file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c: New file.
	* sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c: New file.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/sparc/sparc32/sparcv9/fpu/multiarch')
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile8
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c17
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c3
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c12
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c2
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c10
9 files changed, 27 insertions, 43 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
index 2a2d3745ed..62bf6f1431 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile
@@ -1,13 +1,13 @@
 ifeq ($(subdir),math)
-ifeq ($(have-as-vis3),yes)
 libm-sysdep_routines += m_copysignf-vis3 m_copysign-vis3 s_fabs-vis3 \
 			s_fabsf-vis3 s_llrintf-vis3 s_llrint-vis3 \
 			s_rintf-vis3 s_rint-vis3 \
-			s_fmaf-vis3 s_fma-vis3 s_nearbyint-vis3 \
-			s_nearbyintf-vis3 s_fdimf-vis3 s_fdim-vis3
+			s_fmaf-vis3 s_fma-vis3 s_fma-generic s_fmaf-generic \
+			s_nearbyint-vis3 s_nearbyintf-vis3 \
+			s_fdimf-vis3 s_fdim-vis3 s_fdim-generic \
+			s_fdimf-generic
 sysdep_routines += s_copysignf-vis3 s_copysign-vis3
 
 CFLAGS-s_fdimf-vis3.c += -Wa,-Av9d -mvis3
 CFLAGS-s_fdim-vis3.c += -Wa,-Av9d -mvis3
 endif
-endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
new file mode 100644
index 0000000000..30ee54b0c1
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-generic.c
@@ -0,0 +1,4 @@
+#define __fdim __fdim_generic
+#define declare_mgen_alias(t, f)
+
+#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
index ff3acd4086..fe483f6406 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c
@@ -16,23 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <math_ldbl_opt.h>
-# include <first-versions.h>
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <math_ldbl_opt.h>
+#include <first-versions.h>
+#include <sparc-ifunc.h>
+#include <math.h>
 
 extern double __fdim_vis3 (double, double);
 extern double __fdim_generic (double, double);
 
 sparc_libm_ifunc(__fdim, hwcap & HWCAP_SPARC_VIS3 ? __fdim_vis3 : __fdim_generic);
 weak_alias (__fdim, fdim)
-# if LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm_fdiml)
+#if LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm_fdiml)
 compat_symbol (libm, __fdim, fdiml, FIRST_VERSION_libm_fdiml);
-# endif
-
-# define __fdim __fdim_generic
-# define declare_mgen_alias(t, f)
 #endif
-
-#include <math/s_fdim.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
new file mode 100644
index 0000000000..17090b54df
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-generic.c
@@ -0,0 +1,3 @@
+#define __fdimf __fdimf_generic
+#define declare_mgen_alias(t, f)
+#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
index cf1dc9ec6c..ced459383b 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.c
@@ -16,19 +16,11 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
 
 extern float __fdimf_vis3 (float, float);
 extern float __fdimf_generic (float, float);
 
 sparc_libm_ifunc(__fdimf, hwcap & HWCAP_SPARC_VIS3 ? __fdimf_vis3 : __fdimf_generic);
 weak_alias (__fdimf, fdimf)
-
-# define __fdimf __fdimf_generic
-# define declare_mgen_alias(t, f)
-
-#endif
-
-#include <math/s_fdimf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c
new file mode 100644
index 0000000000..e40816facb
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma-generic.c
@@ -0,0 +1,2 @@
+#define __fma __fma_generic
+#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
index 05113c33d3..3d0c1650cf 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
@@ -1,7 +1,6 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
-# include <math_ldbl_opt.h>
+#include <sparc-ifunc.h>
+#include <math.h>
+#include <math_ldbl_opt.h>
 
 extern double __fma_vis3 (double, double, double);
 extern double __fma_generic (double, double, double);
@@ -11,8 +10,3 @@ weak_alias (__fma, fma)
 #if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
 compat_symbol (libm, __fma, fmal, GLIBC_2_1);
 #endif
-
-# define __fma __fma_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fma.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c
new file mode 100644
index 0000000000..218eeb3115
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf-generic.c
@@ -0,0 +1,2 @@
+#define __fmaf __fmaf_generic
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
index 7a273a3b13..5357b47a9a 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fmaf.c
@@ -1,14 +1,8 @@
-#ifdef HAVE_AS_VIS3_SUPPORT
-# include <sparc-ifunc.h>
-# include <math.h>
+#include <sparc-ifunc.h>
+#include <math.h>
 
 extern float __fmaf_vis3 (float, float, float);
 extern float __fmaf_generic (float, float, float);
 
 sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic);
 weak_alias (__fmaf, fmaf)
-
-# define __fmaf __fmaf_generic
-#endif
-
-#include <sysdeps/ieee754/dbl-64/s_fmaf.c>