From patchwork Tue Dec 15 14:13:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 41393 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 22C69384A022; Tue, 15 Dec 2020 14:14:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22C69384A022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608041652; bh=AB9+/x0L2tvVktLrDPY5glzBwF2t/Eak3uub8faQAl8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=T4oob5BBiCJZrX5w4CKJSA8pikIv7/qEUW60UjJf6wq/tIe4QGrDp38ij343BUOL1 3CUciRwz7wniKguLFHIgi6iM4a8oe9NfrZHpeKp4p/BcPsjbsebZOF4S8vR+A1PIN9 sFkVtnVLpn4+3BE4hGRsFwyfwj50bT4AIsnoVkOM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from butterfly.birch.relay.mailchannels.net (butterfly.birch.relay.mailchannels.net [23.83.209.27]) by sourceware.org (Postfix) with ESMTPS id 52E4F3857804 for ; Tue, 15 Dec 2020 14:14:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 52E4F3857804 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 32FE1362F17; Tue, 15 Dec 2020 14:14:01 +0000 (UTC) Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-98-64-116.trex.outbound.svc.cluster.local [100.98.64.116]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7F29D362E8B; Tue, 15 Dec 2020 14:13:59 +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:01 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Bitter-Skirt: 528dfda021691d43_1608041640105_175477319 X-MC-Loop-Signature: 1608041640105:2991018560 X-MC-Ingress-Time: 1608041640105 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 5FB257F63E; Tue, 15 Dec 2020 06:13:58 -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 238A67F602; Tue, 15 Dec 2020 06:13:55 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 To: libc-alpha@sourceware.org Subject: [PATCH 0/5] x86 pseudo-normal numbers Date: Tue, 15 Dec 2020 19:43:34 +0530 Message-Id: <20201215141339.2684384-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00, 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=no autolearn_force=no version=3.4.2 X-Spam-Level: * 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: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Cc: fweimer@redhat.com, joseph@codesourcery.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Hi, Following is the patchset that harmonizes classification of pseudo-normal numbers with gcc. Pseudo-NaNs, Pseudo-Infinities and unnormal numbers are considered as signaling NaN as per classification since that is how they behave when used as operands in x86. Pseudo-denormal numbers are not catered for in this patch. The x86 CPU supposedly treats these numbers as denormals, but both gcc and glibc currently treat them as normals. In summary, the patchset does the following: - Update fpclassify to cater for pseudo-normal numbers - Consolidate isnanl so that it can be used by isnanl as well as issignalingl. - Update isnanl logic to return true for all pseudo-normal numbers - Add an x86-specific issignalingl that returns true for all pseudo-normals. Siddhesh Poyarekar (5): x86 long double: Support pseudo numbers in fpclassifyl x86 long double: Support pseudo numbers in isnanl Partially revert 681900d29683722b1cb0a8e565a0585846ec5a61 x86 long double: Consider pseudo numbers as signaling x86 long double: Add tests for pseudo normal numbers sysdeps/i386/fpu/s_fpclassifyl.c | 4 + sysdeps/i386/fpu/s_isnanl.c | 10 +- sysdeps/ieee754/ldbl-96/s_issignalingl.c | 2 - sysdeps/x86/fpu/Makefile | 3 +- sysdeps/x86/fpu/isnanl_common.h | 32 ++++ sysdeps/x86/fpu/s_issignalingl.c | 39 +++++ sysdeps/x86/fpu/test-unnormal.c | 196 +++++++++++++++++++++++ sysdeps/x86/ldbl2mpn.c | 8 - 8 files changed, 275 insertions(+), 19 deletions(-) create mode 100644 sysdeps/x86/fpu/isnanl_common.h create mode 100644 sysdeps/x86/fpu/s_issignalingl.c create mode 100644 sysdeps/x86/fpu/test-unnormal.c