target/hppa: Explicitly set 2-NaN propagation rule

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
This commit is contained in:
Peter Maydell 2024-11-05 10:09:54 +00:00
parent 1bb5257def
commit 2915876e03
2 changed files with 8 additions and 2 deletions

View File

@ -403,9 +403,9 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls,
#if defined(TARGET_AVR) || defined(TARGET_HEXAGON) \ #if defined(TARGET_AVR) || defined(TARGET_HEXAGON) \
|| defined(TARGET_RISCV) || defined(TARGET_SH4) \ || defined(TARGET_RISCV) || defined(TARGET_SH4) \
|| defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \ || defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \
|| defined(TARGET_LOONGARCH64) || defined(TARGET_LOONGARCH64) || defined(TARGET_HPPA)
g_assert_not_reached(); g_assert_not_reached();
#elif defined(TARGET_HPPA) || defined(TARGET_S390X) #elif defined(TARGET_S390X)
rule = float_2nan_prop_s_ab; rule = float_2nan_prop_s_ab;
#elif defined(TARGET_PPC) || defined(TARGET_M68K) #elif defined(TARGET_PPC) || defined(TARGET_M68K)
/* /*

View File

@ -49,6 +49,12 @@ void HELPER(loaded_fr0)(CPUHPPAState *env)
d = FIELD_EX32(shadow, FPSR, D); d = FIELD_EX32(shadow, FPSR, D);
set_flush_to_zero(d, &env->fp_status); set_flush_to_zero(d, &env->fp_status);
set_flush_inputs_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) void cpu_hppa_loaded_fr0(CPUHPPAState *env)