target/m68k: implement fsave/frestore

Backports commit fff3b4b0e16c76669e56173acb9d3cc6aac85e85 from qemu
This commit is contained in:
Laurent Vivier 2018-03-06 08:27:55 -05:00 committed by Lioncash
parent b82fe8b95c
commit f9ee2d24cc
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -5298,28 +5298,39 @@ DISAS_INSN(fscc)
#if defined(CONFIG_SOFTMMU)
DISAS_INSN(frestore)
{
M68kCPU *cpu = m68k_env_get_cpu(env);
TCGContext *tcg_ctx = s->uc->tcg_ctx;
TCGv addr;
if (IS_USER(s)) {
gen_exception(s, s->insn_pc, EXCP_PRIVILEGE);
return;
}
/* TODO: Implement frestore. */
cpu_abort(CPU(cpu), "FRESTORE not implemented");
if (m68k_feature(s->env, M68K_FEATURE_M68040)) {
SRC_EA(env, addr, OS_LONG, 0, NULL);
/* FIXME: check the state frame */
} else {
disas_undef(env, s, insn);
}
}
DISAS_INSN(fsave)
{
M68kCPU *cpu = m68k_env_get_cpu(env);
TCGContext *tcg_ctx = s->uc->tcg_ctx;
if (IS_USER(s)) {
gen_exception(s, s->insn_pc, EXCP_PRIVILEGE);
return;
}
/* TODO: Implement fsave. */
cpu_abort(CPU(cpu), "FSAVE not implemented");
if (m68k_feature(s->env, M68K_FEATURE_M68040)) {
/* always write IDLE */
TCGv idle = tcg_const_i32(tcg_ctx, 0x41000000);
DEST_EA(env, insn, OS_LONG, idle, NULL);
tcg_temp_free(tcg_ctx, idle);
} else {
disas_undef(env, s, insn);
}
}
#endif