diff mbox series

x86-64: Remove compiler -mavx512f check

Message ID 20210820135145.49237-1-hjl.tools@gmail.com
State Committed
Commit 5359c3bc91cc509bcd30bbb8d951848e0280f325
Headers show
Series x86-64: Remove compiler -mavx512f check | expand

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

H.J. Lu Aug. 20, 2021, 1:51 p.m. UTC
The minimum GCC requirement is GCC 6.2 which supports -mavx512f.  Remove
compiler -mavx512f check.  Tested with GCC 6.4.1 on Linux/x86-64.
---
 config.h.in                 |  3 ---
 sysdeps/x86_64/Makefile     |  2 --
 sysdeps/x86_64/configure    | 26 --------------------------
 sysdeps/x86_64/configure.ac |  9 ---------
 sysdeps/x86_64/fpu/Makefile |  2 --
 5 files changed, 42 deletions(-)

Comments

H.J. Lu Aug. 24, 2021, 1:59 p.m. UTC | #1
On Fri, Aug 20, 2021 at 6:51 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> The minimum GCC requirement is GCC 6.2 which supports -mavx512f.  Remove
> compiler -mavx512f check.  Tested with GCC 6.4.1 on Linux/x86-64.
> ---
>  config.h.in                 |  3 ---
>  sysdeps/x86_64/Makefile     |  2 --
>  sysdeps/x86_64/configure    | 26 --------------------------
>  sysdeps/x86_64/configure.ac |  9 ---------
>  sysdeps/x86_64/fpu/Makefile |  2 --
>  5 files changed, 42 deletions(-)
>
> diff --git a/config.h.in b/config.h.in
> index 0d92504f65..3752f9a6f7 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -62,9 +62,6 @@
>  /* Define if _rtld_local structure should be forced into .sdata section.  */
>  #undef HAVE_SDATA_SECTION
>
> -/* Define if compiler supports AVX512.  */
> -#undef  HAVE_AVX512_SUPPORT
> -
>  /* Define if assembler supports AVX512DQ.  */
>  #undef  HAVE_AVX512DQ_ASM_SUPPORT
>
> diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
> index 22c5b63ab5..7a4b576356 100644
> --- a/sysdeps/x86_64/Makefile
> +++ b/sysdeps/x86_64/Makefile
> @@ -134,14 +134,12 @@ CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
>  CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
>  CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
>  CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
> -ifeq (yes,$(config-cflags-avx512))
>  AVX512-CFLAGS = -mavx512f
>  CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
>  CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
>  CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
>  CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
>  CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
> -endif
>
>  $(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
>    $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
> diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
> index 75c96d60d4..d81accdc07 100755
> --- a/sysdeps/x86_64/configure
> +++ b/sysdeps/x86_64/configure
> @@ -28,32 +28,6 @@ if test $libc_cv_asm_avx512dq = yes; then
>
>  fi
>
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support" >&5
> -$as_echo_n "checking for AVX512 support... " >&6; }
> -if ${libc_cv_cc_avx512+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  if { ac_try='${CC-cc} -mavx512f -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_avx512=$libc_cv_asm_avx512dq
> -else
> -  libc_cv_cc_avx512=no
> -fi
> -
> -fi
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx512" >&5
> -$as_echo "$libc_cv_cc_avx512" >&6; }
> -if test $libc_cv_cc_avx512 = yes; then
> -  $as_echo "#define HAVE_AVX512_SUPPORT 1" >>confdefs.h
> -
> -fi
> -config_vars="$config_vars
> -config-cflags-avx512 = $libc_cv_cc_avx512"
> -
>  { $as_echo "$as_me:${as_lineno-$LINENO}: checking -mprefer-vector-width=128" >&5
>  $as_echo_n "checking -mprefer-vector-width=128... " >&6; }
>  if ${libc_cv_cc_mprefer_vector_width+:} false; then :
> diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
> index 66219e7ce5..41baed6999 100644
> --- a/sysdeps/x86_64/configure.ac
> +++ b/sysdeps/x86_64/configure.ac
> @@ -16,15 +16,6 @@ if test $libc_cv_asm_avx512dq = yes; then
>    AC_DEFINE(HAVE_AVX512DQ_ASM_SUPPORT)
>  fi
>
> -dnl Check if -mavx512f works.
> -AC_CACHE_CHECK(for AVX512 support, libc_cv_cc_avx512, [dnl
> -LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512dq], [libc_cv_cc_avx512=no])
> -])
> -if test $libc_cv_cc_avx512 = yes; then
> -  AC_DEFINE(HAVE_AVX512_SUPPORT)
> -fi
> -LIBC_CONFIG_VAR([config-cflags-avx512], [$libc_cv_cc_avx512])
> -
>  dnl Check if -mprefer-vector-width=128 works.
>  AC_CACHE_CHECK(-mprefer-vector-width=128, libc_cv_cc_mprefer_vector_width, [dnl
>  LIBC_TRY_CC_OPTION([-mprefer-vector-width=128],
> diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
> index 9a4bdd075c..1b4406380d 100644
> --- a/sysdeps/x86_64/fpu/Makefile
> +++ b/sysdeps/x86_64/fpu/Makefile
> @@ -68,7 +68,6 @@ $(objpfx)test-float-libmvec-sincosf-avx2: \
>    $(objpfx)test-float-libmvec-sincosf-avx2.o \
>    $(objpfx)test-float-libmvec-sincosf-avx2-main.o $(libmvec)
>
> -ifeq (yes,$(config-cflags-avx512))
>  libmvec-tests += double-vlen8 float-vlen16
>  tests += test-double-libmvec-sincos-avx512 \
>          test-float-libmvec-sincosf-avx512
> @@ -84,7 +83,6 @@ $(objpfx)test-double-libmvec-sincos-avx512: \
>  $(objpfx)test-float-libmvec-sincosf-avx512: \
>    $(objpfx)test-float-libmvec-sincosf-avx512.o \
>    $(objpfx)test-float-libmvec-sincosf-avx512-main.o $(libmvec)
> -endif
>
>  double-vlen2-funcs = cos exp log pow sin sincos
>  double-vlen4-funcs = cos exp log pow sin sincos
> --
> 2.31.1
>

I am checking in this patch.
diff mbox series

Patch

diff --git a/config.h.in b/config.h.in
index 0d92504f65..3752f9a6f7 100644
--- a/config.h.in
+++ b/config.h.in
@@ -62,9 +62,6 @@ 
 /* Define if _rtld_local structure should be forced into .sdata section.  */
 #undef	HAVE_SDATA_SECTION
 
-/* Define if compiler supports AVX512.  */
-#undef  HAVE_AVX512_SUPPORT
-
 /* Define if assembler supports AVX512DQ.  */
 #undef  HAVE_AVX512DQ_ASM_SUPPORT
 
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
index 22c5b63ab5..7a4b576356 100644
--- a/sysdeps/x86_64/Makefile
+++ b/sysdeps/x86_64/Makefile
@@ -134,14 +134,12 @@  CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
 CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
 CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
 CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
-ifeq (yes,$(config-cflags-avx512))
 AVX512-CFLAGS = -mavx512f
 CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
 CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
 CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
 CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
 CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
-endif
 
 $(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
   $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
index 75c96d60d4..d81accdc07 100755
--- a/sysdeps/x86_64/configure
+++ b/sysdeps/x86_64/configure
@@ -28,32 +28,6 @@  if test $libc_cv_asm_avx512dq = yes; then
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support" >&5
-$as_echo_n "checking for AVX512 support... " >&6; }
-if ${libc_cv_cc_avx512+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if { ac_try='${CC-cc} -mavx512f -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_avx512=$libc_cv_asm_avx512dq
-else
-  libc_cv_cc_avx512=no
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_avx512" >&5
-$as_echo "$libc_cv_cc_avx512" >&6; }
-if test $libc_cv_cc_avx512 = yes; then
-  $as_echo "#define HAVE_AVX512_SUPPORT 1" >>confdefs.h
-
-fi
-config_vars="$config_vars
-config-cflags-avx512 = $libc_cv_cc_avx512"
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking -mprefer-vector-width=128" >&5
 $as_echo_n "checking -mprefer-vector-width=128... " >&6; }
 if ${libc_cv_cc_mprefer_vector_width+:} false; then :
diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index 66219e7ce5..41baed6999 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -16,15 +16,6 @@  if test $libc_cv_asm_avx512dq = yes; then
   AC_DEFINE(HAVE_AVX512DQ_ASM_SUPPORT)
 fi
 
-dnl Check if -mavx512f works.
-AC_CACHE_CHECK(for AVX512 support, libc_cv_cc_avx512, [dnl
-LIBC_TRY_CC_OPTION([-mavx512f], [libc_cv_cc_avx512=$libc_cv_asm_avx512dq], [libc_cv_cc_avx512=no])
-])
-if test $libc_cv_cc_avx512 = yes; then
-  AC_DEFINE(HAVE_AVX512_SUPPORT)
-fi
-LIBC_CONFIG_VAR([config-cflags-avx512], [$libc_cv_cc_avx512])
-
 dnl Check if -mprefer-vector-width=128 works.
 AC_CACHE_CHECK(-mprefer-vector-width=128, libc_cv_cc_mprefer_vector_width, [dnl
 LIBC_TRY_CC_OPTION([-mprefer-vector-width=128],
diff --git a/sysdeps/x86_64/fpu/Makefile b/sysdeps/x86_64/fpu/Makefile
index 9a4bdd075c..1b4406380d 100644
--- a/sysdeps/x86_64/fpu/Makefile
+++ b/sysdeps/x86_64/fpu/Makefile
@@ -68,7 +68,6 @@  $(objpfx)test-float-libmvec-sincosf-avx2: \
   $(objpfx)test-float-libmvec-sincosf-avx2.o \
   $(objpfx)test-float-libmvec-sincosf-avx2-main.o $(libmvec)
 
-ifeq (yes,$(config-cflags-avx512))
 libmvec-tests += double-vlen8 float-vlen16
 tests += test-double-libmvec-sincos-avx512 \
 	 test-float-libmvec-sincosf-avx512
@@ -84,7 +83,6 @@  $(objpfx)test-double-libmvec-sincos-avx512: \
 $(objpfx)test-float-libmvec-sincosf-avx512: \
   $(objpfx)test-float-libmvec-sincosf-avx512.o \
   $(objpfx)test-float-libmvec-sincosf-avx512-main.o $(libmvec)
-endif
 
 double-vlen2-funcs = cos exp log pow sin sincos
 double-vlen4-funcs = cos exp log pow sin sincos