qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 06/11] target/rx: Handle the FPSW.DN bit in helper_set_fpsw


From: Yoshinori Sato
Subject: Re: [PATCH 06/11] target/rx: Handle the FPSW.DN bit in helper_set_fpsw
Date: Sat, 29 May 2021 00:34:55 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/27 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

On Thu, 27 May 2021 13:14:00 +0900,
Richard Henderson wrote:
> 
> Both input and output denormals flush to zero when DN is set.
> 
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewd-by: Yoshinori Sato <ysato@users.sourceforge.jp>

> ---
>  target/rx/op_helper.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c
> index ef904eb5f9..2139def3b2 100644
> --- a/target/rx/op_helper.c
> +++ b/target/rx/op_helper.c
> @@ -127,13 +127,20 @@ void helper_set_fpsw(CPURXState *env, uint32_t val)
>          float_round_down,
>      };
>      uint32_t fpsw = env->fpsw;
> +    bool dn;
> +
>      fpsw |= 0x7fffff03;
>      val &= ~0x80000000;
>      fpsw &= val;
>      FIELD_DP32(fpsw, FPSW, FS, FIELD_EX32(fpsw, FPSW, FLAGS) != 0);
>      env->fpsw = fpsw;
> -    set_float_rounding_mode(roundmode[FIELD_EX32(env->fpsw, FPSW, RM)],
> +
> +    set_float_rounding_mode(roundmode[FIELD_EX32(fpsw, FPSW, RM)],
>                              &env->fp_status);
> +
> +    dn = FIELD_EX32(env->fpsw, FPSW, DN);
> +    set_flush_to_zero(dn, &env->fp_status);
> +    set_flush_inputs_to_zero(dn, &env->fp_status);
>  }
>  
>  #define FLOATOP(op, func)                                           \
> -- 
> 2.25.1
> 
> 



reply via email to

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