Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: eliz@gnu.org
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC][00/19] Target FP: Precise target floating-point emulation
Date: Wed, 06 Sep 2017 18:01:00 -0000	[thread overview]
Message-ID: <20170906180051.53811D83591@oc3748833570.ibm.com> (raw)
In-Reply-To: <83vakx0zr1.fsf@gnu.org> from "Eli Zaretskii" at Sep 05, 2017 09:25:06 PM

Eli Zaretskii wrote:
> > Date: Tue, 5 Sep 2017 20:20:30 +0200 (CEST)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > 
> > This patch series addresses this problem by converting GDB to perform
> > all floating-operations by precisely emulation target arithmetic,
> > using the MPFR library.
> 
> In native debugging as well?

Currently, yes.  However, this can be fine-tuned as we like using the
new setup; we could fall back to host arithmetic in some cases.

Making that decision based on native vs. remote debugging does not
appear to be the correct choice here, in particular given the problems
pointed out in my original mail with *native* debugging if FP types
larger than "long double" are used (like __float128).

However, we could make a decision based on the particular target
*format* (e.g. whether it is equivalent to one of the available
host formats).  The question is whether this is worthwhile the
additional complication of code (and possibly test cases).

> If so, wouldn't that make GDB significantly slower in that case?

Of course, considering just one single arithmetic operation, a call
to MPFR is orders of magnitude slower than just doing the operation
in host format (often a single instruction).

But that is not the only question; the other question is how frequent
those operations are in the first place.  And from what I can tell,
all the "hot", performance critical paths in GDB do not perform any
FP operations at all in the first place.  Those are only done in
response to UI actions specifically involving FP values.

For example, the whole of the gdb.base test suite appears to be doing
less 100 instances of any base FP operation.  (This does not count FP
parsing or printing, which are a bit more frequent -- but for those
operations the performance difference between a native printf/scanf
and the corrsponding MPFR printf/scanf is much less in proportion.)
So there is no overall wall-clock performance difference visible.

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.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2017-09-06 18:01 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 [this message]
2017-09-06 18:37     ` Eli Zaretskii
2017-09-06 21:04       ` Joel Brobecker
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=20170906180051.53811D83591@oc3748833570.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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