All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper
@ 2021-12-15 12:43 Philippe Mathieu-Daudé
  2021-12-15 13:34 ` Peter Maydell
  2021-12-15 17:21 ` Richard Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-12-15 12:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Alistair Francis, Richard Henderson,
	Philippe Mathieu-Daudé,
	Yoshinori Sato

FIELD_DP32() does not update its first argument, so the Floating-Point
Error Summary Flag (FS, summary of FV/FO/FZ/FU bits) is never updated
to the Floating-Point Status Word (FPSW). Fix by assigning FIELD_DP32()
returned value to env->fpsw.

Fixes: 075d047e2bd ("target/rx: TCG helpers")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/rx/op_helper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c
index 11f952d3409..431d4ecf707 100644
--- a/target/rx/op_helper.c
+++ b/target/rx/op_helper.c
@@ -130,8 +130,7 @@ void helper_set_fpsw(CPURXState *env, uint32_t val)
     fpsw |= 0x7fffff03;
     val &= ~0x80000000;
     fpsw &= val;
-    FIELD_DP32(fpsw, FPSW, FS, FIELD_EX32(fpsw, FPSW, FLAGS) != 0);
-    env->fpsw = fpsw;
+    env->fpsw = FIELD_DP32(fpsw, FPSW, FS, FIELD_EX32(fpsw, FPSW, FLAGS) != 0);
     set_float_rounding_mode(roundmode[FIELD_EX32(env->fpsw, FPSW, RM)],
                             &env->fp_status);
 }
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper
  2021-12-15 12:43 [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper Philippe Mathieu-Daudé
@ 2021-12-15 13:34 ` Peter Maydell
  2021-12-15 17:21 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-12-15 13:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Alistair Francis, Richard Henderson, qemu-devel, Yoshinori Sato

On Wed, 15 Dec 2021 at 12:43, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> FIELD_DP32() does not update its first argument, so the Floating-Point
> Error Summary Flag (FS, summary of FV/FO/FZ/FU bits) is never updated
> to the Floating-Point Status Word (FPSW). Fix by assigning FIELD_DP32()
> returned value to env->fpsw.
>
> Fixes: 075d047e2bd ("target/rx: TCG helpers")
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper
  2021-12-15 12:43 [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper Philippe Mathieu-Daudé
  2021-12-15 13:34 ` Peter Maydell
@ 2021-12-15 17:21 ` Richard Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2021-12-15 17:21 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Alistair Francis, Yoshinori Sato

On 12/15/21 4:43 AM, Philippe Mathieu-Daudé wrote:
> FIELD_DP32() does not update its first argument, so the Floating-Point
> Error Summary Flag (FS, summary of FV/FO/FZ/FU bits) is never updated
> to the Floating-Point Status Word (FPSW). Fix by assigning FIELD_DP32()
> returned value to env->fpsw.
> 
> Fixes: 075d047e2bd ("target/rx: TCG helpers")
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-15 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 12:43 [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper Philippe Mathieu-Daudé
2021-12-15 13:34 ` Peter Maydell
2021-12-15 17:21 ` Richard Henderson

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.