From patchwork Tue Jun 9 15:58:57 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: 39524 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 170BC388A836; Tue, 9 Jun 2020 15:59:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 170BC388A836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591718346; bh=xE8QaoULt2G7SqQ9Ov2e8uKtCkVdaYidRl+qL5A07p8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xhV2k07z6QhN0nkLNZ2IK6lV4Jz8NorLIyznwk1e0mkZfbHoBUTm0/FIzYTjAY/9L xTscFnB3v9MZ7KSDTBAQlOeelusZ2esb83Bcjk2P+E8wRu0U1V6dvJfX3je4qNVnZp w80UoV5zvRDS47oMKSqqbVIwIZx7i8zE+NYuMR3c= 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 3DCC938708EE for ; Tue, 9 Jun 2020 15:59:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3DCC938708EE Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 059FWFDf154335 for ; Tue, 9 Jun 2020 11:59:03 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 31hrq860h5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Jun 2020 11:59:02 -0400 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 059FsYxs010459 for ; Tue, 9 Jun 2020 15:59:02 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02dal.us.ibm.com with ESMTP id 31g2s9xgnj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Jun 2020 15:59:02 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 059Fx1lj50790796 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 9 Jun 2020 15:59:01 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 74C41AE05F for ; Tue, 9 Jun 2020 15:59:01 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 95D80AE05C for ; Tue, 9 Jun 2020 15:59:00 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.163.52.147]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP for ; Tue, 9 Jun 2020 15:59:00 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCHv3 1/3] ldbl-128: refactor nexttoward alias using new macro Date: Tue, 9 Jun 2020 10:58:57 -0500 Message-Id: X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-09_09:2020-06-09, 2020-06-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 cotscore=-2147483648 suspectscore=4 clxscore=1015 priorityscore=1501 malwarescore=0 mlxlogscore=892 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006090115 X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, 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: "Paul E. Murphy via Libc-alpha" From: "Paul E. Murphy" Reply-To: "Paul E. Murphy" Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" A new macro, libm_alias_exclusive_ldouble, is added to expose an aliased symbol which should only be defined for the long double type. This enables a more controlled mechanism to define aliases when long double may be aliased from _Float128, and the removal of the almost trivial s_nextafterf128.c sitting in ldbl-128ibm-compat. --- sysdeps/generic/libm-alias-ldouble.h | 6 ++++++ sysdeps/ieee754/float128/float128_private.h | 4 ++++ sysdeps/ieee754/ldbl-128/s_nextafterl.c | 3 +-- .../ldbl-128ibm-compat/libm-alias-float128.h | 5 +++++ .../ldbl-128ibm-compat/s_nextafterf128.c | 20 ------------------- 5 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c diff --git a/sysdeps/generic/libm-alias-ldouble.h b/sysdeps/generic/libm-alias-ldouble.h index 724a121792..8cd454dc9b 100644 --- a/sysdeps/generic/libm-alias-ldouble.h +++ b/sysdeps/generic/libm-alias-ldouble.h @@ -62,4 +62,10 @@ /* Likewise, but without the R suffix. */ #define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, ) +/* Generate symbols which are defined for long double types, but are + not defined for _FloatX types. e.g nextafterl and nexttowardl. */ +#define libm_alias_exclusive_ldouble(from, to) \ + strong_alias (from ## l, __ ## to ## l) \ + weak_alias (__ ## to ## l, to ## l) + #endif diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h index ab6fc9f3c9..ec664ed673 100644 --- a/sysdeps/ieee754/float128/float128_private.h +++ b/sysdeps/ieee754/float128/float128_private.h @@ -128,6 +128,10 @@ #include +/* Define here to allow float128 to ldbl redirects to redefine. */ +#undef libm_alias_exclusive_ldouble +#define libm_alias_exclusive_ldouble(from, to) + #include #undef libm_alias_ldouble_r #define libm_alias_ldouble_r(from, to, r) libm_alias_float128_r (from, to, r) diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c index 60fdae648f..8d4abacb0d 100644 --- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c +++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c @@ -84,5 +84,4 @@ _Float128 __nextafterl(_Float128 x, _Float128 y) return x; } libm_alias_ldouble (__nextafter, nextafter) -strong_alias (__nextafterl, __nexttowardl) -weak_alias (__nextafterl, nexttowardl) +libm_alias_exclusive_ldouble (__nextafter, nexttoward) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h index 48c6f9e729..66d2771291 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h +++ b/sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h @@ -61,4 +61,9 @@ /* Likewise, but without the R suffix. */ #define libm_alias_float128(from, to) libm_alias_float128_r (from, to, ) +/* Generate symbols for exclusive ldouble symbols not defined for _Float128. */ +#undef libm_alias_exclusive_ldouble +#define libm_alias_exclusive_ldouble(from, to) \ + libm_alias_float128_other_r_ldbl(from, to,) + #endif diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c deleted file mode 100644 index cc30ae02d7..0000000000 --- a/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Provide nexttowardl and nextafterl implementations for IEEE long double. - Copyright (C) 2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ -#include "../float128/s_nextafterf128.c" - -strong_alias (__nextafterieee128, __nexttowardieee128)