From patchwork Mon Mar 1 17:51:38 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: 42187 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 B2C36384800F; Mon, 1 Mar 2021 17:51:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2C36384800F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614621108; bh=UCuXRDw5lrs04WCkPFoJQJWEZYcN1T5NBWHqgydHH+0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rn/qoFMeLXvn1f4YL5Pr3JuEoSf+vbppkkGv/6rNlALgV3dAqAHwZS3swpAAd1HY0 fIW5qx3eRE3BVXMmsDQk3nVqyABxWh1pF+/VRBIs+jmnRqAXrWWGwUBUGXywEeoQx9 GVZw7UN750pHIctjeqcSjSbrZLgfOVI+jS9OWdB8= 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 4D800386185F for ; Mon, 1 Mar 2021 17:51:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4D800386185F 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 121HY8mZ090329 for ; Mon, 1 Mar 2021 12:51:46 -0500 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 370td0yp14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 12:51:45 -0500 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 121HnI1e013492 for ; Mon, 1 Mar 2021 17:51:45 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01wdc.us.ibm.com with ESMTP id 36ydq8rvqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 17:51:45 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 121HpiqI28770724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Mar 2021 17:51:44 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7E19112062; Mon, 1 Mar 2021 17:51:44 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D6C6112061; Mon, 1 Mar 2021 17:51:44 +0000 (GMT) Received: from localhost (unknown [9.160.75.103]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 1 Mar 2021 17:51:43 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v2 1/3] powerpc: Add optimized ilogb* for POWER9 Date: Mon, 1 Mar 2021 14:51:38 -0300 Message-Id: <20210301175140.29109-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-01_11:2021-03-01, 2021-03-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 adultscore=0 suspectscore=0 priorityscore=1501 phishscore=0 malwarescore=0 mlxlogscore=910 impostorscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103010140 X-Spam-Status: No, score=-11.9 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, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes since v1: - Move the builtins definitions to powerpc's math_private.h. - Check if the correct GCC version is used. --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 | 20 +++++++++++- .../powerpc64/le/fpu/w_ilogb_template.c | 31 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c diff --git a/sysdeps/powerpc/fpu/math_private.h b/sysdeps/powerpc/fpu/math_private.h index 91b1361749..accc28d091 100644 --- a/sysdeps/powerpc/fpu/math_private.h +++ b/sysdeps/powerpc/fpu/math_private.h @@ -25,7 +25,23 @@ #include_next -#if defined _ARCH_PWR9 && __HAVE_DISTINCT_FLOAT128 +#ifdef _ARCH_PWR9 + +#define __builtin_test_dc_ilogbf __builtin_test_dc_ilogb +#define __builtin_ilogbf __builtin_ilogb + +#define __builtin_test_dc_ilogbl __builtin_test_dc_ilogbf128 +#define __builtin_ilogbl __builtin_ilogbf128 + +#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) { @@ -35,4 +51,6 @@ __ieee754_sqrtf128 (_Float128 __x) } #endif +#endif /* _ARCH_PWR9 */ + #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..17ac7809e1 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c @@ -0,0 +1,31 @@ +/* The builtins used are only available with GCC 8.0 or newer. */ +#if defined _ARCH_PWR9 && __GNUC_PREREQ (8, 0) +#include +#include +#include +#include +#include + +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 From patchwork Mon Mar 1 17:51:39 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: 42188 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 48FDF393A435; Mon, 1 Mar 2021 17:51:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48FDF393A435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614621114; bh=dpez5ODDvM10z3FpL9aUdQjE/mheiYOIUWO9TKlVKw0=; 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=Yn3i3Wi2m2kfJIpFpVK1xoFPp19d4WxVFT/VqHevtHaMDd6Gz0t2fVKeYV0u1PbGn mJxUsYT8/tD1BvhJZ2adRLZAzwsHpgJxvnSiYZ3RX+2fon+BeuSX0N7gEgre7ijPxM 7ml78bPekXaSsrYHeLBFZQLVgwPO/h/a09mMpY3M= 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 E64193938C1C for ; Mon, 1 Mar 2021 17:51:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E64193938C1C Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 121HWaZC017805 for ; Mon, 1 Mar 2021 12:51:51 -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 3712hyx9ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 12:51:51 -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 121HkVKj015875 for ; Mon, 1 Mar 2021 17:51:51 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02dal.us.ibm.com with ESMTP id 3710sqa9gn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 17:51:50 +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 121HpnSF11927972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Mar 2021 17:51:49 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4EE67C6055; Mon, 1 Mar 2021 17:51:49 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BFEE5C605A; Mon, 1 Mar 2021 17:51:48 +0000 (GMT) Received: from localhost (unknown [9.160.75.103]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Mar 2021 17:51:48 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v2 2/3] powerpc: Add optimized llogb* for POWER9 Date: Mon, 1 Mar 2021 14:51:39 -0300 Message-Id: <20210301175140.29109-2-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301175140.29109-1-rzinsly@linux.ibm.com> References: <20210301175140.29109-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-01_12:2021-03-01, 2021-03-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=879 impostorscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103010140 X-Spam-Status: No, score=-11.9 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, Raphael Moreira Zinsly Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Changes since v1: - Check if the correct GCC version is used. --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 | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.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..4c1642274f --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c @@ -0,0 +1,40 @@ +/* The builtins used are only available with GCC 8.0 or newer. */ +#if defined _ARCH_PWR9 && __GNUC_PREREQ (8, 0) +#include +#include +#include +#include +#include + +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 From patchwork Mon Mar 1 17:51:40 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: 42189 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 F360D393A408; Mon, 1 Mar 2021 17:51:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F360D393A408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614621119; 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=W2sSQduDlwM7sCozKHgFdJhvcDBXdZVbXIJtX8sVI+mSFFFXWJNNtiDNRilSp8cI/ aVAdcXI3PlXSsjTOQqXGz8aBvi/5O29UzEr1N6M7s9q2XhcaMjO51r2tWZMJrdZT4f b3tTmCbYVkRWv0oEad5cwzODgKnfi4M3IUn/VAT8= 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 993D7386185F for ; Mon, 1 Mar 2021 17:51:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 993D7386185F Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 121HZ5SZ183651 for ; Mon, 1 Mar 2021 12:51:55 -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 3712yk4gwy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 12:51:55 -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 121HkYtv015924 for ; Mon, 1 Mar 2021 17:51:54 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma02dal.us.ibm.com with ESMTP id 3710sqa9h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 01 Mar 2021 17:51:54 +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 121Hpqru12976600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Mar 2021 17:51:53 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0DCDC6057; Mon, 1 Mar 2021 17:51:52 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E2DAC6059; Mon, 1 Mar 2021 17:51:52 +0000 (GMT) Received: from localhost (unknown [9.160.75.103]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Mar 2021 17:51:52 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH v2 3/3] benchtests: Add ilogb* tests Date: Mon, 1 Mar 2021 14:51:40 -0300 Message-Id: <20210301175140.29109-3-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210301175140.29109-1-rzinsly@linux.ibm.com> References: <20210301175140.29109-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-01_12:2021-03-01, 2021-03-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103010140 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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, 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