From: "Emilio G. Cota" <cota@braap.org>
To: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v6 07/13] fpu: introduce hardfloat
Date: Sat, 24 Nov 2018 20:25:25 -0500 [thread overview]
Message-ID: <20181125012525.GA22864@flamenco> (raw)
In-Reply-To: <CAL1e-=gL0s2-zLgBYQrW1=VSOB=LepzDgDS08P7qGNAiOynsyg@mail.gmail.com>
On Sun, Nov 25, 2018 at 01:25:25 +0100, Aleksandar Markovic wrote:
> > Note: some architectures (at least PPC, there might be others) clear
> > the status flags passed to softfloat before most FP operations. This
> > precludes the use of hardfloat, so to avoid introducing a performance
> > regression for those targets, we add a flag to disable hardfloat.
> > In the long run though it would be good to fix the targets so that
> > at least the inexact flag passed to softfloat is indeed sticky.
>
> Can you elaborate more on this paragraph?
Sure. We only use hardfloat when the inexact flag is already
set. If it isn't, we defer to softfloat. This is done for two
reasons:
- Computing the inexact flag requires duplicating
most of what softfloat does, so it's not worth doing. Note
that clearing and reading the host's fp flags is even
slower, so that's not an option.
- The inexact flag is raised *very* frequently. The flag
remains set (in the guest) unless guest code explicitly
clears it, which few guest workloads do.
It therefore makes sense for hardfloat to only kick in once
the inexact flag has already been set.
Most targets directly keep the guest's FP flags in the same
struct (float_status) that is passed to softfloat ops.
PPC, however, keeps the state of the guest FP flags in one
place, and passes a pristine float_status to softfloat code
every time it calls it. Thus, given that hardfloat is
entirely implemented in softfloat.c, PPC targets cannot
currently take advantage of it.
Changing this in the PPC target is not impossible, but it will
require additional work that I'm not doing in this series, hence
my note. So for now, PPC targets just have hardfloat disabled
at compile time, which avoids adding overhead for a feature
that they cannot use.
Let me know if anything is unclear. Cheers,
Emilio
next prev parent reply other threads:[~2018-11-25 1:25 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-24 23:55 [Qemu-devel] [PATCH v6 00/13] hardfloat Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 01/13] fp-test: pick TARGET_ARM to get its specialization Emilio G. Cota
2018-12-03 12:13 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 02/13] softfloat: add float{32, 64}_is_{de, }normal Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 03/13] target/tricore: use float32_is_denormal Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 04/13] softfloat: rename canonicalize to sf_canonicalize Emilio G. Cota
2018-12-03 14:16 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 05/13] softfloat: add float{32, 64}_is_zero_or_normal Emilio G. Cota
2018-12-03 14:16 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 06/13] tests/fp: add fp-bench Emilio G. Cota
2018-12-03 14:29 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 07/13] fpu: introduce hardfloat Emilio G. Cota
2018-11-25 0:25 ` Aleksandar Markovic
2018-11-25 1:25 ` Emilio G. Cota [this message]
2018-12-04 12:28 ` Alex Bennée
2018-12-04 13:33 ` Richard Henderson
2018-12-04 13:52 ` Alex Bennée
2018-12-04 17:31 ` Emilio G. Cota
2018-12-04 19:08 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 08/13] hardfloat: implement float32/64 addition and subtraction Emilio G. Cota
2018-12-04 18:34 ` Alex Bennée
2018-12-04 20:07 ` Emilio G. Cota
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 09/13] hardfloat: implement float32/64 multiplication Emilio G. Cota
2018-12-05 10:10 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 10/13] hardfloat: implement float32/64 division Emilio G. Cota
2018-12-05 10:11 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 11/13] hardfloat: implement float32/64 fused multiply-add Emilio G. Cota
2018-12-05 12:25 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 12/13] hardfloat: implement float32/64 square root Emilio G. Cota
2018-12-05 12:26 ` Alex Bennée
2018-11-24 23:55 ` [Qemu-devel] [PATCH v6 13/13] hardfloat: implement float32/64 comparison Emilio G. Cota
2018-12-05 12:36 ` Alex Bennée
2018-11-27 17:24 ` [Qemu-devel] [PATCH v6 00/13] hardfloat no-reply
2018-11-27 17:52 ` Emilio G. Cota
2018-11-27 17:32 ` no-reply
2018-12-05 12:41 ` Alex Bennée
2018-12-05 16:47 ` Emilio G. Cota
[not found] <mailman.26358.1543950647.1282.qemu-devel@nongnu.org>
2018-12-05 11:07 ` [Qemu-devel] [PATCH v6 07/13] fpu: introduce hardfloat Programmingkid
2018-12-05 16:08 ` Emilio G. Cota
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=20181125012525.GA22864@flamenco \
--to=cota@braap.org \
--cc=aleksandar.m.mail@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).