Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v4 0/5] gdb: Fix target floating-point encoding and signed-zero negation
@ 2026-11-11 17:42 Robert Dubner
  2026-11-11 17:42 ` [PATCH v4 1/5] gdb: Preserve neighboring bits when writing floating-point fields Robert Dubner
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Robert Dubner @ 2026-11-11 17:42 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.

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


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

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 17:42 [PATCH v4 0/5] gdb: Fix target floating-point encoding and signed-zero negation Robert Dubner
2026-11-11 17:42 ` [PATCH v4 1/5] gdb: Preserve neighboring bits when writing floating-point fields Robert Dubner
2026-11-12  9:04   ` Rohr, Stephan
2026-11-11 17:42 ` [PATCH v4 2/5] gdb: Preserve subnormal values in target floating-point operations Robert Dubner
2026-11-12  9:25   ` Rohr, Stephan
2026-11-11 17:42 ` [PATCH v4 3/5] gdb: Preserve signed zero in MPFR target conversions Robert Dubner
2026-11-12  9:30   ` Rohr, Stephan
2026-11-11 17:42 ` [PATCH v4 4/5] gdb: Preserve signed zero in floating-point unary negation Robert Dubner
2026-11-12  9:32   ` Rohr, Stephan
2026-11-11 17:42 ` [PATCH v4 5/5] gdb: Avoid oversized shifts when writing floating-point fields Robert Dubner
2026-11-12  9:48   ` Rohr, Stephan
2026-11-12 17:05     ` Robert Dubner

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