mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/m68k: Don't pass NULL float_status to floatx80_default_nan()
Currently m68k_cpu_reset_hold() calls floatx80_default_nan(NULL) to get the NaN bit pattern to reset the FPU registers. This works because it happens that our implementation of floatx80_default_nan() doesn't actually look at the float_status pointer except for TARGET_MIPS. However, this isn't guaranteed, and to be able to remove the ifdef in floatx80_default_nan() we're going to need a real float_status here. Rearrange m68k_cpu_reset_hold() so that we initialize env->fp_status earlier, and thus can pass it to floatx80_default_nan(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20241202131347.498124-28-peter.maydell@linaro.org
This commit is contained in:
parent
dc416d6ca7
commit
04b6a3e471
1 changed files with 7 additions and 5 deletions
|
@ -76,7 +76,7 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type)
|
|||
CPUState *cs = CPU(obj);
|
||||
M68kCPUClass *mcc = M68K_CPU_GET_CLASS(obj);
|
||||
CPUM68KState *env = cpu_env(cs);
|
||||
floatx80 nan = floatx80_default_nan(NULL);
|
||||
floatx80 nan;
|
||||
int i;
|
||||
|
||||
if (mcc->parent_phases.hold) {
|
||||
|
@ -89,10 +89,6 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type)
|
|||
#else
|
||||
cpu_m68k_set_sr(env, SR_S | SR_I);
|
||||
#endif
|
||||
for (i = 0; i < 8; i++) {
|
||||
env->fregs[i].d = nan;
|
||||
}
|
||||
cpu_m68k_set_fpcr(env, 0);
|
||||
/*
|
||||
* M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL
|
||||
* 3.4 FLOATING-POINT INSTRUCTION DETAILS
|
||||
|
@ -109,6 +105,12 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type)
|
|||
* preceding paragraph for nonsignaling NaNs.
|
||||
*/
|
||||
set_float_2nan_prop_rule(float_2nan_prop_ab, &env->fp_status);
|
||||
|
||||
nan = floatx80_default_nan(&env->fp_status);
|
||||
for (i = 0; i < 8; i++) {
|
||||
env->fregs[i].d = nan;
|
||||
}
|
||||
cpu_m68k_set_fpcr(env, 0);
|
||||
env->fpsr = 0;
|
||||
|
||||
/* TODO: We should set PC from the interrupt vector. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue