From patchwork Fri Feb 26 16:08:12 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: 42147 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 89EC9398B15B; Fri, 26 Feb 2021 16:08:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89EC9398B15B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614355707; bh=Ipr1wrXVNSyiTu/gWEfzat3+6woE62ees+r/Hrj2XZU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=uYNHIzx4zg9RBZRXn8fI4d5PbMpdlFjURkK+C6m2nNfjisQ9iN51orrTIfpcDRfhA hHIZveY7l7xiZdePMXj5T2Ipccj2ov7CfsnbjJV2Prs/1SQGwiI/eKHKD3Bz32LRB9 XSswViuc7exX5T0/VQgbd75VcrV39Pb2dQiGLkUQ= 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 666A6398B155 for ; Fri, 26 Feb 2021 16:08:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 666A6398B155 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11QG3TPm150763 for ; Fri, 26 Feb 2021 11:08:23 -0500 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 36xx5uauec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 11:08:23 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11QG2Eu1023808 for ; Fri, 26 Feb 2021 16:08:21 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma04dal.us.ibm.com with ESMTP id 36y41303n5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 16:08:21 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11QG8LZn45744540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2021 16:08:21 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F12EDAE05F; Fri, 26 Feb 2021 16:08:20 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7C977AE05C; Fri, 26 Feb 2021 16:08:20 +0000 (GMT) Received: from localhost (unknown [9.65.197.186]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 26 Feb 2021 16:08:20 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH 1/3] powerpc: Add optimized ilogb* for POWER9 Date: Fri, 26 Feb 2021 13:08:12 -0300 Message-Id: <20210226160814.24963-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-02-26_05:2021-02-26, 2021-02-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=742 lowpriorityscore=0 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 impostorscore=0 clxscore=1011 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102260121 X-Spam-Status: No, score=-11.7 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 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" 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. --- .../powerpc64/le/fpu/multiarch/math_private.h | 14 +++++++++ .../powerpc64/le/fpu/w_ilogb_template.c | 29 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math_private.h b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math_private.h index 0970709cff..955497e98e 100644 --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math_private.h +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/math_private.h @@ -1,6 +1,20 @@ #ifndef MATH_PRIVATE_PPC64LE_MA #define MATH_PRIVATE_PPC64LE_MA 1 +#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 + #include_next #if defined (_F128_ENABLE_IFUNC) 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..3d76a3d0fb --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_ilogb_template.c @@ -0,0 +1,29 @@ +#ifdef _ARCH_PWR9 +#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) + +#endif From patchwork Fri Feb 26 16:08:13 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: 42148 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 1CF42398B163; Fri, 26 Feb 2021 16:08:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CF42398B163 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614355712; bh=BrqiE0ieLIMmQzGrI37V/uaJjNOwSU6U5UNl7kks5Uc=; 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=snN/IWEbzepW6ll2K4GsLEZa86zTnLooknLyVB1phzAvtIPBt1FQ7x7kuIznFvqm7 LnsFG5wwjW5FpDu0NAmeHNtkQqBTDt7QS+BWanzq0y6e6OFN7poj6reGnNqQhiEQh9 zZ554Ot4b/F69EYMOdNDGMwNsnt35F2OfYkGKkZk= 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 79B9D398B15F for ; Fri, 26 Feb 2021 16:08:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 79B9D398B15F 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 11QG4Y0H094914 for ; Fri, 26 Feb 2021 11:08:28 -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 36y209n2k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 11:08:28 -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 11QG27wQ022897 for ; Fri, 26 Feb 2021 16:08:27 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma03dal.us.ibm.com with ESMTP id 36v5y9v8dy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 16:08:27 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11QG8QOt42533356 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2021 16:08:27 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD048112062; Fri, 26 Feb 2021 16:08:26 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 68C91112061; Fri, 26 Feb 2021 16:08:26 +0000 (GMT) Received: from localhost (unknown [9.65.197.186]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 26 Feb 2021 16:08:26 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH 2/3] powerpc: Add optimized llogb* for POWER9 Date: Fri, 26 Feb 2021 13:08:13 -0300 Message-Id: <20210226160814.24963-2-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210226160814.24963-1-rzinsly@linux.ibm.com> References: <20210226160814.24963-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-02-26_05:2021-02-26, 2021-02-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=728 spamscore=0 clxscore=1015 mlxscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102260121 X-Spam-Status: No, score=-11.8 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 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" 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 | 38 +++++++++++++++++++ 1 file changed, 38 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..ace6178fad --- /dev/null +++ b/sysdeps/powerpc/powerpc64/le/fpu/w_llogb_template.c @@ -0,0 +1,38 @@ +#ifdef _ARCH_PWR9 +#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) + +#endif From patchwork Fri Feb 26 16:08:14 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: 42149 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com 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 BE26D398B161; Fri, 26 Feb 2021 16:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE26D398B161 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614355715; 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=TwL1oPazXeqGn43RwuTUIy0aPHGZJk+24I7Xa5bkzWrrb4ciopvsNpgtFr4d2eoH2 6oRUaoE8ODCFzi+33sxM3A2EAnTHW6AVgXqN3lC3UQ7G9LI/Bzk90QBTV8jgHfpu7b dV+e1i5lzL5+nQmvtSUgkrpX1k75+qJ7Fq0Ah0d8= 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 913B2398B15F for ; Fri, 26 Feb 2021 16:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 913B2398B15F Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 11QG5r6g041558 for ; Fri, 26 Feb 2021 11:08:33 -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 36y43tg9r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 11:08:33 -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 11QG1YBF023627 for ; Fri, 26 Feb 2021 16:08:32 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 36tt2aksn4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 26 Feb 2021 16:08:32 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11QG8Vt914746106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 26 Feb 2021 16:08:31 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82809112064; Fri, 26 Feb 2021 16:08:31 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0E3C9112061; Fri, 26 Feb 2021 16:08:31 +0000 (GMT) Received: from localhost (unknown [9.65.197.186]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 26 Feb 2021 16:08:30 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH 3/3] benchtests: Add ilogb* tests Date: Fri, 26 Feb 2021 13:08:14 -0300 Message-Id: <20210226160814.24963-3-rzinsly@linux.ibm.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210226160814.24963-1-rzinsly@linux.ibm.com> References: <20210226160814.24963-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-02-26_05:2021-02-26, 2021-02-26 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 adultscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 mlxscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102260119 X-Spam-Status: No, score=-12.1 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, 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