[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/31] target/hppa: Explicitly set 2-NaN propagation rule
From: |
Peter Maydell |
Subject: |
[PULL 06/31] target/hppa: Explicitly set 2-NaN propagation rule |
Date: |
Tue, 5 Nov 2024 11:19:10 +0000 |
Set the 2-NaN propagation rule explicitly in env->fp_status.
Really we only need to do this at CPU reset (after reset has zeroed
out most of the CPU state struct, which typically includes fp_status
fields). However target/hppa does not currently implement CPU reset
at all, so leave a TODO comment to note that this could be moved if
we ever do implement reset.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241025141254.2141506-7-peter.maydell@linaro.org
---
target/hppa/fpu_helper.c | 6 ++++++
fpu/softfloat-specialize.c.inc | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/target/hppa/fpu_helper.c b/target/hppa/fpu_helper.c
index deaed2b65d1..0e44074ba82 100644
--- a/target/hppa/fpu_helper.c
+++ b/target/hppa/fpu_helper.c
@@ -49,6 +49,12 @@ void HELPER(loaded_fr0)(CPUHPPAState *env)
d = FIELD_EX32(shadow, FPSR, D);
set_flush_to_zero(d, &env->fp_status);
set_flush_inputs_to_zero(d, &env->fp_status);
+
+ /*
+ * TODO: we only need to do this at CPU reset, but currently
+ * HPPA does note implement a CPU reset method at all...
+ */
+ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status);
}
void cpu_hppa_loaded_fr0(CPUHPPAState *env)
diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc
index bbc3b70fa9d..4e51cf8d083 100644
--- a/fpu/softfloat-specialize.c.inc
+++ b/fpu/softfloat-specialize.c.inc
@@ -403,9 +403,9 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls,
#if defined(TARGET_AVR) || defined(TARGET_HEXAGON) \
|| defined(TARGET_RISCV) || defined(TARGET_SH4) \
|| defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \
- || defined(TARGET_LOONGARCH64)
+ || defined(TARGET_LOONGARCH64) || defined(TARGET_HPPA)
g_assert_not_reached();
-#elif defined(TARGET_HPPA) || defined(TARGET_S390X)
+#elif defined(TARGET_S390X)
rule = float_2nan_prop_s_ab;
#elif defined(TARGET_PPC) || defined(TARGET_M68K)
/*
--
2.34.1
- [PULL 00/31] target-arm queue, Peter Maydell, 2024/11/05
- [PULL 02/31] tests/fp: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 04/31] target/mips: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 06/31] target/hppa: Explicitly set 2-NaN propagation rule,
Peter Maydell <=
- [PULL 03/31] target/arm: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 09/31] target/m68k: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [PULL 05/31] target/loongarch: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/11/05
- [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