target-m68k: initialize FPU registers
on reset, set FP registers to NaN and control registers to 0 Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net> Message-Id: <20170620205121.26515-3-laurent@vivier.eu>
This commit is contained in:
parent
860b9ac779
commit
f4a6ce5155
@ -49,6 +49,8 @@ static void m68k_cpu_reset(CPUState *s)
|
||||
M68kCPU *cpu = M68K_CPU(s);
|
||||
M68kCPUClass *mcc = M68K_CPU_GET_CLASS(cpu);
|
||||
CPUM68KState *env = &cpu->env;
|
||||
float64 nan = float64_default_nan(NULL);
|
||||
int i;
|
||||
|
||||
mcc->parent_reset(s);
|
||||
|
||||
@ -57,7 +59,12 @@ static void m68k_cpu_reset(CPUState *s)
|
||||
env->sr = 0x2700;
|
||||
#endif
|
||||
m68k_switch_sp(env);
|
||||
/* ??? FP regs should be initialized to NaN. */
|
||||
for (i = 0; i < 8; i++) {
|
||||
env->fregs[i] = nan;
|
||||
}
|
||||
env->fpcr = 0;
|
||||
env->fpsr = 0;
|
||||
|
||||
cpu_m68k_set_ccr(env, 0);
|
||||
/* TODO: We should set PC from the interrupt vector. */
|
||||
env->pc = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user