From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NeeDIikL9mo6mAYAWB0awg (envelope-from ) for ; Thu, 12 Nov 2026 13:53:29 -0500 Received: by simark.ca (Postfix, from userid 112) id 7A0071E0BC; Thu, 12 Nov 2026 13:53:29 -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 E5FB41E087 for ; Thu, 12 Nov 2026 13:53:28 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E9EE24BA23FF for ; Thu, 12 Nov 2026 18:53:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9EE24BA23FF Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 1F82E4BA2E26 for ; Thu, 12 Nov 2026 18:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F82E4BA2E26 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 1F82E4BA2E26 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=1794509584; cv=none; b=X8zmlRGZWESwb0h1OO3zjuvyj15DQT2y4zgbpSmFOTvtzjNTNHW1pm1BTWC28HAfOtIQwaxb0y1xhbf1TFhz0Dz83BeJP+txYmoSSKPfddG2ysvJ1P5KuaHzwSxQ+a0T35J3fVaLvFM3KQNM9eEuoMpz91051u+1Eqbo0WmIwu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794509584; c=relaxed/simple; bh=x7Hw+81joPDJAFTHQGl6sTMAZfAJDux1ovHUYvq/SMA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=XX4+Gzds1jTyO1BnW5iCR9WhCoxnEwPfrhMyU9goYA+nsAkWswdbXkxuUIe5VND5MOdMokG/2xLmY8Vx51BmWBPh2cpovDnUNLbZX37dwhEqb2v8umB/xiZG48DjDoHiZ928785DHEOuMHVl5vpZz44s/3OBHcI8lV4k1vzVWDg= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F82E4BA2E26 Received: from doobie (unknown [67.245.74.220]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4jQTzd6X6tz4HsV; Thu, 12 Nov 2026 13:53:01 -0500 (EST) Received: by doobie (Postfix, from userid 1000) id 5C29F28E7A26; Thu, 12 Nov 2026 13:53:01 -0500 (EST) From: Robert Dubner To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com Subject: [PATCH v5 0/5] gdb: Fix target floating-point encoding and signed-zero negation Date: Thu, 12 Nov 2026 13:52:46 -0500 Message-Id: <20261112185251.1617554-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. Changes in v5 include the following. - Reuse the floating-point selftest type helper for signed-zero and wide-special-value tests. - Adjust comments and formatting, including the explanation of the conditional _Float128 variable. - Add the Reviewed-By tag for the subnormal patch. - Extend validation with full GDB selftests, a full DejaGNU baseline comparison, UBSan, and the macro-disabled _Float128 test path. 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. 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 | 653 ++++++++++++++++++++++++--- gdb/testsuite/gdb.base/float-neg.c | 38 ++ gdb/testsuite/gdb.base/float-neg.exp | 79 ++++ gdb/valarith.c | 8 +- 4 files changed, 722 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