qemu-devel.nongnu.org archive mirror
 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

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 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).