From patchwork Mon Jun 27 17:40:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Senkevich X-Patchwork-Id: 13408 Received: (qmail 85272 invoked by alias); 27 Jun 2016 17:41:26 -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 85204 invoked by uid 89); 27 Jun 2016 17:41:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=os, PACKAGE, 100755, 24, 9 X-HELO: mail-vk0-f68.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qbpIEabBkftFQdyabVs9f0s8yDnLVlz4ZyD//sPYBkM=; b=ZXOK6VjJ9OeJ0UFYlgELsIqe7or66mTJoA3wAE47hehxUc/oGAJLG0uP5QPiWTg4ez Hn3ttJ5whBIKsoLEIVdvBUJadNXW82zcDABlf0vv8p34FKqOezVCj0vS8QFqt6zJZ7Mo wnPuTm+UEqeBBt1qJZ5nP4e6PtKdp9gVKCXZKdIH0RUP7wVe+sZfAEu653LUcfk0gkKh W48Qx8h/5/T8IEFr2UAi5VB9pSSTQeEczb2s7MVCkPo0MG6cNoH++xqLFVXO9NC3R/lA Bx+eLEehNFSyJB96mw5ZNQKBhDM7rbQwWGJ3CpJdbhaeneyXpGzlODqDwPeamcSJkYv0 jhAg== X-Gm-Message-State: ALyK8tLqplN/dAWbVrFBjw2eJsUz7nhnhQN6/73ihgaiILtQ+EwqyLRUdqv3dmZ1W7jhs+MQrT71g7hRZMV/WA== X-Received: by 10.31.16.207 with SMTP id 76mr8982962vkq.63.1467049263629; Mon, 27 Jun 2016 10:41:03 -0700 (PDT) MIME-Version: 1.0 From: Andrew Senkevich Date: Mon, 27 Jun 2016 20:40:33 +0300 Message-ID: Subject: [PATCH x86_64][BZ #20139] Don't allow configure with not supporting AVX512 assembler w/o --disable-avx512. To: libc-alpha 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 [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. 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 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.