qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An first try to improve PPC float simulation, not even compiled. Jus


From: Richard Henderson
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 5/3/20 5:41 PM, 罗勇刚(Yonggang Luo) wrote:
> 
> 
> On Mon, May 4, 2020 at 7:40 AM BALATON Zoltan <address@hidden
> <mailto:address@hidden>> 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~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]