This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH x86_64][BZ #20139] Don't allow configure with not supporting AVX512 assembler w/o --disable-avx512.


Hi,

this patch adds new configure option --enable-avx512 and defaults it for x86_64.

To fix BZ #20139 we need don't let to configure with not supporting
AVX512 assembler w/o --disable-avx512.

2016-06-27  Andrew Senkevich  <andrew.senkevich@intel.com>

        [BZ #20139]
        * configure.ac: Added --enable-avx512.
        * sysdeps/x86_64/configure.ac: Check for --disable-avx512
        if no AVX512 assembler support.
        * configure: Regenerated.
        * sysdeps/x86_64/configure: Likewise.
        * manual/install.texi (Configuring and compiling): Document
        --enable-avx512.
        * INSTALL: Regenerated.

diff --git a/INSTALL b/INSTALL
index ec3445f..505c032 100644
--- a/INSTALL
+++ b/INSTALL
@@ -158,6 +158,11 @@ will be used, and CFLAGS sets optimization
options for the compiler.
      By default for x86_64, the GNU C Library is built with vector math
      library.  Use this option to disable vector math library.

+'--disable-avx512'
+     By default for x86_64, the GNU C Library is built with
+     '--enable-avx512'.  Configure with '--disable-avx512' if assembler
+     doesn't support AVX512.
+
 '--build=BUILD-SYSTEM'
 '--host=HOST-SYSTEM'
      These options are for cross-compiling.  If you specify both options
diff --git a/configure b/configure
index 19a4829..727f57c 100755
--- a/configure
+++ b/configure
@@ -774,6 +774,7 @@ enable_build_nscd
 enable_nscd
 enable_pt_chown
 enable_mathvec
+enable_avx512
 with_cpu
 '
       ac_precious_vars='build_alias
@@ -1442,6 +1443,8 @@ Optional Features:
   --enable-pt_chown       Enable building and installing pt_chown
   --enable-mathvec        Enable building and installing mathvec [default
                           depends on architecture]
+  --enable-avx512         Enable AVX512 assembler support [default depends on
+                          architecture]

 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -3666,6 +3669,14 @@ else
 fi


+# Check whether --enable-avx512 was given.
+if test "${enable_avx512+set}" = set; then :
+  enableval=$enable_avx512; avx512=$enableval
+else
+  avx512=notset
+fi
+
+
 # We keep the original values in `$config_*' and never modify them, so we
 # can write them unchanged into config.make.  Everything else uses
 # $machine, $vendor, and $os, and changes them whenever convenient.
diff --git a/configure.ac b/configure.ac
index 123f0d2..c983a54 100644
--- a/configure.ac
+++ b/configure.ac
@@ -413,6 +413,12 @@ AC_ARG_ENABLE([mathvec],
              [build_mathvec=$enableval],
              [build_mathvec=notset])

+AC_ARG_ENABLE([avx512],
+             [AS_HELP_STRING([--enable-avx512],
+             [Enable AVX512 assembler support @<:@default depends on
architecture@:>@])],
+             [avx512=$enableval],
+             [avx512=notset])
+
 # We keep the original values in `$config_*' and never modify them, so we
 # can write them unchanged into config.make.  Everything else uses
 # $machine, $vendor, and $os, and changes them whenever convenient.
diff --git a/manual/install.texi b/manual/install.texi
index 79ee45f..3dcdf88 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -189,6 +189,10 @@ configure with @option{--disable-werror}.
 By default for x86_64, @theglibc{} is built with vector math library.
 Use this option to disable vector math library.

+@item --disable-avx512
+By default for x86_64, @theglibc{} is built with @option{--enable-avx512}.
+Configure with @option{--disable-avx512} if assembler doesn't support AVX512.
+
 @item --build=@var{build-system}
 @itemx --host=@var{host-system}
 These options are for cross-compiling.  If you specify both options and
diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
index 88fbfe4..4cc8d52 100644
--- a/sysdeps/x86_64/configure
+++ b/sysdeps/x86_64/configure
@@ -24,9 +24,18 @@ rm -f conftest*
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_avx512" >&5
 $as_echo "$libc_cv_asm_avx512" >&6; }
+
+if test x"$avx512" = xnotset; then
+  avx512=yes
+fi
+
 if test $libc_cv_asm_avx512 = yes; then
   $as_echo "#define HAVE_AVX512_ASM_SUPPORT 1" >>confdefs.h

+else
+  if test x"$avx512" = xyes; then
+    as_fn_error $? "assembler does not support AVX512 but default is
--enable-avx512" "$LINENO" 5
+  fi
 fi

 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512 support" >&5
diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index b39309e..5f1ad43 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -13,8 +13,17 @@ else
   libc_cv_asm_avx512=no
 fi
 rm -f conftest*])
+
+if test x"$avx512" = xnotset; then
+  avx512=yes
+fi
+
 if test $libc_cv_asm_avx512 = yes; then
   AC_DEFINE(HAVE_AVX512_ASM_SUPPORT)
+else
+  if test x"$avx512" = xyes; then
+    AC_MSG_ERROR([assembler does not support AVX512 but default is
--enable-avx512])
+  fi
 fi

 dnl Check if -mavx512f works.


If placing x86_64 related in root configure is not accepted please
give me an advice how to avoid it.
AC_ARG_ENABLE in sysdeps/x86_64/configure.ac doesn't work for me.


--
WBR,
Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]