diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-10-12 19:43:50 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-11-29 08:18:00 -0200 |
commit | a55430cb0e261834ce7a4e118dd9e0f2b7fb14bc (patch) | |
tree | 97c4f0030873b741ebb67bada08444ee864f14bb /sysdeps/sparc/sparc64/fpu | |
parent | 0609ec0a74f6360ebfb45d048f071a75dfcbc6c7 (diff) | |
download | glibc-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/sparc64/fpu')
17 files changed, 85 insertions, 93 deletions
diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile index 03a271dfa4..2ac449672a 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/Makefile +++ b/sysdeps/sparc/sparc64/fpu/multiarch/Makefile @@ -1,13 +1,14 @@ ifeq ($(subdir),math) -ifeq ($(have-as-vis3),yes) libm-sysdep_routines += m_signbitf-vis3 m_signbit-vis3 m_finitef-vis3 \ m_finite-vis3 m_isinff-vis3 m_isinf-vis3 \ m_isnanf-vis3 m_isnan-vis3 s_lrintf-vis3 \ s_lrint-vis3 s_rintf-vis3 s_rint-vis3 \ - s_fmaf-vis3 s_fma-vis3 \ + s_fmaf-vis3 s_fma-vis3 s_fmaf-generic s_fma-generic \ s_nearbyint-vis3 s_nearbyintf-vis3 \ - s_ceilf-vis3 s_ceil-vis3 s_floorf-vis3 \ - s_floor-vis3 s_truncf-vis3 s_trunc-vis3 + s_ceilf-vis3 s_ceil-vis3 s_ceilf-generic \ + s_ceil-generic s_floorf-vis3 s_floor-vis3 \ + s_floorf-generic s_floor-generic s_truncf-vis3 \ + s_trunc-vis3 s_truncf-generic s_trunc-generic sysdep_routines += s_signbitf-vis3 s_signbit-vis3 s_finitef-vis3 \ s_finite-vis3 s_isinff-vis3 s_isinf-vis3 \ s_isnanf-vis3 s_isnan-vis3 @@ -19,4 +20,3 @@ CFLAGS-s_floor-vis3.c += -Wa,-Av9d -mvis3 CFLAGS-s_truncf-vis3.c += -Wa,-Av9d -mvis3 CFLAGS-s_trunc-vis3.c += -Wa,-Av9d -mvis3 endif -endif diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c new file mode 100644 index 0000000000..febea745e1 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil-generic.c @@ -0,0 +1,2 @@ +#define __ceil __ceil_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c index efa05e94df..cfd5396375 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c @@ -16,17 +16,14 @@ 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 double __ceil_vis3 (double); -extern double __ceil_generic (double); +extern __typeof (ceil) __ceil_vis3 attribute_hidden; +extern __typeof (ceil) __ceil_generic attribute_hidden; -sparc_libm_ifunc(__ceil, hwcap & HWCAP_SPARC_VIS3 ? __ceil_vis3 : __ceil_generic); +sparc_libm_ifunc (__ceil, + hwcap & HWCAP_SPARC_VIS3 + ? __ceil_vis3 + : __ceil_generic) weak_alias (__ceil, ceil) - -# define __ceil __ceil_generic -#endif - -#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c new file mode 100644 index 0000000000..ce75035954 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf-generic.c @@ -0,0 +1,2 @@ +#define __ceilf __ceilf_generic +#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c index 62ada7fd2a..81897b5e54 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c @@ -16,17 +16,14 @@ 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 __ceilf_vis3 (float); -extern float __ceilf_generic (float); +extern __typeof (ceilf) __ceilf_vis3 attribute_hidden; +extern __typeof (ceilf) __ceilf_generic attribute_hidden; -sparc_libm_ifunc(__ceilf, hwcap & HWCAP_SPARC_VIS3 ? __ceilf_vis3 : __ceilf_generic); +sparc_libm_ifunc (__ceilf, + hwcap & HWCAP_SPARC_VIS3 + ? __ceilf_vis3 + : __ceilf_generic); weak_alias (__ceilf, ceilf) - -# define __ceilf __ceilf_generic -#endif - -#include <sysdeps/ieee754/flt-32/s_ceilf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c new file mode 100644 index 0000000000..0f3361a9fb --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor-generic.c @@ -0,0 +1,2 @@ +#define __floor __floor_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c index d097f68866..9d71158cdb 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c @@ -16,17 +16,14 @@ 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 double __floor_vis3 (double); -extern double __floor_generic (double); +extern __typeof (floor) __floor_vis3 attribute_hidden; +extern __typeof (floor) __floor_generic attribute_hidden; -sparc_libm_ifunc(__floor, hwcap & HWCAP_SPARC_VIS3 ? __floor_vis3 : __floor_generic); +sparc_libm_ifunc (__floor, + hwcap & HWCAP_SPARC_VIS3 + ? __floor_vis3 + : __floor_generic); weak_alias (__floor, floor) - -# define __floor __floor_generic -#endif - -#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c new file mode 100644 index 0000000000..28c377b787 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf-generic.c @@ -0,0 +1,2 @@ +#define __floorf __floorf_generic +#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c index 2a6c710349..09d0a4524d 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c @@ -16,17 +16,14 @@ 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 __floorf_vis3 (float); -extern float __floorf_generic (float); +extern __typeof (floorf) __floorf_vis3 attribute_hidden; +extern __typeof (floorf) __floorf_generic attribute_hidden; -sparc_libm_ifunc(__floorf, hwcap & HWCAP_SPARC_VIS3 ? __floorf_vis3 : __floorf_generic); +sparc_libm_ifunc (__floorf, + hwcap & HWCAP_SPARC_VIS3 + ? __floorf_vis3 + : __floorf_generic); weak_alias (__floorf, floorf) - -# define __floorf __floorf_generic -#endif - -#include <sysdeps/ieee754/flt-32/s_floorf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma-generic.c new file mode 100644 index 0000000000..e40816facb --- /dev/null +++ b/sysdeps/sparc/sparc64/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/sparc64/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c index 3f2f1622c8..1b2701cadb 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c @@ -1,14 +1,11 @@ -#ifdef HAVE_AS_VIS3_SUPPORT -# include <sparc-ifunc.h> -# include <math.h> +#include <sparc-ifunc.h> +#include <math.h> -extern double __fma_vis3 (double, double, double); -extern double __fma_generic (double, double, double); +extern __typeof (fma) __fma_vis3 attribute_hidden; +extern __typeof (fma) __fma_generic attribute_hidden; -sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic); +sparc_libm_ifunc (__fma, + hwcap & HWCAP_SPARC_FMAF + ? __fma_vis3 + : __fma_generic); weak_alias (__fma, fma) - -# define __fma __fma_generic -#endif - -#include <sysdeps/ieee754/dbl-64/s_fma.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf-generic.c new file mode 100644 index 0000000000..218eeb3115 --- /dev/null +++ b/sysdeps/sparc/sparc64/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/sparc64/fpu/multiarch/s_fmaf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c index 7a273a3b13..dbed10e19a 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c @@ -1,14 +1,11 @@ -#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); +extern __typeof (fmaf) __fmaf_vis3 attribute_hidden; +extern __typeof (fmaf) __fmaf_generic attribute_hidden; -sparc_libm_ifunc(__fmaf, hwcap & HWCAP_SPARC_FMAF ? __fmaf_vis3 : __fmaf_generic); +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> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c new file mode 100644 index 0000000000..00abd2a643 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc-generic.c @@ -0,0 +1,2 @@ +#define __trunc __trunc_generic +#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c index dc67f423f1..3fd9cc0041 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c @@ -16,17 +16,14 @@ 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 double __trunc_vis3 (double); -extern double __trunc_generic (double); +extern __typeof (trunc) __trunc_vis3 attribute_hidden; +extern __typeof (trunc) __trunc_generic attribute_hidden; -sparc_libm_ifunc(__trunc, hwcap & HWCAP_SPARC_VIS3 ? __trunc_vis3 : __trunc_generic); +sparc_libm_ifunc (__trunc, + hwcap & HWCAP_SPARC_VIS3 + ? __trunc_vis3 + : __trunc_generic); weak_alias (__trunc, trunc) - -# define __trunc __trunc_generic -#endif - -#include <sysdeps/ieee754/dbl-64/wordsize-64/s_trunc.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c new file mode 100644 index 0000000000..7e5d91e742 --- /dev/null +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf-generic.c @@ -0,0 +1,2 @@ +#define __truncf __truncf_generic +#include <sysdeps/ieee754/flt-32/s_truncf.c> diff --git a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c index 980a313ae1..3c1fa36cf7 100644 --- a/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c +++ b/sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c @@ -16,17 +16,14 @@ 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 __truncf_vis3 (float); -extern float __truncf_generic (float); +extern __typeof (truncf) __truncf_vis3 attribute_hidden; +extern __typeof (truncf) __truncf_generic attribute_hidden; -sparc_libm_ifunc(__truncf, hwcap & HWCAP_SPARC_VIS3 ? __truncf_vis3 : __truncf_generic); +sparc_libm_ifunc (__truncf, + hwcap & HWCAP_SPARC_VIS3 + ? __truncf_vis3 + : __truncf_generic) weak_alias (__truncf, truncf) - -# define __truncf __truncf_generic -#endif - -#include <sysdeps/ieee754/flt-32/s_truncf.c> |