From nobody Mon Feb 9 18:45:37 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1591383708; cv=none; d=zohomail.com; s=zohoarc; b=YOwAK/GOxvjfrctF2VNI81v4V+OetiCz0ycgDLbEoQUDLYavVEImtK1OX0HihXfGAkTXLLaqRR2nDLHwTWxD+4VFOF9KXg7Da8U/KesgmQQ3vn0COvVLsgr/BfvA6FMBEDNvEupicFuXffSS9FWup0fQH+iYO9df3TaZd3cWqFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591383708; h=Content-Type:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BbTsFexJ1xEbJHPCwaeq2S8KB9tPLXknDy8uv8VeEWY=; b=Hmly/8z1iKeLOOp/pIQIpu14pIhcpL2JVe7blCSCV87dT7EEPalXrr75vV8O2NTstiW1kVwEpdGy7gSJo8ZLLzjDWX/EMhMEmt3Q9HZhnQbdNfZe9pdmdhQS73JLn0iBKo46Jho2rWP2uQ4XGZrBK0AmcUV43jBcVtwdKx/ZxS8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15913837085561002.6912640449522; Fri, 5 Jun 2020 12:01:48 -0700 (PDT) Received: from localhost ([::1]:45408 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhHb9-0000TF-7G for importer@patchew.org; Fri, 05 Jun 2020 15:01:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhHZj-0007ng-Oj for qemu-devel@nongnu.org; Fri, 05 Jun 2020 15:00:19 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:33964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhHZi-0006kF-Sc for qemu-devel@nongnu.org; Fri, 05 Jun 2020 15:00:19 -0400 Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 05 Jun 2020 11:00:17 -0800 IronPort-SDR: 9GYcwDgzUE23Zz9Jpn/vvQdCGmbQtwS2G28xA4vme/GAffyb8iKOBIY/oCDOnlOYw54MOqueKd sX9+zpWbvN/tjd4ouhXrnOcXF2gKjiZAaXfRrNI2MwSt+fuct1e6TEsPvgVFl0Wcje7b8gJxe1 co7Ck+V4F9dpryuI8TdKrSVyJKKwKKX6JkctrXEbn/yiq6mPe5Ig/SQylF9l/X7SxfNyVFYdjg OSFskJxj8uYEfQf6mKjPJktXTc5EMAubSlU/+Db5kUDwaGbvHnRb4GFe8zYnLfhbRXHiIeVfWg ceg= X-IronPort-AV: E=Sophos;i="5.73,477,1583222400"; d="scan'208";a="49633038" IronPort-SDR: F/1FruGMO9R7ujubsMTUScSsM8Mx4W2Fh5rWxXLYYxsGY9wrtJq5kU0mA1aJ2JrIGkbkAFNdis sOixld8CnN58F1VpLQSeM9EipzExRbuwSgoaoy7IaMOVqyAtZekhdwyQtNi+Nxwk6XfbmT1qDy qZ0qx/q6L0cH8RYLyGtd4Eeyx/nBq/XEgl5QshxttGwCsuQ87mf7Y3+iTybqIduvkJ2xYb8GC7 gZuZ3J0vxk0ZCc04k4jy0V2/36aN6F2iQ/fetXsaVmd5/PP01Gt7xcjYh4UrRKWTNmdbdNjqc7 bOk= Date: Fri, 5 Jun 2020 19:00:11 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: , , , , , , , Subject: [PATCH 2/7] softfloat: fix floatx80 remainder pseudo-denormal check for zero In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=68.232.137.252; envelope-from=joseph_myers@mentor.com; helo=esa4.mentor.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 14:59:46 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The floatx80 remainder implementation ignores the high bit of the significand when checking whether an operand (numerator) with zero exponent is zero. This means it mishandles a pseudo-denormal representation of 0x1p-16382L by treating it as zero. Fix this by checking the whole significand instead. Signed-off-by: Joseph Myers Reviewed-by: Richard Henderson --- fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 7b1ce7664f..091847beb9 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -5726,7 +5726,7 @@ floatx80 floatx80_modrem(floatx80 a, floatx80 b, bool= mod, normalizeFloatx80Subnormal( bSig, &bExp, &bSig ); } if ( aExp =3D=3D 0 ) { - if ( (uint64_t) ( aSig0<<1 ) =3D=3D 0 ) return a; + if ( aSig0 =3D=3D 0 ) return a; normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 ); } bSig |=3D UINT64_C(0x8000000000000000); --=20 2.17.1 --=20 Joseph S. Myers joseph@codesourcery.com