From patchwork Wed Jun 6 22:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tulio Magno Quites Machado Filho X-Patchwork-Id: 926063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92970-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="Ccbj6ODn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 411Nwv6Jhrz9rxs for ; Thu, 7 Jun 2018 08:42:55 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=FJcFaPKbbjRmWkuHdl/DhzaokDqvHtO sXB+17hsFf/m9cn/vVcgejGMPnALuWOObbT97J/DJ9WyDfUqoLDqUsrk3ug9vXNF wfLxFhy5XuSq3+kzUa/ASl9qmeHRKuGBy2H2lgut4Ig2TUVEj9nao9jKJK1igFUV Px1m88moNDeA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=UybgHEm5xDull/MgEdxremdvo6Q=; b=Ccbj6 ODnwufZeee+VPKJ5DDoHbtN9O5ukjK3VmMhGQNZmhw0HAZzfq3H4CcljYhHmPQx8 UJ/cgyWs8UZbIxoE41A+nBLFNdzbLMLslrfp448S8QpYc/jwzInrbHJ37lbnCttJ i6qIFBROzz332psq/aIxkAzEgg3Ibtl9rPQIO0= Received: (qmail 83413 invoked by alias); 6 Jun 2018 22:42:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 81791 invoked by uid 89); 6 Jun 2018 22:42:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com, gabriel@inconstante.eti.br, raji@linux.ibm.com Subject: [PATCH 6/9] ldbl-128ibm-compat: Provide nexttoward functions Date: Wed, 6 Jun 2018 19:39:06 -0300 In-Reply-To: <20180606223909.16675-1-tuliom@linux.ibm.com> References: <20180606223909.16675-1-tuliom@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18060622-0036-0000-0000-000009EC4DAC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009139; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01043027; UDB=6.00534142; IPR=6.00822157; MB=3.00021491; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-06 22:42:12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060622-0037-0000-0000-000047969931 Message-Id: <20180606223909.16675-7-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-06_10:, , signatures=0 From: "Gabriel F. T. Gomes" The functions in the nexttoward family are special, in the sense that they always have a long double argument, regardless of their suffix (i.e.: nexttowardf and nexttoward have a long double argument, besides the float and double arguments). On top of that, they are also special because nexttoward functions are not part of the _FloatN API, hence __nexttowardf128 do not exist. This patch adds 4 new function implementations for the new long double format: __nexttoward_to_ieee128 __nexttowardf_to_ieee128 __nexttowardieee128 (as an alias to __nextafterieee128) 2018-06-06 Gabriel F. T. Gomes Tulio Magno Quites Machado Filho * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __nexttowardf_to_ieee128, __nexttowardieee128 and __nexttoward_to_ieee128. * sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c: New file. --- sysdeps/ieee754/ldbl-128ibm-compat/Versions | 3 ++ .../ieee754/ldbl-128ibm-compat/s_nextafterf128.c | 20 ++++++++++++ .../ieee754/ldbl-128ibm-compat/s_nexttowardf128.c | 38 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index b7efe84918..5f240cb687 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -100,6 +100,9 @@ libm { __nearbyintieee128; __nextafterieee128; __nextdownieee128; + __nexttowardf_to_ieee128; + __nexttowardieee128; + __nexttoward_to_ieee128; __nextupieee128; __powieee128; __remainderieee128; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c new file mode 100644 index 0000000000..419068f8b1 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_nextafterf128.c @@ -0,0 +1,20 @@ +/* Provide nexttowardl and nextafterl implementations for IEEE long double. + Copyright (C) 2018 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) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c new file mode 100644 index 0000000000..4403783a56 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_nexttowardf128.c @@ -0,0 +1,38 @@ +/* Provide nexttoward[|f] implementations for IEEE long double. + Copyright (C) 2018 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 + +/* Build nexttoward functions with binary128 format. */ +#undef weak_alias +#define weak_alias(from, to) +#undef libm_alias_ldouble +#define libm_alias_ldouble(from, to) +#undef __nexttoward +#define __nexttoward __nexttoward_to_ieee128 +#include + +#undef weak_alias +#define weak_alias(from, to) +#undef libm_alias_ldouble +#define libm_alias_ldouble(from, to) +#undef __nexttowardf +#define __nexttowardf __nexttowardf_to_ieee128 +#include + +#include