From patchwork Fri Mar 27 21:17:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. Murphy" X-Patchwork-Id: 38636 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Return-Path: 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 079DE385E010 for ; Fri, 27 Mar 2020 21:18:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 079DE385E010 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02RL2lFJ062682 for ; Fri, 27 Mar 2020 17:18:07 -0400 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 3017jupt0w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 17:18:07 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02RLHX6f014058 for ; Fri, 27 Mar 2020 21:18:06 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02dal.us.ibm.com with ESMTP id 2ywaw32jbq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Mar 2020 21:18:06 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02RLI5HR52887912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 27 Mar 2020 21:18:05 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0491136060 for ; Fri, 27 Mar 2020 21:18:04 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59B3613604F for ; Fri, 27 Mar 2020 21:18:04 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.139.44]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 21:18:04 +0000 (GMT) From: "Paul E. Murphy" To: libc-alpha@sourceware.org Subject: [PATCH v2 02/10] ldbl-128ibm: simplify iscanonical.h Date: Fri, 27 Mar 2020 16:17:53 -0500 Message-Id: <20200327211801.31234-3-murphyp@linux.vnet.ibm.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> References: <20200327211801.31234-1-murphyp@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-27_08:2020-03-27, 2020-03-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 mlxscore=0 phishscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 clxscore=1015 mlxlogscore=870 bulkscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003270169 X-Spam-Status: No, score=-24.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, 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-List-Received-Date: Fri, 27 Mar 2020 21:18:09 -0000 The test for enabling _Float128 or IEEE 128 long double can be greatly simplified knowing that there is no ibm128, thus we require no special cases, and everything is canonical. This reverts the changes to ldbl-128ibm iscanonical.h from commit 8dbfea3a2094798a52cebddde01d255483f49665 and extends the check for __NO_LONG_DOUBLE_MATH to include a check for float128 redirects to long double. Reviewed-by: Tulio Magno Quites Machado Filho --- sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h index 70da85f2cb..b2021b5d64 100644 --- a/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h +++ b/sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h @@ -20,15 +20,11 @@ # error "Never use directly; include instead." #endif -#ifdef __NO_LONG_DOUBLE_MATH +#if defined (__NO_LONG_DOUBLE_MATH) || __LONG_DOUBLE_USES_FLOAT128 == 1 # define iscanonical(x) ((void) (__typeof (x)) (x), 1) #else -# if __LONG_DOUBLE_USES_FLOAT128 == 1 -# define __iscanonicall(x) ((void) (__typeof (x)) (x), 1) -# else extern int __iscanonicall (long double __x) __THROW __attribute__ ((__const__)); -# endif # define __iscanonicalf(x) ((void) (__typeof (x)) (x), 1) # define __iscanonical(x) ((void) (__typeof (x)) (x), 1) # if __HAVE_DISTINCT_FLOAT128 @@ -54,9 +50,7 @@ extern "C++" { inline int iscanonical (float __val) { return __iscanonicalf (__val); } inline int iscanonical (double __val) { return __iscanonical (__val); } inline int iscanonical (long double __val) { return __iscanonicall (__val); } -/* When using an IEEE 128-bit long double, _Float128 is defined as long double - in C++. */ -# if __HAVE_DISTINCT_FLOAT128 && __HAVE_FLOAT128_UNLIKE_LDBL +# if __HAVE_DISTINCT_FLOAT128 inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); } # endif }