Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v5 0/5] gdb: Fix target floating-point encoding and signed-zero negation
@ 2026-11-12 18:52 Robert Dubner
  2026-11-12 18:52 ` [PATCH v5 1/5] gdb: Preserve neighboring bits when writing floating-point fields Robert Dubner
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Robert Dubner @ 2026-11-12 18:52 UTC (permalink / raw)
  To: gdb-patches; +Cc: stephan.rohr

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-12 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 18:52 [PATCH v5 0/5] gdb: Fix target floating-point encoding and signed-zero negation Robert Dubner
2026-11-12 18:52 ` [PATCH v5 1/5] gdb: Preserve neighboring bits when writing floating-point fields Robert Dubner
2026-11-12 18:52 ` [PATCH v5 2/5] gdb: Preserve subnormal values in target floating-point operations Robert Dubner
2026-11-12 18:52 ` [PATCH v5 3/5] gdb: Preserve signed zero in MPFR target conversions Robert Dubner
2026-11-12 18:52 ` [PATCH v5 4/5] gdb: Preserve signed zero in floating-point unary negation Robert Dubner
2026-11-12 18:52 ` [PATCH v5 5/5] gdb: Avoid oversized shifts when writing floating-point fields Robert Dubner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox