[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper |
Date: |
Wed, 15 Dec 2021 13:43:12 +0100 |
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
- [PATCH] target/rx: Correctly set Error Summary bit in set_fpsw() helper,
Philippe Mathieu-Daudé <=