All of lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, Programmingkid <programmingkidx@gmail.com>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	Howard Spoelstra <hsp.cat7@gmail.com>,
	luigi burdo <intermediadc@hotmail.com>,
	Dino Papararo <skizzato73@msn.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: R: [RFC PATCH v2] target/ppc: Enable hardfloat for PPC
Date: Wed, 26 Feb 2020 23:51:05 +0100 (CET)	[thread overview]
Message-ID: <alpine.BSF.2.22.395.2002262311370.39102@zero.eik.bme.hu> (raw)
In-Reply-To: <87eeuhxw0y.fsf@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2791 bytes --]

On Wed, 26 Feb 2020, Alex Bennée wrote:
> That's the wrong way around. We have regression tests for a reason. I'll
> happily accept patches to turn on hardfloat for PPC if:
>
> a) they don't cause regressions in our fairly extensive floating point
> tests

Where are these tests and how to run them? I'm not aware of such tests so 
I've only tried running simple guest code to test changes but if there are 
more extensive FP tests I'd better use those.

> b) the PPC maintainers are happy with the new performance profile
>
> The way forward would be to:
>
> 1. patch to drop #if defined(TARGET_PPC) || defined(__FAST_MATH__)

This is simple but I've found that while it seems to make some vector 
instructions faster it also makes most simple FP ops slower because it 
will go thorugh checking if it can use hardfloat but never can because the 
fp_status is cleared before every FP op. That's why I've set inexact bit 
to let it use hardfloat and be able to test if it would work at all. 
That's all my RFC patch did, I've had a 2nd version trying to avoid slow 
down with above #if defined() dropped but hardfloat=false so it only uses 
softfloat as before but it did not worked out too well, some tests said v2 
was even slower. Maybe to avoid overhead we should add a variable instead 
of the QEMU_NO_HARDFLOAT define that can be set during runtime but 
probably that won't be faster either. Thus it seems there's no way to 
enable hardfloat for PPC and not have slower performance for most FP ops 
without also doing some of the other points below (even if it's beneficial 
for vector ops).

> 2. audit target/ppc/fpu_helper.c w.r.t chip manual and fix any unneeded
> splatting of flags (if any)

This would either need someone who knows PPC FPU or someone who can take 
the time to learn and go through the code. Not sure I want to volunteer 
for that. But I think the clearing of the flags is mainly to emulate FI 
bit which is an non-sticky inexact bit that should show the inexact status 
of last FP op. (There's another simliar bit for fraction rounded as well 
but that does not disable hardfloat.) Question is if we really want to 
accurately emulate these bits? Are there any software we care about 
relying on these? If we can live with not having correct FI bit emulation 
(which was the case for a long time until these were fixed) then we could 
have an easy way to enable hardfloat without more extensive changes. If we 
want to accurately emulate also these bits then we probably will need 
changes to softfloat to allow registering FP exception handlers so we 
don't have to clear and check bits but can get an exception from FPU and 
then can set those bits but I have no idea how to do that.

Regards,
BALATON Zoltan

  parent reply	other threads:[~2020-02-26 22:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 17:10 [RFC PATCH v2] target/ppc: Enable hardfloat for PPC BALATON Zoltan
2020-02-18 17:38 ` BALATON Zoltan
2020-02-19  2:27 ` Programmingkid
2020-02-19 15:35   ` BALATON Zoltan
2020-02-19 18:28     ` Howard Spoelstra
2020-02-19 19:28       ` BALATON Zoltan
2020-02-20  5:43         ` Howard Spoelstra
2020-02-25  3:07     ` Programmingkid
2020-02-25 12:09       ` BALATON Zoltan
2020-02-26 10:46         ` Programmingkid
2020-02-26 11:28           ` BALATON Zoltan
2020-02-26 13:00             ` R: " luigi burdo
2020-02-26 13:08               ` Dino Papararo
2020-02-26 14:28                 ` Alex Bennée
2020-02-26 15:50                   ` Aleksandar Markovic
2020-02-26 17:04                     ` G 3
2020-02-26 17:27                       ` Aleksandar Markovic
2020-02-26 18:14                         ` R: " Dino Papararo
2020-02-26 18:51                           ` Aleksandar Markovic
2020-02-27  2:43                         ` Programmingkid
2020-02-27  7:16                           ` Aleksandar Markovic
2020-02-27 11:54                             ` BALATON Zoltan
2020-02-26 18:09                       ` R: " Alex Bennée
2020-03-02  0:13                         ` Programmingkid
2020-03-02  4:28                           ` Richard Henderson
2020-03-02 11:42                             ` BALATON Zoltan
2020-03-02 16:55                               ` Richard Henderson
2020-03-02 23:16                                 ` BALATON Zoltan
2020-03-03  0:11                                   ` Richard Henderson
     [not found]                                   ` <CAKyx-3Pt2qLPXWQjBwrHn-nxR-9e++TioGp4cKFC3adMN3rtiw@mail.gmail.com>
2020-03-04 18:43                                     ` Fwd: " G 3
2020-03-05 19:25                                       ` Richard Henderson
2020-03-02 17:10                               ` Alex Bennée
2020-03-02 23:01                                 ` BALATON Zoltan
2020-02-26 22:51                   ` BALATON Zoltan [this message]
2020-02-20 20:13 ` Richard Henderson
2020-02-21 16:04   ` BALATON Zoltan
2020-02-21 16:11     ` Peter Maydell
2020-02-21 16:51       ` Aleksandar Markovic
2020-02-21 18:04       ` BALATON Zoltan
2020-02-21 18:26         ` Peter Maydell
2020-02-21 19:52           ` BALATON Zoltan
2020-02-26 12:28             ` Alex Bennée
2020-02-26 13:07               ` BALATON Zoltan
2020-04-10 13:50 ` 罗勇刚(Yonggang Luo)
2020-04-10 18:04   ` 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=alpine.BSF.2.22.395.2002262311370.39102@zero.eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=alex.bennee@linaro.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=hsp.cat7@gmail.com \
    --cc=intermediadc@hotmail.com \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=skizzato73@msn.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.