[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/31] target/rx: Explicitly set 2-NaN propagation rule
From: |
Peter Maydell |
Subject: |
[PULL 20/31] target/rx: Explicitly set 2-NaN propagation rule |
Date: |
Tue, 5 Nov 2024 11:19:24 +0000 |
Set the NaN propagation rule explicitly for the float_status word
used in the rx target.
This not the architecturally correct behaviour, but since this is a
no-behaviour-change patch, we leave a TODO note to that effect.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241025141254.2141506-21-peter.maydell@linaro.org
---
target/rx/cpu.c | 7 +++++++
fpu/softfloat-specialize.c.inc | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/target/rx/cpu.c b/target/rx/cpu.c
index 36d2a6f1890..65a74ce720f 100644
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -93,6 +93,13 @@ static void rx_cpu_reset_hold(Object *obj, ResetType type)
env->fpsw = 0;
set_flush_to_zero(1, &env->fp_status);
set_flush_inputs_to_zero(1, &env->fp_status);
+ /*
+ * TODO: this is not the correct NaN propagation rule for this
+ * architecture. The "RX Family User's Manual: Software" table 1.6
+ * defines the propagation rules as "prefer SNaN over QNaN;
+ * then prefer dest over source", which is float_2nan_prop_s_ab.
+ */
+ set_float_2nan_prop_rule(float_2nan_prop_x87, &env->fp_status);
}
static ObjectClass *rx_cpu_class_by_name(const char *cpu_model)
diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc
index ee5c73cad46..254bbd67168 100644
--- a/fpu/softfloat-specialize.c.inc
+++ b/fpu/softfloat-specialize.c.inc
@@ -407,7 +407,8 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls,
|| defined(TARGET_S390X) || defined(TARGET_PPC) || defined(TARGET_M68K) \
|| defined(TARGET_SPARC) || defined(TARGET_XTENSA) \
|| defined(TARGET_I386) || defined(TARGET_ALPHA) \
- || defined(TARGET_MICROBLAZE) || defined(TARGET_OPENRISC)
+ || defined(TARGET_MICROBLAZE) || defined(TARGET_OPENRISC) \
+ || defined(TARGET_RX)
g_assert_not_reached();
#else
rule = float_2nan_prop_x87;
--
2.34.1
- [PULL 11/31] target/sparc: Move cpu_put_fsr(env, 0) call to reset, (continued)
- [PULL 11/31] target/sparc: Move cpu_put_fsr(env, 0) call to reset, Peter Maydell, 2024/11/05
- [PULL 07/31] target/s390x: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 15/31] target/i386: Set 2-NaN propagation rule explicitly, Peter Maydell, 2024/11/05
- [PULL 01/31] softfloat: Allow 2-operand NaN propagation rule to be set at runtime, Peter Maydell, 2024/11/05
- [PULL 10/31] target/m68k: Initialize float_status fields in gdb set/get functions, Peter Maydell, 2024/11/05
- [PULL 14/31] target/xtensa: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 08/31] target/ppc: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 17/31] target/microblaze: Move setting of float rounding mode to reset, Peter Maydell, 2024/11/05
- [PULL 12/31] target/sparc: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 13/31] target/xtensa: Factor out calls to set_use_first_nan(), Peter Maydell, 2024/11/05
- [PULL 20/31] target/rx: Explicitly set 2-NaN propagation rule,
Peter Maydell <=
- [PULL 16/31] target/alpha: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 19/31] target/openrisc: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 21/31] softfloat: Remove fallback rule from pickNaN(), Peter Maydell, 2024/11/05
- [PULL 26/31] hw/rtc/ds1338: Trace send and receive operations, Peter Maydell, 2024/11/05
- [PULL 22/31] Revert "target/arm: Fix usage of MMU indexes when EL3 is AArch32", Peter Maydell, 2024/11/05
- [PULL 28/31] hw/watchdog/wdt_imx2: Remove redundant assignment, Peter Maydell, 2024/11/05
- [PULL 25/31] disas: Fix build against Capstone v6 (again), Peter Maydell, 2024/11/05
- [PULL 23/31] target/arm: Add new MMU indexes for AArch32 Secure PL1&0, Peter Maydell, 2024/11/05
- [PULL 27/31] hw/timer/imx_gpt: Convert DPRINTF to trace events, Peter Maydell, 2024/11/05
- [PULL 29/31] hw/sensor/tmp105: Convert printf() to trace event, add tracing for read/write access, Peter Maydell, 2024/11/05