Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>, gdb-patches@sourceware.org
Subject: Re: [RFC][00/19] Target FP: Precise target floating-point emulation
Date: Wed, 06 Sep 2017 21:04:00 -0000	[thread overview]
Message-ID: <20170906210444.wk4xhl7qiqr4ubdb@adacore.com> (raw)
In-Reply-To: <83d1731xoi.fsf@gnu.org>

> I'm sorry, but it doesn't feel right to me to slow down native
> operations where they fit the bill.  I agree that native debugging
> which manipulates FP data types not supported natively could or should
> be emulated, but normal 'float', 'double', and 'long double' types
> should IMO use native FP processing.  Besides the speed issue, that's
> also the only practical way to make sure these operations are _always_
> identical to what the debuggee's code does or will do.
> 
> > Now, I'm sure one can construct cases where FP arithmetic operations
> > occur much more frequently -- but I'd prefer to see a case where it
> > actually matters in real life before deciding to implement the more
> > complicated solution described above.
> 
> I'm sorry, but slowing down GDB just because there's no evidence
> someone needs the fast operation is not a good idea IMO.  We should
> make GDB as fast as it can be regardless of any particular examples of
> the need for a fast GDB.
> 
> In sum, I'm in favor of having MPFR support where native FP
> calculations cannot be used or don't represent the target correctly,
> but not where they can and do.

FWIW, I'm receptive to the fact that using native FP is indeed
a sure way to make sure we have the same behavior in GDB and
in the program. But on the other hand, we have to be careful
about the impact on code complexity. If having that functionality
makes the code harder to implement and maintain past a certain
degree, then I think it is OK to break the assumption, if there
was any, that GDB would perform the FP operation exactly the same
as on the host.

Performance is a non-aspect to me: We not doing millions of
these operations in a row. In the vast majority of situations,
it'll be a handful. Even if it MPFR cannot be as fast as
hardware, operations were timed to be less than a microsecond
for the common operations to a 100 digits, and with a couple
of exceptions where it takes about about 40 micro seconds to
compute to 100 digits, the rest is clocked at about 5-10 microseconds
per operation up to 100 digits.
http://www.mpfr.org/mpfr-3.1.0/timings.html

-- 
Joel


  reply	other threads:[~2017-09-06 21:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 18:20 Ulrich Weigand
2017-09-05 18:25 ` Eli Zaretskii
2017-09-06 18:01   ` Ulrich Weigand
2017-09-06 18:37     ` Eli Zaretskii
2017-09-06 21:04       ` Joel Brobecker [this message]
2017-11-16 19:06         ` Ulrich Weigand
2017-11-16 19:26           ` Eli Zaretskii
2017-11-20 13:44             ` Doc update to mention MPFR (Re: [RFC][00/19] Target FP: Precise target floating-point emulation) Ulrich Weigand
2017-11-20 17:24               ` Eli Zaretskii
2017-11-20 17:39                 ` Ulrich Weigand
2017-11-20 18:25                   ` Eli Zaretskii

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=20170906210444.wk4xhl7qiqr4ubdb@adacore.com \
    --to=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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