From patchwork Wed Jun 6 22:39:04 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: 926061 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-92968-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="jNY2bYS2"; 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 411Nw54zV5z9rxs for ; Thu, 7 Jun 2018 08:42:13 +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=gun45kJEYJKZOx/BwHO7V/ykVw1ymLq CQ8cjSBo7W/o8q/8LsHWvuuH2VqHRl27kn4N1HUFoPWsNf4jVaEtpGoY6YRILtgz TBRsJvf+aGqpxly7DSPXUZXJY3LhqXdx/Y4aLrhONU0X+jaVfWuNdrZmtkKVSZK6 zf8E33P6dFX8= 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=PWbBHQl6BORf81/9vjtmqyDyjLU=; b=jNY2b YS2uldR/95pwt4unfKUDYULID9ToMSfNajrFImyb/oPSP4v1pGi1u6veTeEb+cn5 mp7ApCCHLz7mVEPf6Bktw9vosW+mBrtdsK6Xb7cs7QortMdPG+TvuGTDKCd4H+R1 d1RvDzM0tEtJgWKoxiOGhokpNrH7KUE44otsm8= Received: (qmail 78091 invoked by alias); 6 Jun 2018 22:41:49 -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 77187 invoked by uid 89); 6 Jun 2018 22:41:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-27.0 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 4/9] ldbl-128ibm-compat: Add a generic significand() implementation Date: Wed, 6 Jun 2018 19:39:04 -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-2213-0000-0000-000002B46BAC 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:41:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060622-2214-0000-0000-00005A630EC9 Message-Id: <20180606223909.16675-5-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-06_10:, , signatures=0 Create a template for significand and reuse it in the ldbl-128ibm-compat directory. 2018-06-06 Tulio Magno Quites Machado Filho * math/s_significand_template.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __significandieee128. * sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/s_significandl.c: New file. Signed-off-by: Tulio Magno Quites Machado Filho --- math/s_significand_template.c | 33 ++++++++++++++++++++++ sysdeps/ieee754/ldbl-128ibm-compat/Versions | 1 + .../ieee754/ldbl-128ibm-compat/s_significandf128.c | 25 ++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 math/s_significand_template.c create mode 100644 sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c diff --git a/math/s_significand_template.c b/math/s_significand_template.c new file mode 100644 index 0000000000..c95017e683 --- /dev/null +++ b/math/s_significand_template.c @@ -0,0 +1,33 @@ +/* Return the mantissa of a floating-point number. + 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 + . */ + +/* + * significand(x) computes just + * scalb(x, (long double) - ilogb(x)), + * for exercising the fraction-part(F) IEEE 754-1985 test vector. + */ + +#include +#include + +FLOAT +M_DECL_FUNC (__significand) (FLOAT x) +{ + return M_SUF (__ieee754_scalb) (x,(FLOAT) - M_SUF (__ilogb) (x)); +} +declare_mgen_alias (__significand, significand) diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Versions b/sysdeps/ieee754/ldbl-128ibm-compat/Versions index 8133d874df..06c19569c5 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Versions +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Versions @@ -110,6 +110,7 @@ libm { __scalbnieee128; __setpayloadieee128; __setpayloadsigieee128; + __significandieee128; __sincosieee128; __sinhieee128; __sinieee128; diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c b/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c new file mode 100644 index 0000000000..4ae0fde6a5 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128ibm-compat/s_significandf128.c @@ -0,0 +1,25 @@ +/* Get mantissa of 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 +#include + +#define __significandf128 __significandieee128 +#undef declare_mgen_alias +#define declare_mgen_alias(...) +#include