qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: luoyonggang@gmail.com, BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-ppc@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org
Subject: Re: An first try to improve PPC float simulation, not even compiled. Just ask question.
Date: Mon, 4 May 2020 09:49:38 -0700	[thread overview]
Message-ID: <e93bda1e-ae5f-00f9-0655-f4bb72597ab5@linaro.org> (raw)
In-Reply-To: <CAE2XoE93HqZVvFkZzfuC1VsF-Vw88ggSYMU2t7QjPUPWSU-4-Q@mail.gmail.com>

On 5/3/20 5:41 PM, 罗勇刚(Yonggang Luo) wrote:
> 
> 
> On Mon, May 4, 2020 at 7:40 AM BALATON Zoltan <balaton@eik.bme.hu
> <mailto:balaton@eik.bme.hu>> wrote:
> 
>     Hello,
> 
>     On Mon, 4 May 2020, 罗勇刚(Yonggang Luo) wrote:
>     > Hello Richard, Can you have a look at the following patch, and was that are
>     > the right direction?
> 
>     Formatting of the patch is broken by your mailer, try sending it with
>     something that does not change it otherwise it's a bit hard to read.
> 
>     Richard suggested to add an assert to check the fp_status is correctly
>     cleared in place of helper_reset_fpstatus first for debugging so you could
>     change the helper accordingly before deleting it and run a few tests to
>     verify it still works. You'll need get some tests and benchmarks working
>     to be able to verify your changes that's why I've said that would be step
>     0. If you checked that it still produces the same results and the assert
>     does not trigger then you can remove the helper.
> 
> That's what I need help,
> 1. How to write a assert to replace helper_reset_fpstatus .
>   just directly assert? or something else

You can't place the assert where helper_reset_fpstatus was.  You need to place
it in each of the helpers, like helper_fadd, that previously has a call to
helper_reset_fpstatus preceeding it.

The assert should be placed before the first floatN_op call that uses
env->fp_status.  E.g.

float64 helper_fadd(CPUPPCState *env, float64 arg1, float64 arg2)
{
    float64 ret;
    int status;

    status = get_float_exception_flags(&env->fp_status);
    assert(status == 0);
    ret = float64_add(arg1, arg2, &env->fp_status);
    status = get_float_exception_flags(&env->fp_status);

    if (unlikely(status & float_flag_invalid)) {
        float_invalid_op_addsub(env, 1, GETPC(),
                                float64_classify(arg1) |
                                float64_classify(arg2));
    }

    return ret;
}


r~


  parent reply	other threads:[~2020-05-04 16:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 20:04 An first try to improve PPC float simulation, not even compiled. Just ask question 罗勇刚(Yonggang Luo)
2020-05-01 20:49 ` Richard Henderson
2020-05-01 22:02   ` 罗勇刚(Yonggang Luo)
2020-05-03 19:46   ` 罗勇刚(Yonggang Luo)
2020-05-03 23:40     ` BALATON Zoltan
2020-05-04  0:41       ` 罗勇刚(Yonggang Luo)
2020-05-04 10:04         ` Alex Bennée
2020-05-04 16:49         ` Richard Henderson [this message]
2020-05-04 18:30           ` BALATON Zoltan
2020-05-04 18:46             ` Richard Henderson
2020-05-04 18:50               ` 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=e93bda1e-ae5f-00f9-0655-f4bb72597ab5@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=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).