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.
This commit is contained in:
Joseph Myers 2015-10-09 16:02:54 +00:00
parent 0e069029a8
commit b7848899a5
17 changed files with 47 additions and 137 deletions

View File

@ -1,5 +1,43 @@
2015-10-09 Joseph Myers <joseph@codesourcery.com>
* 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.

View File

@ -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

View File

@ -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 :

View File

@ -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],

View File

@ -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 :

View File

@ -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],

View File

@ -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 \

View File

@ -1,7 +1,6 @@
#ifdef HAVE_FMA4_SUPPORT
# include <init-arch.h>
# include <math.h>
# include <math_private.h>
#include <init-arch.h>
#include <math.h>
#include <math_private.h>
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 <sysdeps/ieee754/dbl-64/e_asin.c>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,7 +1,6 @@
#ifdef HAVE_FMA4_SUPPORT
# include <init-arch.h>
# include <math.h>
# include <math_private.h>
#include <init-arch.h>
#include <math.h>
#include <math_private.h>
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 <sysdeps/ieee754/dbl-64/e_pow.c>

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)