From: Tom Tromey <tom@tromey.com>
To: Robert Dubner <rdubner@symas.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: Fix signed-zero and subnormal conversions in target floating-point support
Date: Mon, 02 Nov 2026 13:52:32 -0700 [thread overview]
Message-ID: <874idz7y7j.fsf@tromey.com> (raw)
In-Reply-To: <1b1401dd66fa$0dc45250$294cf6f0$@symas.com> (Robert Dubner's message of "Wed, 28 Oct 2026 11:33:23 -0500 (CDT)")
>>>>> Robert Dubner <rdubner@symas.com> writes:
> From 461b097d2319f771a5ffb28273782115b3017e13 Mon Sep 17 00:00:00 2001
> From: Robert Dubner <rdubner@symas.com>
> Date: Wed, 28 Oct 2026 12:24:55 -0400
> Subject: [PATCH] gdb: Fix signed-zero and subnormal conversions in target
> floating-point support
Hi. Thanks for the patch.
First I think maybe something went wrong with the emailing of the patch,
as it's somewhat mangled here.
Second I was curious about this par:
> + if (!mpfr_inf_p (tmp.val) && fmt->exp_nan != 0
> + && mpfr_get_exp (tmp.val) + fmt->exp_bias <= 1)
> + {
> + mpfr_exp_t saved_emin = mpfr_get_emin ();
> + mpfr_exp_t saved_emax = mpfr_get_emax ();
> + SCOPE_EXIT
> + {
> + mpfr_set_emin (saved_emin);
> + mpfr_set_emax (saved_emax);
> + };
> + mpfr_set_emin (3 - fmt->exp_bias - floatformat_precision (fmt));
> + mpfr_set_emax (fmt->exp_nan - fmt->exp_bias);
> + inexact = mpfr_check_range (tmp.val, inexact, MPFR_RNDN);
> + mpfr_subnormalize (tmp.val, inexact, MPFR_RNDN);
I think probably SCOPE_EXIT is overkill here. It's really only needed
if one of the other functions here can throw -- but can that happen?
thanks,
Tom
prev parent reply other threads:[~2026-11-02 20:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 16:33 Robert Dubner
2026-11-01 18:00 ` Robert Dubner
2026-11-02 13:01 ` Rohr, Stephan
2026-11-02 20:52 ` Tom Tromey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874idz7y7j.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=rdubner@symas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox