From patchwork Tue Sep 12 12:34:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 812820 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-84491-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="i6XJhJSF"; 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 3xs46369K6z9t6s for ; Tue, 12 Sep 2017 22:35:45 +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:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=qyrXr DSnBqDHNmB4I0AKdyIrPh3FADGotnyVQA5kKM9clwOqJpVXnqvnSzl8FY0BfKx1D rZwDpZqJZJrtuKPzk1DiKPsM6CZTlEK2n+6X6Vk3CuSnOx3zyZdhiq6Wi/U1rQSg 9W8RSuoxSJZRWr0uwOXIIyRSFE19vFLb60OR60= 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:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=/XDz/u+uf8+ BPWC5OwOOiR2aJ4Q=; b=i6XJhJSFwG2HsiI2WiQHKW4dhT7fbi2mPOdVACaCyLL NSz7HGYJ+fVA65yHWVFbV9B8rfHUHUb6wRgSyBAD3LblquFSm2cUCOe18Xp+zI6M KOrSPMtR4XWbhOVyaQxt4rrX7aIReWHcZvLRha6ySs1TM0bjAUnU9pgqzBoxKjSY = Received: (qmail 3859 invoked by alias); 12 Sep 2017 12:35:07 -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 3813 invoked by uid 89); 12 Sep 2017 12:35:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=H*F:D*br X-HELO: mo20.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [PATCH v3 5/5] Remove conditional on LDBL_MANT_DIG from e_lgammal_r.c Date: Tue, 12 Sep 2017 09:34:35 -0300 Message-ID: <20170912123435.6592-6-gabriel@inconstante.eti.br> In-Reply-To: <20170912123435.6592-1-gabriel@inconstante.eti.br> References: <20170912123435.6592-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 X-ClientProxiedBy: EX2.emp.local (172.16.2.2) To EX2.emp.local (172.16.2.2) X-Ovh-Tracer-Id: 15308579562439298755 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrgedvgdehudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu No changes since v2. New since v1. -- 8< -- The IEEE 754 implementation of lgammal in sysdeps/ieee754/ldbl-128/ used to be shared by IBM's implementation in sysdeps/ieee754/ldbl-128ibm/ (by an inclusion of the source file). In order for the algorithm to work for IBM's implementation, a check for LDBL_MANT_DIG was required. Since the source file is no longer shared, the requirement for the check is gone. This patch removes the conditionals. Tested for powerpc64le and s390x. * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r): Remove conditionals on LDBL_MANT_DIG. * sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c (__ieee754_lgammal_r): Likewise. --- sysdeps/ieee754/ldbl-128/e_lgammal_r.c | 6 +----- sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c index bef2601bce..a80c9eaf33 100644 --- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c @@ -73,11 +73,7 @@ #include static const _Float128 PIL = L(3.1415926535897932384626433832795028841972E0); -#if LDBL_MANT_DIG == 106 -static const _Float128 MAXLGM = L(0x5.d53649e2d469dbc1f01e99fd66p+1012); -#else static const _Float128 MAXLGM = L(1.0485738685148938358098967157129705071571E4928); -#endif static const _Float128 one = 1; static const _Float128 huge = LDBL_MAX; @@ -777,7 +773,7 @@ __ieee754_lgammal_r (_Float128 x, int *signgamp) if (x < 0) { - if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50)) + if (x < -2 && x > -50) return __lgamma_negl (x, signgamp); q = -x; p = __floorl (q); diff --git a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c index 474773e81d..f881b8c0a4 100644 --- a/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128ibm/e_lgammal_r.c @@ -23,11 +23,7 @@ #include static const long double PIL = 3.1415926535897932384626433832795028841972E0L; -#if LDBL_MANT_DIG == 106 static const long double MAXLGM = 0x5.d53649e2d469dbc1f01e99fd66p+1012L; -#else -static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L; -#endif static const long double one = 1; static const long double huge = LDBL_MAX; @@ -727,7 +723,7 @@ __ieee754_lgammal_r (long double x, int *signgamp) if (x < 0) { - if (x < -2 && x > (LDBL_MANT_DIG == 106 ? -48 : -50)) + if (x < -2 && x > -48) return __lgamma_negl (x, signgamp); q = -x; p = __floorl (q);