From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KX/gNjSp9GppgwIAWB0awg (envelope-from ) for ; Wed, 11 Nov 2026 12:43:16 -0500 Received: by simark.ca (Postfix, from userid 112) id CC2621E089; Wed, 11 Nov 2026 12:43:16 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2E33C1E04F for ; Wed, 11 Nov 2026 12:43:16 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3B084BBC0FD for ; Wed, 11 Nov 2026 17:43:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3B084BBC0FD Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 378F14BA9012 for ; Wed, 11 Nov 2026 17:42:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 378F14BA9012 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dubner.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 378F14BA9012 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=166.84.1.89 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794418973; cv=none; b=aiahPA8s0md9awwgyQPCfFlUmNQVnUTTpnZJXFbRm9A/hoxM/T+X5e4/LiNaZ3b9o4HI4LMFpwzuhiSsP//AIOLxEYYdCQT+EC9SeBT3u5CAIRBxNcfJXF4gxi0nCLwQXMFTrgo2xkBJ99MrvZGfRb4XMYVkQKnAFiQSobADp90= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794418973; c=relaxed/simple; bh=X3DlPRCzSLWcW3IS/Vo6zmk1erWUgq1e4VnCSxvIQcg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=FsfhTREXATAzacG12kL9pZ7wWhqOg+6HHy0rtzZ7n4e3oevyDW1+EEnMJP1kMzdPm9ZaJ/N5PPky+9dEbev9yigK4RxnLhFE7z+g+FOIFAD3qyJU7sZv8BsR9PasaV3zlyKik61HhfyaibmuQia0a/Tfd4W/XPxE45Zl+2mmCt4= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 378F14BA9012 Received: from doobie (unknown [67.245.74.220]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4jPrT72KJ2z17H4; Wed, 11 Nov 2026 12:42:51 -0500 (EST) Received: by doobie (Postfix, from userid 1000) id AF2DE28E902A; Wed, 11 Nov 2026 12:42:50 -0500 (EST) From: Robert Dubner To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com Subject: [PATCH v4 0/5] gdb: Fix target floating-point encoding and signed-zero negation Date: Wed, 11 Nov 2026 12:42:42 -0500 Message-Id: <20261111174247.3382098-1-rdubner@symas.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This series fixes floating-point encoding, subnormal rounding, and signed-zero handling in GDB. It brings together the previously submitted neighboring-bit, subnormal, and signed-zero fixes, followed by a fix for oversized shifts in put_field. It incorporates Stephan Rohr's review feedback, including unit tests in target-float.c and conditional _Float128 coverage for unary negation. The five patches make the following changes. 1. Preserve neighboring bits when writing a floating-point field that occupies only part of a byte. 2. Encode subnormal values correctly and carry MPFR ternary results through subnormal rounding to avoid double rounding. 3. Preserve signed zero during MPFR target conversions, while retaining existing zero encodings for formats without signed-zero support. 4. Implement floating-point unary negation by multiplication by -1, preserving the existing integer and fixed-point behavior. 5. Avoid shifts greater than or equal to the width of unsigned long when writing fields wider than stuff_to_put. The series was applied in order to a clean branch based on gdb/master at 9db3b515b964. Validation on x86_64 GNU/Linux completed successfully. - GDB build - All seven target-float selftests - gdb.base/float-neg.exp, with 53 expected passes, including _Float128 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34927 Robert Dubner (5): gdb: Preserve neighboring bits when writing floating-point fields gdb: Preserve subnormal values in target floating-point operations gdb: Preserve signed zero in MPFR target conversions gdb: Preserve signed zero in floating-point unary negation gdb: Avoid oversized shifts when writing floating-point fields gdb/target-float.c | 660 ++++++++++++++++++++++++--- gdb/testsuite/gdb.base/float-neg.c | 36 ++ gdb/testsuite/gdb.base/float-neg.exp | 79 ++++ gdb/valarith.c | 8 +- 4 files changed, 727 insertions(+), 56 deletions(-) create mode 100644 gdb/testsuite/gdb.base/float-neg.c create mode 100644 gdb/testsuite/gdb.base/float-neg.exp base-commit: 9db3b515b964c1bbdc4d20c1202fbf27719be269 -- 2.34.1