From 0b5395f052ee09cd7e3d219af4e805c38058afb5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 13 Aug 2015 03:38:47 -0700 Subject: Update x86_64 multiarch functions for This patch updates x86_64 multiarch functions to use the newly defined HAS_CPU_FEATURE, HAS_ARCH_FEATURE and LOAD_RTLD_GLOBAL_RO_RDX from . * sysdeps/x86_64/fpu/multiarch/e_asin.c: Replace HAS_XXX with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX). * sysdeps/x86_64/fpu/multiarch/e_atan2.c: Likewise. * sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise. * sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise. * sysdeps/x86_64/fpu/multiarch/e_pow.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_fma.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_fmaf.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise. * sysdeps/x86_64/fpu/multiarch/s_ceil.S: Use LOAD_RTLD_GLOBAL_RO_RDX and HAS_CPU_FEATURE (SSE4_1). * sysdeps/x86_64/fpu/multiarch/s_ceilf.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_floor.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_floorf.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_nearbyint.S : Likewise. * sysdeps/x86_64/fpu/multiarch/s_nearbyintf.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_rintf.S: Likewise. * sysdeps/x86_64/fpu/multiarch/s_rintf.S : Likewise. * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Likewise. * sysdeps/x86_64/multiarch/sched_cpucount.c: Likewise. * sysdeps/x86_64/multiarch/strstr.c: Likewise. * sysdeps/x86_64/multiarch/memmove.c: Likewise. * sysdeps/x86_64/multiarch/memmove_chk.c: Likewise. * sysdeps/x86_64/multiarch/test-multiarch.c: Likewise. * sysdeps/x86_64/multiarch/memcmp.S: Remove __init_cpu_features call. Add LOAD_RTLD_GLOBAL_RO_RDX. Replace HAS_XXX with HAS_CPU_FEATURE/HAS_ARCH_FEATURE (XXX). * sysdeps/x86_64/multiarch/memcpy.S: Likewise. * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise. * sysdeps/x86_64/multiarch/mempcpy.S: Likewise. * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise. * sysdeps/x86_64/multiarch/memset.S: Likewise. * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. * sysdeps/x86_64/multiarch/strcat.S: Likewise. * sysdeps/x86_64/multiarch/strchr.S: Likewise. * sysdeps/x86_64/multiarch/strcmp.S: Likewise. * sysdeps/x86_64/multiarch/strcpy.S: Likewise. * sysdeps/x86_64/multiarch/strcspn.S: Likewise. * sysdeps/x86_64/multiarch/strspn.S: Likewise. * sysdeps/x86_64/multiarch/wcscpy.S: Likewise. * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise. --- sysdeps/x86_64/fpu/multiarch/e_log.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64/fpu/multiarch/e_log.c') diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c index 98054737bd..04e9ac553b 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_log.c +++ b/sysdeps/x86_64/fpu/multiarch/e_log.c @@ -8,14 +8,15 @@ extern double __ieee754_log_avx (double); # ifdef HAVE_FMA4_SUPPORT extern double __ieee754_log_fma4 (double); # else -# undef HAS_FMA4 -# define HAS_FMA4 0 +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 # define __ieee754_log_fma4 ((void *) 0) # endif libm_ifunc (__ieee754_log, - HAS_FMA4 ? __ieee754_log_fma4 - : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2)); + HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_log_fma4 + : (HAS_ARCH_FEATURE (AVX_Usable) + ? __ieee754_log_avx : __ieee754_log_sse2)); strong_alias (__ieee754_log, __log_finite) # define __ieee754_log __ieee754_log_sse2 -- cgit v1.2.3 From 1b12cd7f4d210a743155d779b2225a0c18c416ff Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 8 Oct 2015 15:59:32 +0000 Subject: Remove configure tests for AVX support. GCC added support for -mavx and -msse2avx in version 4.4. Thus the configure tests for this support are obsolete, and this patch removes them. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by this patch). * sysdeps/i386/configure.ac (libc_cv_cc_avx): Remove configure test. (libc_cv_cc_sse2avx): Likewise. * sysdeps/i386/configure: Regenerated. * sysdeps/i386/i686/multiarch/Makefile [$(subdir)$(config-cflags-avx) = mathyes]: Change conditional to [$(subdir) = math]. * sysdeps/i386/i686/multiarch/s_fma-fma.c [HAVE_AVX_SUPPORT]: Make code unconditional. * sysdeps/i386/i686/multiarch/s_fma.c [HAVE_AVX_SUPPORT]: Likewise. * sysdeps/i386/i686/multiarch/s_fmaf-fma.c [HAVE_AVX_SUPPORT]: Likewise. * sysdeps/i386/i686/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/configure.ac (libc_cv_cc_avx): Remove configure test. (libc_cv_cc_sse2avx): Likewise. * sysdeps/x86_64/configure: Regenerated. * sysdeps/x86_64/Makefile [$(config-cflags-avx) = yes]: Make code unconditional. * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile) [HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT]: Make code unconditional. (_dl_runtime_profile) [!(HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT)]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/Makefile [$(config-cflags-sse2avx) = yes]: Make code unconditional. * sysdeps/x86_64/fpu/multiarch/e_atan2.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/e_exp.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/e_log.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/s_atan.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/s_sin.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/s_tan.c [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. * sysdeps/x86_64/multiarch/strcmp.S [HAVE_AVX_SUPPORT]: Likewise. * config.h.in (HAVE_AVX_SUPPORT): Remove #undef. (HAVE_SSE2AVX_SUPPORT): Likewise. --- ChangeLog | 51 +++++++++++++++++++++++++++++++ config.h.in | 6 ---- sysdeps/i386/configure | 52 -------------------------------- sysdeps/i386/configure.ac | 20 ------------ sysdeps/i386/i686/multiarch/Makefile | 2 +- sysdeps/i386/i686/multiarch/s_fma-fma.c | 2 -- sysdeps/i386/i686/multiarch/s_fma.c | 4 +-- sysdeps/i386/i686/multiarch/s_fmaf-fma.c | 2 -- sysdeps/i386/i686/multiarch/s_fmaf.c | 4 +-- sysdeps/x86_64/Makefile | 7 +---- sysdeps/x86_64/configure | 52 -------------------------------- sysdeps/x86_64/configure.ac | 20 ------------ sysdeps/x86_64/dl-trampoline.h | 4 --- sysdeps/x86_64/fpu/multiarch/Makefile | 2 -- sysdeps/x86_64/fpu/multiarch/e_atan2.c | 22 ++++++-------- sysdeps/x86_64/fpu/multiarch/e_exp.c | 22 ++++++-------- sysdeps/x86_64/fpu/multiarch/e_log.c | 22 ++++++-------- sysdeps/x86_64/fpu/multiarch/s_atan.c | 20 ++++++------ sysdeps/x86_64/fpu/multiarch/s_fma.c | 17 +++++------ sysdeps/x86_64/fpu/multiarch/s_fmaf.c | 17 +++++------ sysdeps/x86_64/fpu/multiarch/s_sin.c | 26 ++++++++-------- sysdeps/x86_64/fpu/multiarch/s_tan.c | 20 ++++++------ sysdeps/x86_64/multiarch/strcmp.S | 22 +++++--------- 23 files changed, 137 insertions(+), 279 deletions(-) (limited to 'sysdeps/x86_64/fpu/multiarch/e_log.c') diff --git a/ChangeLog b/ChangeLog index 6b2e5d3b9f..82a3f5f0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,54 @@ +2015-10-08 Joseph Myers + + * sysdeps/i386/configure.ac (libc_cv_cc_avx): Remove configure + test. + (libc_cv_cc_sse2avx): Likewise. + * sysdeps/i386/configure: Regenerated. + * sysdeps/i386/i686/multiarch/Makefile + [$(subdir)$(config-cflags-avx) = mathyes]: Change conditional to + [$(subdir) = math]. + * sysdeps/i386/i686/multiarch/s_fma-fma.c [HAVE_AVX_SUPPORT]: Make + code unconditional. + * sysdeps/i386/i686/multiarch/s_fma.c [HAVE_AVX_SUPPORT]: + Likewise. + * sysdeps/i386/i686/multiarch/s_fmaf-fma.c [HAVE_AVX_SUPPORT]: + Likewise. + * sysdeps/i386/i686/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]: + Likewise. + * sysdeps/x86_64/configure.ac (libc_cv_cc_avx): Remove configure + test. + (libc_cv_cc_sse2avx): Likewise. + * sysdeps/x86_64/configure: Regenerated. + * sysdeps/x86_64/Makefile [$(config-cflags-avx) = yes]: Make code + unconditional. + * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_profile) + [HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT]: Make code + unconditional. + (_dl_runtime_profile) + [!(HAVE_AVX_SUPPORT || HAVE_AVX512_ASM_SUPPORT)]: Remove + conditional code. + * sysdeps/x86_64/fpu/multiarch/Makefile + [$(config-cflags-sse2avx) = yes]: Make code unconditional. + * sysdeps/x86_64/fpu/multiarch/e_atan2.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/fpu/multiarch/e_exp.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/fpu/multiarch/e_log.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/fpu/multiarch/s_atan.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_AVX_SUPPORT]: + Likewise. + * sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_AVX_SUPPORT]: + Likewise. + * sysdeps/x86_64/fpu/multiarch/s_sin.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/fpu/multiarch/s_tan.c + [HAVE_FMA4_SUPPORT || HAVE_AVX_SUPPORT]: Likewise. + * sysdeps/x86_64/multiarch/strcmp.S [HAVE_AVX_SUPPORT]: Likewise. + * config.h.in (HAVE_AVX_SUPPORT): Remove #undef. + (HAVE_SSE2AVX_SUPPORT): Likewise. + 2015-10-07 Paul Pluzhnikov * stdio-common/tst-printf-bz18872.sh: Use attribute optimize diff --git a/config.h.in b/config.h.in index 7663376032..d9aba90d30 100644 --- a/config.h.in +++ b/config.h.in @@ -76,12 +76,6 @@ /* Define if _rtld_local structure should be forced into .sdata section. */ #undef HAVE_SDATA_SECTION -/* Define if gcc supports AVX. */ -#undef HAVE_AVX_SUPPORT - -/* Define if gcc supports VEX encoding. */ -#undef HAVE_SSE2AVX_SUPPORT - /* Define if compiler supports AVX512. */ #undef HAVE_AVX512_SUPPORT diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure index 8a7837ec46..1b39cbae08 100644 --- a/sysdeps/i386/configure +++ b/sysdeps/i386/configure @@ -114,58 +114,6 @@ $as_echo "$libc_cv_as_i686" >&6; } config_vars="$config_vars config-asflags-i686 = $libc_cv_as_i686" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5 -$as_echo_n "checking for AVX support... " >&6; } -if ${libc_cv_cc_avx+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_avx=yes -else - libc_cv_cc_avx=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5 -$as_echo "$libc_cv_cc_avx" >&6; } -if test $libc_cv_cc_avx = yes; then - $as_echo "#define HAVE_AVX_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -config-cflags-avx = $libc_cv_cc_avx" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5 -$as_echo_n "checking for AVX encoding of SSE instructions... " >&6; } -if ${libc_cv_cc_sse2avx+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_sse2avx=yes -else - libc_cv_cc_sse2avx=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5 -$as_echo "$libc_cv_cc_sse2avx" >&6; } -if test $libc_cv_cc_sse2avx = yes; then - $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -config-cflags-sse2avx = $libc_cv_cc_sse2avx" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5 $as_echo_n "checking for FMA4 support... " >&6; } if ${libc_cv_cc_fma4+:} false; then : diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac index e7af05600f..965fa73489 100644 --- a/sysdeps/i386/configure.ac +++ b/sysdeps/i386/configure.ac @@ -42,26 +42,6 @@ LIBC_TRY_CC_OPTION([-Wa,-mtune=i686], ]) LIBC_CONFIG_VAR([config-asflags-i686], [$libc_cv_as_i686]) -dnl Check if -mavx works. -AC_CACHE_CHECK(for AVX support, libc_cv_cc_avx, [dnl -LIBC_TRY_CC_OPTION([-mavx], [libc_cv_cc_avx=yes], [libc_cv_cc_avx=no]) -]) -if test $libc_cv_cc_avx = yes; then - AC_DEFINE(HAVE_AVX_SUPPORT) -fi -LIBC_CONFIG_VAR([config-cflags-avx], [$libc_cv_cc_avx]) - -dnl Check if -msse2avx works. -AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl -LIBC_TRY_CC_OPTION([-msse2avx], - [libc_cv_cc_sse2avx=yes], - [libc_cv_cc_sse2avx=no]) -]) -if test $libc_cv_cc_sse2avx = yes; then - AC_DEFINE(HAVE_SSE2AVX_SUPPORT) -fi -LIBC_CONFIG_VAR([config-cflags-sse2avx], [$libc_cv_cc_sse2avx]) - dnl Check if -mfma4 works. AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no]) diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile index 7ccd9c7b79..700010d969 100644 --- a/sysdeps/i386/i686/multiarch/Makefile +++ b/sysdeps/i386/i686/multiarch/Makefile @@ -38,7 +38,7 @@ sysdep_routines += wcscmp-sse2 wcscmp-c wcslen-sse2 wcslen-c \ wcschr-c wcsrchr-sse2 wcsrchr-c wcscpy-ssse3 wcscpy-c endif -ifeq (mathyes,$(subdir)$(config-cflags-avx)) +ifeq ($(subdir),math) libm-sysdep_routines += s_fma-fma s_fmaf-fma CFLAGS-s_fma-fma.c += -mavx -mfpmath=sse CFLAGS-s_fmaf-fma.c += -mavx -mfpmath=sse diff --git a/sysdeps/i386/i686/multiarch/s_fma-fma.c b/sysdeps/i386/i686/multiarch/s_fma-fma.c index 1a8b48bd58..23a7f04e12 100644 --- a/sysdeps/i386/i686/multiarch/s_fma-fma.c +++ b/sysdeps/i386/i686/multiarch/s_fma-fma.c @@ -19,11 +19,9 @@ #include -#ifdef HAVE_AVX_SUPPORT double __fma_fma (double x, double y, double z) { asm ("vfmadd213sd %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z)); return x; } -#endif diff --git a/sysdeps/i386/i686/multiarch/s_fma.c b/sysdeps/i386/i686/multiarch/s_fma.c index cf2ede5309..8d918f0650 100644 --- a/sysdeps/i386/i686/multiarch/s_fma.c +++ b/sysdeps/i386/i686/multiarch/s_fma.c @@ -19,7 +19,6 @@ #include -#ifdef HAVE_AVX_SUPPORT #include #include @@ -30,7 +29,6 @@ libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable) ? __fma_fma : __fma_ia32); weak_alias (__fma, fma) -# define __fma __fma_ia32 -#endif +#define __fma __fma_ia32 #include diff --git a/sysdeps/i386/i686/multiarch/s_fmaf-fma.c b/sysdeps/i386/i686/multiarch/s_fmaf-fma.c index 1775ef5dd0..4904f05eed 100644 --- a/sysdeps/i386/i686/multiarch/s_fmaf-fma.c +++ b/sysdeps/i386/i686/multiarch/s_fmaf-fma.c @@ -19,11 +19,9 @@ #include -#ifdef HAVE_AVX_SUPPORT float __fmaf_fma (float x, float y, float z) { asm ("vfmadd213ss %3, %2, %0" : "=x" (x) : "0" (x), "x" (y), "xm" (z)); return x; } -#endif diff --git a/sysdeps/i386/i686/multiarch/s_fmaf.c b/sysdeps/i386/i686/multiarch/s_fmaf.c index 526cdf16e4..2476d0fcbf 100644 --- a/sysdeps/i386/i686/multiarch/s_fmaf.c +++ b/sysdeps/i386/i686/multiarch/s_fmaf.c @@ -19,7 +19,6 @@ #include -#ifdef HAVE_AVX_SUPPORT #include #include @@ -30,7 +29,6 @@ libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma : __fmaf_ia32); weak_alias (__fmaf, fmaf) -# define __fmaf __fmaf_ia32 -#endif +#define __fmaf __fmaf_ia32 #include diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index 6c283187a8..099792d6e6 100644 --- a/sysdeps/x86_64/Makefile +++ b/sysdeps/x86_64/Makefile @@ -43,10 +43,7 @@ tests-pie += $(quad-pie-test) $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o -tests += tst-audit3 tst-audit4 tst-audit5 tst-audit10 -ifeq (yes,$(config-cflags-avx)) -tests += tst-audit6 tst-audit7 -endif +tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 tst-audit10 tests += tst-split-dynreloc LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds @@ -84,7 +81,6 @@ $(objpfx)tst-audit10: $(objpfx)tst-auditmod10a.so $(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so -ifeq (yes,$(config-cflags-avx)) AVX-CFLAGS=-mavx ifeq (yes,$(config-cflags-novzeroupper)) AVX-CFLAGS+=-mno-vzeroupper @@ -95,7 +91,6 @@ CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS) CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS) CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS) CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS) -endif ifeq (yes,$(config-cflags-avx512)) AVX512-CFLAGS = -mavx512f CFLAGS-tst-audit10.c += $(AVX512-CFLAGS) diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index 1f54c76f5f..ef234d5c50 100644 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -43,32 +43,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX support" >&5 -$as_echo_n "checking for AVX support... " >&6; } -if ${libc_cv_cc_avx+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -mavx -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_avx=yes -else - libc_cv_cc_avx=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx" >&5 -$as_echo "$libc_cv_cc_avx" >&6; } -if test $libc_cv_cc_avx = yes; then - $as_echo "#define HAVE_AVX_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -config-cflags-avx = $libc_cv_cc_avx" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support in assembler" >&5 $as_echo_n "checking for AVX512 support in assembler... " >&6; } if ${libc_cv_asm_avx512+:} false; then : @@ -123,32 +97,6 @@ fi config_vars="$config_vars config-cflags-avx512 = $libc_cv_cc_avx512" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5 -$as_echo_n "checking for AVX encoding of SSE instructions... " >&6; } -if ${libc_cv_cc_sse2avx+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_sse2avx=yes -else - libc_cv_cc_sse2avx=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5 -$as_echo "$libc_cv_cc_sse2avx" >&6; } -if test $libc_cv_cc_sse2avx = yes; then - $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -config-cflags-sse2avx = $libc_cv_cc_sse2avx" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5 $as_echo_n "checking for FMA4 support... " >&6; } if ${libc_cv_cc_fma4+:} false; then : diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index 68824f7efe..76a3265959 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -5,15 +5,6 @@ AC_CHECK_HEADER([cpuid.h], , [AC_MSG_ERROR([gcc must provide the header])], [/* No default includes. */]) -dnl Check if -mavx works. -AC_CACHE_CHECK(for AVX support, libc_cv_cc_avx, [dnl -LIBC_TRY_CC_OPTION([-mavx], [libc_cv_cc_avx=yes], [libc_cv_cc_avx=no]) -]) -if test $libc_cv_cc_avx = yes; then - AC_DEFINE(HAVE_AVX_SUPPORT) -fi -LIBC_CONFIG_VAR([config-cflags-avx], [$libc_cv_cc_avx]) - dnl Check if asm supports AVX512. AC_CACHE_CHECK(for AVX512 support in assembler, libc_cv_asm_avx512, [dnl cat > conftest.s <<\EOF @@ -39,17 +30,6 @@ if test $libc_cv_cc_avx512 = yes; then fi LIBC_CONFIG_VAR([config-cflags-avx512], [$libc_cv_cc_avx512]) -dnl Check if -msse2avx works. -AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl -LIBC_TRY_CC_OPTION([-msse2avx], - [libc_cv_cc_sse2avx=yes], - [libc_cv_cc_sse2avx=no]) -]) -if test $libc_cv_cc_sse2avx = yes; then - AC_DEFINE(HAVE_SSE2AVX_SUPPORT) -fi -LIBC_CONFIG_VAR([config-cflags-sse2avx], [$libc_cv_cc_sse2avx]) - dnl Check if -mfma4 works. AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no]) diff --git a/sysdeps/x86_64/dl-trampoline.h b/sysdeps/x86_64/dl-trampoline.h index dd6d7c7835..c97c71d90b 100644 --- a/sysdeps/x86_64/dl-trampoline.h +++ b/sysdeps/x86_64/dl-trampoline.h @@ -204,14 +204,10 @@ _dl_runtime_profile: /* Actively align the La_x86_64_regs structure. */ and $-VEC_SIZE, %RSP_LP -# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT /* sizeof(La_x86_64_regs). Need extra space for 8 SSE registers to detect if any xmm0-xmm7 registers are changed by audit module. */ sub $(LR_SIZE + XMM_SIZE*8), %RSP_LP -# else - sub $LR_SIZE, %RSP_LP # sizeof(La_x86_64_regs) -# endif movq %rsp, 24(%rbx) /* Fill the La_x86_64_regs structure. */ diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile index 631534a5ce..ad7bbf0aec 100644 --- a/sysdeps/x86_64/fpu/multiarch/Makefile +++ b/sysdeps/x86_64/fpu/multiarch/Makefile @@ -33,7 +33,6 @@ CFLAGS-s_sin-fma4.c = -mfma4 CFLAGS-s_tan-fma4.c = -mfma4 endif -ifeq ($(config-cflags-sse2avx),yes) libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \ e_atan2-avx s_sin-avx s_tan-avx \ mplog-avx mpa-avx slowexp-avx \ @@ -50,7 +49,6 @@ CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX endif -endif ifeq ($(subdir),mathvec) libmvec-sysdep_routines += svml_d_cos2_core_sse4 svml_d_cos4_core_avx2 \ diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c index 269dcc9165..8edb8b635b 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c +++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c @@ -1,17 +1,16 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include -# include +#include +#include +#include extern double __ieee754_atan2_sse2 (double, double); extern double __ieee754_atan2_avx (double, double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_atan2_fma4 (double, double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_atan2_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __ieee754_atan2_fma4 ((void *) 0) +#endif libm_ifunc (__ieee754_atan2, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_atan2_fma4 @@ -19,8 +18,7 @@ libm_ifunc (__ieee754_atan2, ? __ieee754_atan2_avx : __ieee754_atan2_sse2)); strong_alias (__ieee754_atan2, __atan2_finite) -# define __ieee754_atan2 __ieee754_atan2_sse2 -#endif +#define __ieee754_atan2 __ieee754_atan2_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c index 9c124ca11a..84e62a0491 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_exp.c +++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c @@ -1,17 +1,16 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include -# include +#include +#include +#include extern double __ieee754_exp_sse2 (double); extern double __ieee754_exp_avx (double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_exp_fma4 (double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_exp_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __ieee754_exp_fma4 ((void *) 0) +#endif libm_ifunc (__ieee754_exp, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_exp_fma4 @@ -19,8 +18,7 @@ libm_ifunc (__ieee754_exp, ? __ieee754_exp_avx : __ieee754_exp_sse2)); strong_alias (__ieee754_exp, __exp_finite) -# define __ieee754_exp __ieee754_exp_sse2 -#endif +#define __ieee754_exp __ieee754_exp_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c index 04e9ac553b..90e21ec1ec 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_log.c +++ b/sysdeps/x86_64/fpu/multiarch/e_log.c @@ -1,17 +1,16 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include -# include +#include +#include +#include extern double __ieee754_log_sse2 (double); extern double __ieee754_log_avx (double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_log_fma4 (double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_log_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __ieee754_log_fma4 ((void *) 0) +#endif libm_ifunc (__ieee754_log, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_log_fma4 @@ -19,8 +18,7 @@ libm_ifunc (__ieee754_log, ? __ieee754_log_avx : __ieee754_log_sse2)); strong_alias (__ieee754_log, __log_finite) -# define __ieee754_log __ieee754_log_sse2 -#endif +#define __ieee754_log __ieee754_log_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c index 57b5c65f67..8d2b004522 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_atan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c @@ -1,23 +1,21 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include +#include +#include extern double __atan_sse2 (double); extern double __atan_avx (double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __atan_fma4 (double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __atan_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __atan_fma4 ((void *) 0) +#endif libm_ifunc (atan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __atan_fma4 : HAS_ARCH_FEATURE (AVX_Usable) ? __atan_avx : __atan_sse2)); -# define atan __atan_sse2 -#endif +#define atan __atan_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_fma.c b/sysdeps/x86_64/fpu/multiarch/s_fma.c index 78e7732245..630c99c3ce 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_fma.c +++ b/sysdeps/x86_64/fpu/multiarch/s_fma.c @@ -21,8 +21,6 @@ #include #include -#ifdef HAVE_AVX_SUPPORT - extern double __fma_sse2 (double x, double y, double z) attribute_hidden; @@ -34,18 +32,18 @@ __fma_fma3 (double x, double y, double z) } -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT static double __fma_fma4 (double x, double y, double z) { asm ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); return x; } -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __fma_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __fma_fma4 ((void *) 0) +#endif libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable) @@ -53,7 +51,6 @@ libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable) ? __fma_fma4 : __fma_sse2)); weak_alias (__fma, fma) -# define __fma __fma_sse2 -#endif +#define __fma __fma_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c index bebd3ee431..eb7d30efca 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c @@ -20,8 +20,6 @@ #include #include -#ifdef HAVE_AVX_SUPPORT - extern float __fmaf_sse2 (float x, float y, float z) attribute_hidden; @@ -33,18 +31,18 @@ __fmaf_fma3 (float x, float y, float z) } -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT static float __fmaf_fma4 (float x, float y, float z) { asm ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); return x; } -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __fmaf_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __fmaf_fma4 ((void *) 0) +#endif libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) @@ -52,7 +50,6 @@ libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) ? __fmaf_fma4 : __fmaf_sse2)); weak_alias (__fmaf, fmaf) -# define __fmaf __fmaf_sse2 -#endif +#define __fmaf __fmaf_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c index 3bc73306dc..c36ea2577e 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_sin.c +++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c @@ -1,21 +1,20 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include -# undef NAN +#include +#include +#undef NAN extern double __cos_sse2 (double); extern double __sin_sse2 (double); extern double __cos_avx (double); extern double __sin_avx (double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __cos_fma4 (double); extern double __sin_fma4 (double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __cos_fma4 ((void *) 0) -# define __sin_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __cos_fma4 ((void *) 0) +# define __sin_fma4 ((void *) 0) +#endif libm_ifunc (__cos, (HAS_ARCH_FEATURE (FMA4_Usable) ? __cos_fma4 : HAS_ARCH_FEATURE (AVX_Usable) @@ -27,9 +26,8 @@ libm_ifunc (__sin, (HAS_ARCH_FEATURE (FMA4_Usable) ? __sin_fma4 : ? __sin_avx : __sin_sse2)); weak_alias (__sin, sin) -# define __cos __cos_sse2 -# define __sin __sin_sse2 -#endif +#define __cos __cos_sse2 +#define __sin __sin_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c index d99d9db3d5..48848b2c40 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_tan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c @@ -1,23 +1,21 @@ -#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT -# include -# include +#include +#include extern double __tan_sse2 (double); extern double __tan_avx (double); -# ifdef HAVE_FMA4_SUPPORT +#ifdef HAVE_FMA4_SUPPORT extern double __tan_fma4 (double); -# else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __tan_fma4 ((void *) 0) -# endif +#else +# undef HAS_ARCH_FEATURE +# define HAS_ARCH_FEATURE(feature) 0 +# define __tan_fma4 ((void *) 0) +#endif libm_ifunc (tan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __tan_fma4 : HAS_ARCH_FEATURE (AVX_Usable) ? __tan_avx : __tan_sse2)); -# define tan __tan_sse2 -#endif +#define tan __tan_sse2 #include diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S index c180ce6cf3..ad7892b52b 100644 --- a/sysdeps/x86_64/multiarch/strcmp.S +++ b/sysdeps/x86_64/multiarch/strcmp.S @@ -107,11 +107,9 @@ END(STRCMP) ENTRY(__strcasecmp) .type __strcasecmp, @gnu_indirect_function LOAD_RTLD_GLOBAL_RO_RDX -# ifdef HAVE_AVX_SUPPORT leaq __strcasecmp_avx(%rip), %rax HAS_ARCH_FEATURE (AVX_Usable) jnz 3f -# endif HAS_ARCH_FEATURE (Slow_SSE4_2) jnz 2f leaq __strcasecmp_sse42(%rip), %rax @@ -129,11 +127,9 @@ weak_alias (__strcasecmp, strcasecmp) ENTRY(__strncasecmp) .type __strncasecmp, @gnu_indirect_function LOAD_RTLD_GLOBAL_RO_RDX -# ifdef HAVE_AVX_SUPPORT leaq __strncasecmp_avx(%rip), %rax HAS_ARCH_FEATURE (AVX_Usable) jnz 3f -# endif HAS_ARCH_FEATURE (Slow_SSE4_2) jnz 2f leaq __strncasecmp_sse42(%rip), %rax @@ -155,16 +151,14 @@ weak_alias (__strncasecmp, strncasecmp) # include "strcmp-sse42.S" -# ifdef HAVE_AVX_SUPPORT -# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L -# define LABEL(l) .L##l##_avx -# define GLABEL(l) l##_avx -# define USE_AVX 1 -# undef STRCMP_SSE42 -# define STRCMP_SSE42 STRCMP_AVX -# define SECTION avx -# include "strcmp-sse42.S" -# endif +# if defined USE_AS_STRCASECMP_L || defined USE_AS_STRNCASECMP_L +# define LABEL(l) .L##l##_avx +# define GLABEL(l) l##_avx +# define USE_AVX 1 +# undef STRCMP_SSE42 +# define STRCMP_SSE42 STRCMP_AVX +# define SECTION avx +# include "strcmp-sse42.S" # endif -- cgit v1.2.3 From b7848899a591a9de23db6afeb9992668ef8aff88 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 9 Oct 2015 16:02:54 +0000 Subject: Remove configure tests for FMA4 support. GCC added support for -mfma4 in version 4.5. Thus the configure tests for this support are obsolete, and this patch removes them. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by this patch). * sysdeps/i386/configure.ac (libc_cv_cc_fma4): Remove configure test. * sysdeps/i386/configure: Regenerated. * sysdeps/x86_64/configure.ac (libc_cv_cc_fma4): Remove configure test. * sysdeps/x86_64/configure: Regenerated. * sysdeps/x86_64/fpu/multiarch/Makefile [$(have-mfma4) = yes]: Make code unconditional. * sysdeps/x86_64/fpu/multiarch/e_asin.c [HAVE_FMA4_SUPPORT]: Likewise. * sysdeps/x86_64/fpu/multiarch/e_atan2.c [HAVE_FMA4_SUPPORT]: Likewise. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/e_exp.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/e_log.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]: Make code unconditional. * sysdeps/x86_64/fpu/multiarch/s_atan.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/s_sin.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * sysdeps/x86_64/fpu/multiarch/s_tan.c [HAVE_FMA4_SUPPORT]: Make code unconditional. [!HAVE_FMA4_SUPPORT]: Remove conditional code. * config.h.in (HAVE_FMA4_SUPPORT): Remove #undef. --- ChangeLog | 38 ++++++++++++++++++++++++++++++++++ config.h.in | 3 --- sysdeps/i386/configure | 26 ----------------------- sysdeps/i386/configure.ac | 9 -------- sysdeps/x86_64/configure | 26 ----------------------- sysdeps/x86_64/configure.ac | 9 -------- sysdeps/x86_64/fpu/multiarch/Makefile | 2 -- sysdeps/x86_64/fpu/multiarch/e_asin.c | 12 +++++------ sysdeps/x86_64/fpu/multiarch/e_atan2.c | 6 ------ sysdeps/x86_64/fpu/multiarch/e_exp.c | 6 ------ sysdeps/x86_64/fpu/multiarch/e_log.c | 6 ------ sysdeps/x86_64/fpu/multiarch/e_pow.c | 10 ++++----- sysdeps/x86_64/fpu/multiarch/s_atan.c | 6 ------ sysdeps/x86_64/fpu/multiarch/s_fma.c | 6 ------ sysdeps/x86_64/fpu/multiarch/s_fmaf.c | 6 ------ sysdeps/x86_64/fpu/multiarch/s_sin.c | 7 ------- sysdeps/x86_64/fpu/multiarch/s_tan.c | 6 ------ 17 files changed, 47 insertions(+), 137 deletions(-) (limited to 'sysdeps/x86_64/fpu/multiarch/e_log.c') diff --git a/ChangeLog b/ChangeLog index 1ceae346df..222cf97856 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,43 @@ 2015-10-09 Joseph Myers + * sysdeps/i386/configure.ac (libc_cv_cc_fma4): Remove configure + test. + * sysdeps/i386/configure: Regenerated. + * sysdeps/x86_64/configure.ac (libc_cv_cc_fma4): Remove configure + test. + * sysdeps/x86_64/configure: Regenerated. + * sysdeps/x86_64/fpu/multiarch/Makefile [$(have-mfma4) = yes]: + Make code unconditional. + * sysdeps/x86_64/fpu/multiarch/e_asin.c [HAVE_FMA4_SUPPORT]: + Likewise. + * sysdeps/x86_64/fpu/multiarch/e_atan2.c [HAVE_FMA4_SUPPORT]: + Likewise. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/e_exp.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/e_log.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/e_pow.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + * sysdeps/x86_64/fpu/multiarch/s_atan.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/s_fma.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/s_fmaf.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/s_sin.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * sysdeps/x86_64/fpu/multiarch/s_tan.c [HAVE_FMA4_SUPPORT]: Make + code unconditional. + [!HAVE_FMA4_SUPPORT]: Remove conditional code. + * config.h.in (HAVE_FMA4_SUPPORT): Remove #undef. + [BZ #19095] * sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Cast low part of mantissa to long int before shifting left. diff --git a/config.h.in b/config.h.in index d9aba90d30..7c851c97fe 100644 --- a/config.h.in +++ b/config.h.in @@ -88,9 +88,6 @@ /* Define if assembler supports Intel MPX. */ #undef HAVE_MPX_SUPPORT -/* Define if gcc supports FMA4. */ -#undef HAVE_FMA4_SUPPORT - /* Define if gcc supports AVX2. */ #undef HAVE_AVX2_SUPPORT diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure index 1b39cbae08..bc22864946 100644 --- a/sysdeps/i386/configure +++ b/sysdeps/i386/configure @@ -114,32 +114,6 @@ $as_echo "$libc_cv_as_i686" >&6; } config_vars="$config_vars config-asflags-i686 = $libc_cv_as_i686" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5 -$as_echo_n "checking for FMA4 support... " >&6; } -if ${libc_cv_cc_fma4+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_fma4=yes -else - libc_cv_cc_fma4=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5 -$as_echo "$libc_cv_cc_fma4" >&6; } -if test $libc_cv_cc_fma4 = yes; then - $as_echo "#define HAVE_FMA4_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -have-mfma4 = $libc_cv_cc_fma4" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5 $as_echo_n "checking for -mno-vzeroupper support... " >&6; } if ${libc_cv_cc_novzeroupper+:} false; then : diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac index 965fa73489..c51530a943 100644 --- a/sysdeps/i386/configure.ac +++ b/sysdeps/i386/configure.ac @@ -42,15 +42,6 @@ LIBC_TRY_CC_OPTION([-Wa,-mtune=i686], ]) LIBC_CONFIG_VAR([config-asflags-i686], [$libc_cv_as_i686]) -dnl Check if -mfma4 works. -AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl -LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no]) -]) -if test $libc_cv_cc_fma4 = yes; then - AC_DEFINE(HAVE_FMA4_SUPPORT) -fi -LIBC_CONFIG_VAR([have-mfma4], [$libc_cv_cc_fma4]) - dnl Check if -mno-vzeroupper works. AC_CACHE_CHECK(for -mno-vzeroupper support, libc_cv_cc_novzeroupper, [dnl LIBC_TRY_CC_OPTION([-mno-vzeroupper], diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure index ef234d5c50..717692365e 100644 --- a/sysdeps/x86_64/configure +++ b/sysdeps/x86_64/configure @@ -97,32 +97,6 @@ fi config_vars="$config_vars config-cflags-avx512 = $libc_cv_cc_avx512" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5 -$as_echo_n "checking for FMA4 support... " >&6; } -if ${libc_cv_cc_fma4+:} false; then : - $as_echo_n "(cached) " >&6 -else - if { ac_try='${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - libc_cv_cc_fma4=yes -else - libc_cv_cc_fma4=no -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_fma4" >&5 -$as_echo "$libc_cv_cc_fma4" >&6; } -if test $libc_cv_cc_fma4 = yes; then - $as_echo "#define HAVE_FMA4_SUPPORT 1" >>confdefs.h - -fi -config_vars="$config_vars -have-mfma4 = $libc_cv_cc_fma4" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mno-vzeroupper support" >&5 $as_echo_n "checking for -mno-vzeroupper support... " >&6; } if ${libc_cv_cc_novzeroupper+:} false; then : diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac index 76a3265959..965ebc95a1 100644 --- a/sysdeps/x86_64/configure.ac +++ b/sysdeps/x86_64/configure.ac @@ -30,15 +30,6 @@ if test $libc_cv_cc_avx512 = yes; then fi LIBC_CONFIG_VAR([config-cflags-avx512], [$libc_cv_cc_avx512]) -dnl Check if -mfma4 works. -AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl -LIBC_TRY_CC_OPTION([-mfma4], [libc_cv_cc_fma4=yes], [libc_cv_cc_fma4=no]) -]) -if test $libc_cv_cc_fma4 = yes; then - AC_DEFINE(HAVE_FMA4_SUPPORT) -fi -LIBC_CONFIG_VAR([have-mfma4], [$libc_cv_cc_fma4]) - dnl Check if -mno-vzeroupper works. AC_CACHE_CHECK(for -mno-vzeroupper support, libc_cv_cc_novzeroupper, [dnl LIBC_TRY_CC_OPTION([-mno-vzeroupper], diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile index ad7bbf0aec..34542155aa 100644 --- a/sysdeps/x86_64/fpu/multiarch/Makefile +++ b/sysdeps/x86_64/fpu/multiarch/Makefile @@ -2,7 +2,6 @@ ifeq ($(subdir),math) libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \ s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c -ifeq ($(have-mfma4),yes) libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \ e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \ mplog-fma4 mpa-fma4 slowexp-fma4 slowpow-fma4 \ @@ -31,7 +30,6 @@ CFLAGS-slowexp-fma4.c = -mfma4 CFLAGS-slowpow-fma4.c = -mfma4 CFLAGS-s_sin-fma4.c = -mfma4 CFLAGS-s_tan-fma4.c = -mfma4 -endif libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \ e_atan2-avx s_sin-avx s_tan-avx \ diff --git a/sysdeps/x86_64/fpu/multiarch/e_asin.c b/sysdeps/x86_64/fpu/multiarch/e_asin.c index a0edb96308..111a5b99bd 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_asin.c +++ b/sysdeps/x86_64/fpu/multiarch/e_asin.c @@ -1,7 +1,6 @@ -#ifdef HAVE_FMA4_SUPPORT -# include -# include -# include +#include +#include +#include extern double __ieee754_acos_sse2 (double); extern double __ieee754_asin_sse2 (double); @@ -20,9 +19,8 @@ libm_ifunc (__ieee754_asin, : __ieee754_asin_sse2); strong_alias (__ieee754_asin, __asin_finite) -# define __ieee754_acos __ieee754_acos_sse2 -# define __ieee754_asin __ieee754_asin_sse2 -#endif +#define __ieee754_acos __ieee754_acos_sse2 +#define __ieee754_asin __ieee754_asin_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c index 8edb8b635b..9ca3c02a44 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c +++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c @@ -4,13 +4,7 @@ extern double __ieee754_atan2_sse2 (double, double); extern double __ieee754_atan2_avx (double, double); -#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_atan2_fma4 (double, double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_atan2_fma4 ((void *) 0) -#endif libm_ifunc (__ieee754_atan2, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_atan2_fma4 diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c index 84e62a0491..b7d7b5ff27 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_exp.c +++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c @@ -4,13 +4,7 @@ extern double __ieee754_exp_sse2 (double); extern double __ieee754_exp_avx (double); -#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_exp_fma4 (double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_exp_fma4 ((void *) 0) -#endif libm_ifunc (__ieee754_exp, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_exp_fma4 diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c index 90e21ec1ec..cf9533d6c0 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_log.c +++ b/sysdeps/x86_64/fpu/multiarch/e_log.c @@ -4,13 +4,7 @@ extern double __ieee754_log_sse2 (double); extern double __ieee754_log_avx (double); -#ifdef HAVE_FMA4_SUPPORT extern double __ieee754_log_fma4 (double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __ieee754_log_fma4 ((void *) 0) -#endif libm_ifunc (__ieee754_log, HAS_ARCH_FEATURE (FMA4_Usable) ? __ieee754_log_fma4 diff --git a/sysdeps/x86_64/fpu/multiarch/e_pow.c b/sysdeps/x86_64/fpu/multiarch/e_pow.c index 6d422d6b6f..a5c5d89c3e 100644 --- a/sysdeps/x86_64/fpu/multiarch/e_pow.c +++ b/sysdeps/x86_64/fpu/multiarch/e_pow.c @@ -1,7 +1,6 @@ -#ifdef HAVE_FMA4_SUPPORT -# include -# include -# include +#include +#include +#include extern double __ieee754_pow_sse2 (double, double); extern double __ieee754_pow_fma4 (double, double); @@ -12,8 +11,7 @@ libm_ifunc (__ieee754_pow, : __ieee754_pow_sse2); strong_alias (__ieee754_pow, __pow_finite) -# define __ieee754_pow __ieee754_pow_sse2 -#endif +#define __ieee754_pow __ieee754_pow_sse2 #include diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c index 8d2b004522..742e95cb96 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_atan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c @@ -3,13 +3,7 @@ extern double __atan_sse2 (double); extern double __atan_avx (double); -#ifdef HAVE_FMA4_SUPPORT extern double __atan_fma4 (double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __atan_fma4 ((void *) 0) -#endif libm_ifunc (atan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __atan_fma4 : HAS_ARCH_FEATURE (AVX_Usable) diff --git a/sysdeps/x86_64/fpu/multiarch/s_fma.c b/sysdeps/x86_64/fpu/multiarch/s_fma.c index 630c99c3ce..41cb803940 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_fma.c +++ b/sysdeps/x86_64/fpu/multiarch/s_fma.c @@ -32,18 +32,12 @@ __fma_fma3 (double x, double y, double z) } -#ifdef HAVE_FMA4_SUPPORT static double __fma_fma4 (double x, double y, double z) { asm ("vfmaddsd %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); return x; } -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __fma_fma4 ((void *) 0) -#endif libm_ifunc (__fma, HAS_ARCH_FEATURE (FMA_Usable) diff --git a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c index eb7d30efca..0c91513fee 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_fmaf.c +++ b/sysdeps/x86_64/fpu/multiarch/s_fmaf.c @@ -31,18 +31,12 @@ __fmaf_fma3 (float x, float y, float z) } -#ifdef HAVE_FMA4_SUPPORT static float __fmaf_fma4 (float x, float y, float z) { asm ("vfmaddss %3, %2, %1, %0" : "=x" (x) : "x" (x), "x" (y), "x" (z)); return x; } -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __fmaf_fma4 ((void *) 0) -#endif libm_ifunc (__fmaf, HAS_ARCH_FEATURE (FMA_Usable) diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c index c36ea2577e..8ffd3e7125 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_sin.c +++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c @@ -6,15 +6,8 @@ extern double __cos_sse2 (double); extern double __sin_sse2 (double); extern double __cos_avx (double); extern double __sin_avx (double); -#ifdef HAVE_FMA4_SUPPORT extern double __cos_fma4 (double); extern double __sin_fma4 (double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __cos_fma4 ((void *) 0) -# define __sin_fma4 ((void *) 0) -#endif libm_ifunc (__cos, (HAS_ARCH_FEATURE (FMA4_Usable) ? __cos_fma4 : HAS_ARCH_FEATURE (AVX_Usable) diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c index 48848b2c40..25f3bca07e 100644 --- a/sysdeps/x86_64/fpu/multiarch/s_tan.c +++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c @@ -3,13 +3,7 @@ extern double __tan_sse2 (double); extern double __tan_avx (double); -#ifdef HAVE_FMA4_SUPPORT extern double __tan_fma4 (double); -#else -# undef HAS_ARCH_FEATURE -# define HAS_ARCH_FEATURE(feature) 0 -# define __tan_fma4 ((void *) 0) -#endif libm_ifunc (tan, (HAS_ARCH_FEATURE (FMA4_Usable) ? __tan_fma4 : HAS_ARCH_FEATURE (AVX_Usable) -- cgit v1.2.3