qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: luoyonggang@gmail.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: About hardfloat in ppc
Date: Mon, 27 Apr 2020 12:10:40 +0100	[thread overview]
Message-ID: <87imhlkwun.fsf@linaro.org> (raw)
In-Reply-To: <alpine.BSF.2.22.395.2004271212520.94232@zero.eik.bme.hu>


BALATON Zoltan <balaton@eik.bme.hu> writes:

> On Mon, 27 Apr 2020, Alex Bennée wrote:
>> 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> writes:
>>> Because ppc fpu-helper are always clearing float_flag_inexact,
>>> So is that possible to optimize the performance when  float_flag_inexact
>>> are cleared?
>>
>> There was some discussion about this in the last thread about enabling
>> hardfloat for PPC. See the thread:
>>
>>  Subject: [RFC PATCH v2] target/ppc: Enable hardfloat for PPC
>>  Date: Tue, 18 Feb 2020 18:10:16 +0100
>>  Message-Id: <20200218171702.979F074637D@zero.eik.bme.hu>
>
> I've answered this already with link to that thread here:
>
> On Fri, 10 Apr 2020, BALATON Zoltan wrote:
> : Date: Fri, 10 Apr 2020 20:04:53 +0200 (CEST)
> : From: BALATON Zoltan <balaton@eik.bme.hu>
> : To: "罗勇刚(Yonggang Luo)" <luoyonggang@gmail.com>
> : Cc: qemu-devel@nongnu.org, Mark Cave-Ayland, John Arbuckle, qemu-ppc@nongnu.org, Paul Clarke, Howard Spoelstra, David Gibson
> : Subject: Re: [RFC PATCH v2] target/ppc: Enable hardfloat for PPC
> :
> : On Fri, 10 Apr 2020, 罗勇刚(Yonggang Luo) wrote:
> :> Are this stable now? I'd like to see hard float to be landed:)
> :
> : If you want to see hardfloat for PPC then you should read the
> replies to : this patch which can be found here:
> :
> : http://patchwork.ozlabs.org/patch/1240235/
> :
> : to understand what's needed then try to implement the solution with
> FP : exceptions cached in a global that maybe could work. I won't be
> able to : do that as said here:
> :
> : https://lists.nongnu.org/archive/html/qemu-ppc/2020-03/msg00006.html
> :
> : because I don't have time to learn all the details needed. I think :
> others are in the same situation so unless somebody puts in the :
> necessary effort this won't change.
>
> Which also had a proposed solution to the problem that you could try
> to implement, in particular see this message:
>
> http://patchwork.ozlabs.org/project/qemu-devel/patch/20200218171702.979F074637D@zero.eik.bme.hu/#2375124
>
> amd Richard's reply immediately below that. In short to optimise FPU
> emulation we would either find a way to compute inexact flag quickly 
> without reading the FPU status (this may not be possible) or somehow
> get status from the FPU but the obvious way of claring the flag and
> reading them after each operation is too slow. So maybe using
> exceptions and only clearing when actually there's a change could be
> faster.
>
> As to how to use exceptions see this message in above thread:
>
> https://lists.nongnu.org/archive/html/qemu-ppc/2020-03/msg00005.html
>
> But that's only to show how to hook in an exception handler what it
> does needs to be implemented. Then tested and benchmarked.
>
> I still don't know where are the extensive PPC floating point tests to
> use for checking results though as that was never answered.

Specifically for PPC we don't have them. We use the softfloat test cases
to exercise our softfloat/hardfloat code as part of "make
check-softfloat". You can also re-build fp-bench for each guest target
to measure raw throughput.

>> However in short the problem is if the float_flag_inexact is clear you
>> must use softfloat so you can properly calculate the inexact status. We
>> can't take advantage of the inexact stickiness without loosing the
>> fidelity of the calculation.
>
> I still don't get why can't we use hardware via exception handler to
> detect flags for us and why do we only use hardfloat in some corner
> cases. If reading the status is too costly then we could mirror it in
> a global which is set by an FP exception handler. Shouldn't that be
> faster? Is there a reason that can't work?

It would work but it would be slow. Almost every FP operation sets
the inexact flag so it would generate an exception and exceptions take
time to process.

For the guests where we use hardfloat operations with inexact already
latched is not a corner case - it is the common case which is why it
helps.

>
> Regards,
> BALATON Zoltan


-- 
Alex Bennée


  reply	other threads:[~2020-04-27 11:12 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  6:39 About hardfloat in ppc 罗勇刚(Yonggang Luo)
2020-04-27  9:42 ` Alex Bennée
2020-04-27 10:34   ` BALATON Zoltan
2020-04-27 11:10     ` Alex Bennée [this message]
2020-04-27 21:18       ` 罗勇刚(Yonggang Luo)
2020-04-28  8:36         ` Alex Bennée
2020-04-28 14:29           ` 罗勇刚(Yonggang Luo)
2020-04-29 10:17           ` R: " Dino Papararo
2020-04-29 10:31             ` Dino Papararo
2020-04-29 11:57             ` Alex Bennée
2020-04-29 12:33               ` 罗勇刚(Yonggang Luo)
2020-04-29 13:38                 ` Alex Bennée
2020-04-29 14:31               ` R: " Dino Papararo
2020-04-29 14:49                 ` Peter Maydell
2020-04-29 18:25                 ` R: " Alex Bennée
2020-04-30  0:20                   ` 罗勇刚(Yonggang Luo)
2020-04-30  2:18                     ` Richard Henderson
2020-04-30  7:26                       ` 罗勇刚(Yonggang Luo)
2020-04-30  8:11                         ` Alex Bennée
2020-04-30  8:13                       ` 罗勇刚(Yonggang Luo)
2020-04-30 15:35                         ` BALATON Zoltan
2020-04-30 16:34                           ` R: " Dino Papararo
2020-05-01  1:59                             ` Programmingkid
2020-05-01  2:21                               ` 罗勇刚(Yonggang Luo)
2020-05-01 11:58                                 ` BALATON Zoltan
2020-05-01 12:04                                   ` 罗勇刚(Yonggang Luo)
2020-05-01 13:10                                     ` Alex Bennée
2020-05-01 13:39                                       ` BALATON Zoltan
2020-05-01 14:01                                         ` Alex Bennée
2020-05-01 14:18                                       ` Richard Henderson
2020-05-01 16:25                                         ` 罗勇刚(Yonggang Luo)
2020-05-01 19:33                                           ` Alex Bennée
2020-05-01 16:29                                         ` 罗勇刚(Yonggang Luo)
2020-05-01 16:51                                           ` Richard Henderson
2020-05-01 17:49                                             ` 罗勇刚(Yonggang Luo)
2020-05-01 20:35                                               ` Richard Henderson
2020-04-29 23:12               ` R: " 罗勇刚(Yonggang Luo)
2020-04-30 15:16           ` BALATON Zoltan
2020-04-30 18:59             ` Alex Bennée
2020-04-30 20:17               ` BALATON Zoltan

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=87imhlkwun.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=luoyonggang@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.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).