From patchwork Fri Oct 9 15:13:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 528249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C875E140321 for ; Sat, 10 Oct 2015 02:14:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=VTaTijP2; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=rOuQeRCLMylG5BD7FSdhogaEjEpEt HwPJgtGwDGCIRWEW3vjtnDVq395lUbJBVfe4IGcymp4faqwbr5tqMYy+teuYfagD uQTvpp+XRxNBferMsZ7XsyfokvVXdMsowTSyt2QXo5YXKxJC3bXkCjhyX+4Uia8q tj1Tu11T04ne5g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=i5RK7vr4UFocU0/Bun7h53W5/kc=; b=VTa TijP241HbJO4qcprn5FN2dKWpXdaepdqxgYt2rCXtEoKRCEQeXgB9o7vapgeJtRB KBbCsFZKDOIoyZjaTKfsvLDZ35n0344NPaIaCcZBd5i/gyjcJ6niiv10TmC6Vl6n 3QdeEv1JlCX8U/A2SCuvJce0qN/KCWoD3DXiW37g= Received: (qmail 130693 invoked by alias); 9 Oct 2015 15:14:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 130683 invoked by uid 89); 9 Oct 2015 15:14:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 9 Oct 2015 15:13:52 +0000 From: Joseph Myers To: Subject: Remove configure tests for FMA4 support Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 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). 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. diff --git a/config.h.in b/config.h.in index d9aba90..7c851c9 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 1b39cba..bc22864 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 965fa73..c51530a 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 ef234d5..7176923 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 76a3265..965ebc9 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 ad7bbf0..3454215 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 a0edb96..111a5b9 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 8edb8b6..9ca3c02 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 84e62a0..b7d7b5f 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 90e21ec..cf9533d 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 6d422d6..a5c5d89 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 8d2b004..742e95c 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 630c99c..41cb803 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 eb7d30e..0c91513 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 c36ea25..8ffd3e7 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 48848b2..25f3bca 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)