From patchwork Thu Mar 4 15:00:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael M Zinsly X-Patchwork-Id: 1447389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=q1Jaajtn; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrvFg0TRCz9sSC for ; Fri, 5 Mar 2021 02:01:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 787DA388CC01; Thu, 4 Mar 2021 15:01:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 787DA388CC01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614870068; bh=usmQ3c3zwi4x3f4uhYTRD0o4znsvTuY6bWrHs5sOK/Y=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=q1JaajtnNmpYeKeY+TkD/VKgeTlerdICabpc1+KlSK6s21VuQTx3Y5nSo7qiZfili FPsNT8OmgLdSKq1Huf3dqPfnMaR9QwAa0uarLbqaWfoeB96edBFeUr8bPqEHy2WvFi uBfk1vFFFrucddg2yoUIPem59tEMnLtley6PDfQE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 00BD0384647C for ; Thu, 4 Mar 2021 15:01:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 00BD0384647C Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 124ErkZY158426 for ; Thu, 4 Mar 2021 10:01:05 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3731qagdbx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 10:01:05 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 124F0f03018229 for ; Thu, 4 Mar 2021 15:01:04 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02dal.us.ibm.com with ESMTP id 3710sr6dpa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 15:01:04 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 124F13kt29819260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Mar 2021 15:01:03 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E192112061; Thu, 4 Mar 2021 15:01:03 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B6BF11206B; Thu, 4 Mar 2021 15:01:02 +0000 (GMT) Received: from localhost (unknown [9.160.97.113]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 4 Mar 2021 15:01:02 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v3 1/3] powerpc: Add optimized ilogb* for POWER9 Date: Thu, 4 Mar 2021 12:00:55 -0300 Message-Id: <20210304150057.14418-1-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-04_03:2021-03-03, 2021-03-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 adultscore=0 mlxlogscore=857 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103040070 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, UNWANTED_LANGUAGE_BODY 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: , X-Patchwork-Original-From: Raphael Moreira Zinsly via Libc-alpha From: Raphael M Zinsly Reply-To: Raphael Moreira Zinsly Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, pc@us.ibm.com, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes since v2: - Moved the GCC version test to math_private.h and start using __has_builtin(). - Removed the optimization from long double as it was converting ibm128 to float128. ---8<--- The instructions xsxexpdp and xsxexpqp introduced on POWER9 extract the exponent from a double-precision and quad-precision floating-point respectively, thus they can be used to improve ilogb, ilogbf and ilogbf128. --- sysdeps/powerpc/fpu/math_private.h | 26 +++++++++++++++- .../powerpc64/le/fpu/w_ilogb_template.c | 30 +++++++++++++++++++ sysdeps/powerpc/powerpc64/le/fpu/w_ilogbl.c | 3 ++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_ilogbl.c diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h index 91b1361749..21628f3bda 100644 --- a/sysdeps/powerpc/fpu/math_private.h +++ b/sysdeps/powerpc/fpu/math_private.h @@ -25,7 +25,28 @@ #include_next -#if defined _ARCH_PWR9 && __HAVE_DISTINCT_FLOAT128 +#ifdef _ARCH_PWR9 + +#if __GNUC_PREREQ (8, 0) +# define _GL_HAS_BUILTIN_ILOGB 1 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_ILOGB __has_builtin (__builtin_vsx_scalar_extract_exp) +#else +# define _GL_HAS_BUILTIN_ILOGB 0 +#endif + +#define __builtin_test_dc_ilogbf __builtin_test_dc_ilogb +#define __builtin_ilogbf __builtin_ilogb + +#define __builtin_test_dc_ilogb(x, y) \ + __builtin_vsx_scalar_test_data_class_dp(x, y) +#define __builtin_ilogb(x) __builtin_vsx_scalar_extract_exp(x) - 0x3ff + +#define __builtin_test_dc_ilogbf128(x, y) \ + __builtin_vsx_scalar_test_data_class_qp(x, y) +#define __builtin_ilogbf128(x) __builtin_vsx_scalar_extract_expq(x) - 0x3fff + +#if __HAVE_DISTINCT_FLOAT128 extern __always_inline _Float128 __ieee754_sqrtf128 (_Float128 __x) { @@ -34,5 +55,8 @@ __ieee754_sqrtf128 (_Float128 __x) return __z; } #endif +#else /* !_ARCH_PWR9 */ +#define _GL_HAS_BUILTIN_ILOGB 0 +#endif #endif /* _PPC_MATH_PRIVATE_H_ */ diff --git a/sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c new file mode 100644 index 0000000000..b5c1c0aa9d --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include + +#if _GL_HAS_BUILTIN_ILOGB +int +M_DECL_FUNC (__ilogb) (FLOAT x) +{ + int r; + /* Check for exceptional cases. */ + if (! M_SUF(__builtin_test_dc_ilogb) (x, 0x7f)) + r = M_SUF (__builtin_ilogb) (x); + else + /* Fallback to the generic ilogb if x is NaN, Inf or subnormal. */ + r = M_SUF (__ieee754_ilogb) (x); + if (__builtin_expect (r == FP_ILOGB0, 0) + || __builtin_expect (r == FP_ILOGBNAN, 0) + || __builtin_expect (r == INT_MAX, 0)) + { + __set_errno (EDOM); + __feraiseexcept (FE_INVALID); + } + return r; +} +declare_mgen_alias (__ilogb, ilogb) +#else +#include +#endif diff --git a/sysdeps/powerpc/powerpc64/le/fpu/w_ilogbl.c b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogbl.c new file mode 100644 index 0000000000..215a00141d --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogbl.c @@ -0,0 +1,3 @@ +/* Skip the optimization for long double as it uses ibm128. */ +#include +#include From patchwork Thu Mar 4 15:00:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael M Zinsly X-Patchwork-Id: 1447390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=nwph1kC6; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrvFt1S46z9sSC for ; Fri, 5 Mar 2021 02:01:22 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 10F423AA9823; Thu, 4 Mar 2021 15:01:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10F423AA9823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614870079; bh=wEl/RB1ISC6JdP7Rg8SPOee9O6A3rGhG3WCEr3zisVM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nwph1kC6SpKpDmmM+p6BdCK9RAIiJyXpImLFAKPgNm/X8Ar8RQSWaVHSkDChPBfzE M1kk7+gHZ+lDqVbnHK+WnIG5ac2guf/ibqtby2Yd77eDRt9FsJQX6ebY2mNxdP2XOw Me/4DiJDlVpblsc8GLIIYOpmMcq5OY4SbFGVMavc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 1EA8E384647C for ; Thu, 4 Mar 2021 15:01:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EA8E384647C Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 124EmRv0130721 for ; Thu, 4 Mar 2021 10:01:15 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 3731mxgxdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 10:01:15 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 124ExEEt008316 for ; Thu, 4 Mar 2021 15:01:14 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma01dal.us.ibm.com with ESMTP id 371qmuuhuh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 15:01:14 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 124F1A6f9896376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Mar 2021 15:01:10 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4980C6067; Thu, 4 Mar 2021 15:01:09 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4513DC6063; Thu, 4 Mar 2021 15:01:09 +0000 (GMT) Received: from localhost (unknown [9.160.97.113]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 4 Mar 2021 15:01:08 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v3 2/3] powerpc: Add optimized llogb* for POWER9 Date: Thu, 4 Mar 2021 12:00:56 -0300 Message-Id: <20210304150057.14418-2-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210304150057.14418-1-rzinsly@linux.ibm.com> References: <20210304150057.14418-1-rzinsly@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-04_03:2021-03-03, 2021-03-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 mlxlogscore=976 priorityscore=1501 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103040070 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , X-Patchwork-Original-From: Raphael Moreira Zinsly via Libc-alpha From: Raphael M Zinsly Reply-To: Raphael Moreira Zinsly Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, pc@us.ibm.com, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes since v2: - Removed the GCC version test and used the _GL_HAS_BUILTIN_ILOGB. - Removed the optimization from long double as it was converting ibm128 to float128. ---8<--- The POWER9 builtins used to improve the ilogb* functions can be used in the llogb* functions as well. --- .../powerpc64/le/fpu/w_llogb_template.c | 39 +++++++++++++++++++ sysdeps/powerpc/powerpc64/le/fpu/w_llogbl.c | 3 ++ 2 files changed, 42 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_llogbl.c diff --git a/sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c b/sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c new file mode 100644 index 0000000000..d00b71d2a3 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +#if _GL_HAS_BUILTIN_ILOGB +long int +M_DECL_FUNC (__llogb) (FLOAT x) +{ + int r; + /* Check for exceptional cases. */ + if (! M_SUF(__builtin_test_dc_ilogb) (x, 0x7f)) + r = M_SUF (__builtin_ilogb) (x); + else + /* Fallback to the generic ilogb if x is NaN, Inf or subnormal. */ + r = M_SUF (__ieee754_ilogb) (x); + long int lr = r; + if (__glibc_unlikely (r == FP_ILOGB0) + || __glibc_unlikely (r == FP_ILOGBNAN) + || __glibc_unlikely (r == INT_MAX)) + { +#if LONG_MAX != INT_MAX + if (r == FP_ILOGB0) + lr = FP_LLOGB0; + else if (r == FP_ILOGBNAN) + lr = FP_LLOGBNAN; + else + lr = LONG_MAX; +#endif + __set_errno (EDOM); + __feraiseexcept (FE_INVALID); + } + return lr; +} +declare_mgen_alias (__llogb, llogb) +#else +#include +#endif diff --git a/sysdeps/powerpc/powerpc64/le/fpu/w_llogbl.c b/sysdeps/powerpc/powerpc64/le/fpu/w_llogbl.c new file mode 100644 index 0000000000..b7e132a1de --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_llogbl.c @@ -0,0 +1,3 @@ +/* Skip the optimization for long double as it uses ibm128. */ +#include +#include From patchwork Thu Mar 4 15:00:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael M Zinsly X-Patchwork-Id: 1447391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=TC8o3r/b; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrvG25c2qz9sSC for ; Fri, 5 Mar 2021 02:01:30 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B1973AA9C42; Thu, 4 Mar 2021 15:01:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B1973AA9C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614870088; bh=+vUqxyo4fRJ9k3wAaStpC4CQzqgIiaqAk/Po9YN3MlA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TC8o3r/bnxlcBnvsmRU6wPNtyL3hzXQxqSE1VGdtXxkZ3HmGHWinNLi/pb2cH5EFM D9maOLf49oR/bCtQ33fPGCihraCUujFTeNPOHytNjGrniQxA6DCqiRsryIzwNPYNJs g5iSTNs62xz/l27D5jWDF8UDS5Wj1ENQ22RLMhEI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C3E493AA991D for ; Thu, 4 Mar 2021 15:01:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C3E493AA991D Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 124EhQ7f135810 for ; Thu, 4 Mar 2021 10:01:26 -0500 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 3731jes7gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 10:01:22 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 124F0INl018033 for ; Thu, 4 Mar 2021 15:01:21 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03dal.us.ibm.com with ESMTP id 3720r0q2yb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 04 Mar 2021 15:01:21 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 124F1JMS19530190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 4 Mar 2021 15:01:19 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6CE0BC6062; Thu, 4 Mar 2021 15:01:19 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB92BC6065; Thu, 4 Mar 2021 15:01:18 +0000 (GMT) Received: from localhost (unknown [9.160.97.113]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 4 Mar 2021 15:01:18 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v3 3/3] benchtests: Add ilogb* tests Date: Thu, 4 Mar 2021 12:00:57 -0300 Message-Id: <20210304150057.14418-3-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210304150057.14418-1-rzinsly@linux.ibm.com> References: <20210304150057.14418-1-rzinsly@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-04_03:2021-03-03, 2021-03-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103040070 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , X-Patchwork-Original-From: Raphael Moreira Zinsly via Libc-alpha From: Raphael M Zinsly Reply-To: Raphael Moreira Zinsly Cc: murphyp@linux.ibm.com, tuliom@linux.ibm.com, pc@us.ibm.com, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Add a benchtest to ilogb, ilogbf and ilogbf128 based on the logb* benchtests. --- benchtests/Makefile | 4 ++-- benchtests/ilogb-inputs | 11 +++++++++++ benchtests/ilogbf-inputs | 11 +++++++++++ benchtests/ilogbf128-inputs | 11 +++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 benchtests/ilogb-inputs create mode 100644 benchtests/ilogbf-inputs create mode 100644 benchtests/ilogbf128-inputs diff --git a/benchtests/Makefile b/benchtests/Makefile index 12bd25a57c..0c99547074 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -25,10 +25,10 @@ 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 + exp10f ilogb ilogbf ifneq (,$(filter yes,$(float128-fcts) $(float128-alias-fcts))) -bench-math += expf128 powf128 sinf128 +bench-math += expf128 powf128 sinf128 ilogbf128 endif bench-pthread := pthread_once thread_create pthread-locks diff --git a/benchtests/ilogb-inputs b/benchtests/ilogb-inputs new file mode 100644 index 0000000000..4b3b38bd99 --- /dev/null +++ b/benchtests/ilogb-inputs @@ -0,0 +1,11 @@ +## args: double +## ret: int +## includes: math.h + +## name: subnormal +0x0.0000000000001p-1022 +0x0.fffffffffffffp-1022 + +## name: normal +1.0 +1024.0 diff --git a/benchtests/ilogbf-inputs b/benchtests/ilogbf-inputs new file mode 100644 index 0000000000..ea391d3b85 --- /dev/null +++ b/benchtests/ilogbf-inputs @@ -0,0 +1,11 @@ +## args: float +## ret: int +## includes: math.h + +## name: subnormal +0x1p-149 +0x1.fffff8p-128 + +## name: normal +1.0 +1024.0 diff --git a/benchtests/ilogbf128-inputs b/benchtests/ilogbf128-inputs new file mode 100644 index 0000000000..bfbfc93714 --- /dev/null +++ b/benchtests/ilogbf128-inputs @@ -0,0 +1,11 @@ +## args: _Float128 +## ret: int +## includes: math.h + +## name: subnormal +6.47517511943802511092443895822764655e-4966f128 +0x1.fffffffffffffff8p-16383f128 + +## name: normal +1.0 +-0x8.2faf442f390a9211f5af128673fp+0L