From patchwork Mon May 4 22:23:50 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: 38912 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 77C873938C05; Mon, 4 May 2020 22:24:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77C873938C05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1588631042; bh=aTHhd39bU019AynzJcySAo+sdByDQO7fUArbmNDwjI0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=mwM0lmaE/K01yyZpLPWznI+LOYTarA94n6cs7s9IovAL4dhAJpjNrcdh0GYMEE9Vv 2H73/uH39LhVubJ3BsA5qSideWgczU9Vnycv4TQSoy0G3r5e6MtK03jv9jBwAQ3JCL 7GQG3+ExMacS/D90GT8+Kf+sk3C9ji7/294JRkkE= 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 AF21F3851C32 for ; Mon, 4 May 2020 22:23:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AF21F3851C32 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 044M1J9F143443 for ; Mon, 4 May 2020 18:23:56 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com with ESMTP id 30s2g27538-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 18:23:56 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 044MKtds000843 for ; Mon, 4 May 2020 22:23:55 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02wdc.us.ibm.com with ESMTP id 30s0g6c4ch-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 04 May 2020 22:23:55 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 044MNsoj58982746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 4 May 2020 22:23:55 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E038B7805C for ; Mon, 4 May 2020 22:23:54 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8115E7805F for ; Mon, 4 May 2020 22:23:54 +0000 (GMT) Received: from brokenarrow.ibmuc.com (unknown [9.85.137.49]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP for ; Mon, 4 May 2020 22:23:54 +0000 (GMT) To: libc-alpha@sourceware.org Subject: [PATCH 1/4] ldbl-128: refactor nexttoward alias using new macro Date: Mon, 4 May 2020 17:23:50 -0500 Message-Id: X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-05-04_11:2020-05-04, 2020-05-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=4 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 mlxlogscore=927 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040169 X-Spam-Status: No, score=-20.4 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 f97463d9dc..5e5f9cc009 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)