Message ID | 20201215141339.2684384-2-siddhesh@sourceware.org |
---|---|
State | Superseded |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> 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 A9E0E386EC25; Tue, 15 Dec 2020 14:14:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9E0E386EC25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608041653; bh=jncrFSjUCUrJ40mK/imvqn/jDhK6+0NsvxYuW7n3EYw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lCFiTc2GqAU8dvrXlTewMq5O0g5kJ+sCgQoaaKbaFSMOYsCetwxR7YPAhfCJ3+Oxr ZJofU5DePkVxyIW6pCa9fETSWk5lGBJibtGGgOaU3/7Jz+akd78jY0pXUetRSWv/hp Y2+GIfm9YNPBLe/3LmMs/pXciieTmcQXebObEqBc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dog.elm.relay.mailchannels.net (dog.elm.relay.mailchannels.net [23.83.212.48]) by sourceware.org (Postfix) with ESMTPS id B3B413861038 for <libc-alpha@sourceware.org>; Tue, 15 Dec 2020 14:14:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B3B413861038 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 520F7362F96; Tue, 15 Dec 2020 14:14:07 +0000 (UTC) Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-96-8-104.trex.outbound.svc.cluster.local [100.96.8.104]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9558F361A4F; Tue, 15 Dec 2020 14:14:05 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a35.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.11); Tue, 15 Dec 2020 14:14:07 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Name: 411034a14758664f_1608041646784_1352486080 X-MC-Loop-Signature: 1608041646784:635306170 X-MC-Ingress-Time: 1608041646784 Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 5D9117F5FF; Tue, 15 Dec 2020 06:14:05 -0800 (PST) Received: from rhbox.redhat.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTPSA id 0FCF67E63B; Tue, 15 Dec 2020 06:14:01 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 To: libc-alpha@sourceware.org Subject: [PATCH 1/5] x86 long double: Support pseudo numbers in fpclassifyl Date: Tue, 15 Dec 2020 19:43:35 +0530 Message-Id: <20201215141339.2684384-2-siddhesh@sourceware.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201215141339.2684384-1-siddhesh@sourceware.org> References: <20201215141339.2684384-1-siddhesh@sourceware.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Siddhesh Poyarekar <siddhesh@sourceware.org> Cc: fweimer@redhat.com, joseph@codesourcery.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
x86 pseudo-normal numbers
|
|
Commit Message
Siddhesh Poyarekar
Dec. 15, 2020, 2:13 p.m. UTC
--- sysdeps/i386/fpu/s_fpclassifyl.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
On 15/12/2020 11:13, Siddhesh Poyarekar via Libc-alpha wrote: > --- > sysdeps/i386/fpu/s_fpclassifyl.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/i386/fpu/s_fpclassifyl.c > index 501312f51e..aeaec7279c 100644 > --- a/sysdeps/i386/fpu/s_fpclassifyl.c > +++ b/sysdeps/i386/fpu/s_fpclassifyl.c > @@ -34,6 +34,10 @@ __fpclassifyl (long double x) > retval = FP_ZERO; > else if (ex == 0 && (hx & 0x80000000) == 0) > retval = FP_SUBNORMAL; > + /* Pseudo-normals, i.e. pseudo-zero, pseudo-infinity and unnormals. They Intel manual adds a hyphen for un-normals. > + behave like NaNs, so categorize them as such. */ > + else if ((hx & 0x80000000) == 0) > + retval = FP_NAN; Ok. > else if (ex == 0x7fff) > retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE; > > Maybe move the implementation to sysdep/x86/fpu since it is used for both x86_64 and i386? It avoid the implicit cross abi include the and make the implementation selection more clear.
On 12/23/20 12:13 AM, Adhemerval Zanella via Libc-alpha wrote: > > > On 15/12/2020 11:13, Siddhesh Poyarekar via Libc-alpha wrote: >> --- >> sysdeps/i386/fpu/s_fpclassifyl.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/i386/fpu/s_fpclassifyl.c >> index 501312f51e..aeaec7279c 100644 >> --- a/sysdeps/i386/fpu/s_fpclassifyl.c >> +++ b/sysdeps/i386/fpu/s_fpclassifyl.c >> @@ -34,6 +34,10 @@ __fpclassifyl (long double x) >> retval = FP_ZERO; >> else if (ex == 0 && (hx & 0x80000000) == 0) >> retval = FP_SUBNORMAL; >> + /* Pseudo-normals, i.e. pseudo-zero, pseudo-infinity and unnormals. They > > Intel manual adds a hyphen for un-normals. > Fixed. >> + behave like NaNs, so categorize them as such. */ >> + else if ((hx & 0x80000000) == 0) >> + retval = FP_NAN; > > Ok. > >> else if (ex == 0x7fff) >> retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE; >> >> > > Maybe move the implementation to sysdep/x86/fpu since it is used for > both x86_64 and i386? It avoid the implicit cross abi include the > and make the implementation selection more clear. > OK. Thanks, Siddhesh
diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/i386/fpu/s_fpclassifyl.c index 501312f51e..aeaec7279c 100644 --- a/sysdeps/i386/fpu/s_fpclassifyl.c +++ b/sysdeps/i386/fpu/s_fpclassifyl.c @@ -34,6 +34,10 @@ __fpclassifyl (long double x) retval = FP_ZERO; else if (ex == 0 && (hx & 0x80000000) == 0) retval = FP_SUBNORMAL; + /* Pseudo-normals, i.e. pseudo-zero, pseudo-infinity and unnormals. They + behave like NaNs, so categorize them as such. */ + else if ((hx & 0x80000000) == 0) + retval = FP_NAN; else if (ex == 0x7fff) retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE;