From patchwork Thu Sep 17 03:39:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 40417 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA89B386EC72; Thu, 17 Sep 2020 03:39:58 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from aloka.lostca.se (aloka.lostca.se [IPv6:2a01:4f8:120:624c::2]) by sourceware.org (Postfix) with ESMTPS id 97788386EC23 for ; Thu, 17 Sep 2020 03:39:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97788386EC23 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lostca.se Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arjun.is@lostca.se Received: from aloka.lostca.se (aloka [127.0.0.1]) by aloka.lostca.se (Postfix) with ESMTP id AFF7C162B2; Thu, 17 Sep 2020 03:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=date:from:to :cc:subject:message-id:mime-version:content-type; s=howrah; bh=W aMzcrpIc0Xp92wuFioaK5ifxFs=; b=icyxPEZBQMKzEkWrWa1ukOwCrJ0FEB+on 5xc0Tv8E/yIptCzZ83VsoTDr9UmR59JD3qOzEsZzDdVGTLx2sUjQktqgYJwrpCvn VTvE5BGbiai7HH/Za5l0hd2WP3NAJG3H591xYOu1xbtbMVECUmfy7Voay2ivZiDz jTloISf81A= Received: from localhost (unknown [IPv6:2a01:4f8:120:624c::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aloka.lostca.se (Postfix) with ESMTPSA id 7429F162B1; Thu, 17 Sep 2020 03:39:53 +0000 (UTC) Date: Thu, 17 Sep 2020 03:39:53 +0000 From: Arjun Shankar To: libc-alpha@sourceware.org Subject: [PATCH] benchtests: Run _Float128 tests only on architectures that support it Message-ID: <20200917033952.GA77991@aloka.lostca.se> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" From: Arjun Shankar __float128 is a non-standard name and is not available on some architectures (like aarch64 or s390x) even though they may support the standard _Float128 type. Other architectures (like armv7) don't support quad-precision floating-point operations at all. This commit adds a configure check for quad-precision FP support and runs the corresponding benchtests only on architectures that support it. It also replaces references to __float128 with _Float128. --- Tested on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x. benchtests/Makefile | 6 +++++- benchtests/expf128-inputs | 4 ++-- benchtests/powf128-inputs | 4 ++-- benchtests/sinf128-inputs | 4 ++-- configure | 24 ++++++++++++++++++++++++ configure.ac | 15 +++++++++++++++ 6 files changed, 50 insertions(+), 7 deletions(-) diff --git a/benchtests/Makefile b/benchtests/Makefile index 3095076055..6590a95439 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -25,7 +25,11 @@ bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 log log2 \ modf pow rint sin sincos sinh sqrt tan tanh fmin fmax fminf \ fmaxf powf trunc truncf roundeven roundevenf expf exp2f logf \ log2f sincosf sinf cosf isnan isinf isfinite hypot logb logbf \ - exp10f expf128 powf128 sinf128 + exp10f + +ifeq (yes,$(have-qp-float)) +bench-math += expf128 powf128 sinf128 +endif bench-pthread := pthread_once thread_create diff --git a/benchtests/expf128-inputs b/benchtests/expf128-inputs index 5b36f8672a..5dc0f4e49b 100644 --- a/benchtests/expf128-inputs +++ b/benchtests/expf128-inputs @@ -1,6 +1,6 @@ ## includes: math.h -## args: __float128 -## ret: __float128 +## args: _Float128 +## ret: _Float128 # Random inputs in [-10,10] ## name: workload-random.wrf 0x4.e6f9d6da10d9a422942a89cdfa1p+0L diff --git a/benchtests/powf128-inputs b/benchtests/powf128-inputs index 7cbabafff6..6826266ad5 100644 --- a/benchtests/powf128-inputs +++ b/benchtests/powf128-inputs @@ -1,6 +1,6 @@ ## includes: math.h -## args: __float128:__float128 -## ret: __float128 +## args: _Float128:_Float128 +## ret: _Float128 # Random inputs in [-10,10] such that x and y are not both negative ## name: workload-random.wrf 0x8.130b31ed5288656428a29cead83p+0L, -0x6.e7ead09b7877a118813b50cfb3c8p+0L diff --git a/benchtests/sinf128-inputs b/benchtests/sinf128-inputs index 9aaf312413..01b7533680 100644 --- a/benchtests/sinf128-inputs +++ b/benchtests/sinf128-inputs @@ -1,6 +1,6 @@ ## includes: math.h -## args: __float128 -## ret: __float128 +## args: _Float128 +## ret: _Float128 # Random inputs in [-10,10] ## name: workload-random.wrf 0x4.e6f9d6da10d9a422942a89cdfa1p+0 diff --git a/configure b/configure index 4795e721e5..a2a8636ca6 100755 --- a/configure +++ b/configure @@ -595,6 +595,7 @@ DEFINES static_nss profile libc_cv_multidir +libc_cv_have_qp_float libc_cv_pie_default libc_cv_cc_pie_default libc_cv_pic_default @@ -6805,6 +6806,29 @@ libc_cv_pie_default=$libc_cv_cc_pie_default +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether quad-precision floating-point is supported" >&5 +$as_echo_n "checking whether quad-precision floating-point is supported... " >&6; } +if ${libc_cv_have_qp_float+:} false; then : + $as_echo_n "(cached) " >&6 +else + libc_cv_have_qp_float=yes +cat > conftest.c < +#if __HAVE_FLOAT128 +# error quad-precision floating-point is supported +#endif +EOF +if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then + libc_cv_have_qp_float=no +fi +rm -f conftest.* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_qp_float" >&5 +$as_echo "$libc_cv_have_qp_float" >&6; } + +config_vars="$config_vars +have-qp-float = $libc_cv_have_qp_float" + # Set the `multidir' variable by grabbing the variable from the compiler. # We do it once and save the result in a generated makefile. libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory` diff --git a/configure.ac b/configure.ac index 93e68fb696..7ee79162be 100644 --- a/configure.ac +++ b/configure.ac @@ -1821,6 +1821,21 @@ libc_cv_pie_default=$libc_cv_cc_pie_default AC_SUBST(libc_cv_cc_pie_default) AC_SUBST(libc_cv_pie_default) +AC_CACHE_CHECK([whether quad-precision floating-point is supported], +libc_cv_have_qp_float, [libc_cv_have_qp_float=yes +cat > conftest.c < +#if __HAVE_FLOAT128 +# error quad-precision floating-point is supported +#endif +EOF +if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then + libc_cv_have_qp_float=no +fi +rm -f conftest.*]) +AC_SUBST(libc_cv_have_qp_float) +LIBC_CONFIG_VAR([have-qp-float], [$libc_cv_have_qp_float]) + # Set the `multidir' variable by grabbing the variable from the compiler. # We do it once and save the result in a generated makefile. libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`