mirror of https://gitee.com/openkylin/qemu.git
target/m68k: implement rtd
Add "Return and Deallocate" (rtd) instruction. RTD #d (SP) -> PC SP + 4 + d -> SP Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <rth@twiddle.net> Tested-By: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Message-Id: <20170605100014.22981-1-laurent@vivier.eu>
This commit is contained in:
parent
65dfad62a1
commit
18059c9e16
|
@ -130,6 +130,7 @@ static void m68020_cpu_initfn(Object *obj)
|
|||
m68k_set_feature(env, M68K_FEATURE_FPU);
|
||||
m68k_set_feature(env, M68K_FEATURE_CAS);
|
||||
m68k_set_feature(env, M68K_FEATURE_BKPT);
|
||||
m68k_set_feature(env, M68K_FEATURE_RTD);
|
||||
}
|
||||
#define m68030_cpu_initfn m68020_cpu_initfn
|
||||
#define m68040_cpu_initfn m68020_cpu_initfn
|
||||
|
@ -151,6 +152,7 @@ static void m68060_cpu_initfn(Object *obj)
|
|||
m68k_set_feature(env, M68K_FEATURE_FPU);
|
||||
m68k_set_feature(env, M68K_FEATURE_CAS);
|
||||
m68k_set_feature(env, M68K_FEATURE_BKPT);
|
||||
m68k_set_feature(env, M68K_FEATURE_RTD);
|
||||
}
|
||||
|
||||
static void m5208_cpu_initfn(Object *obj)
|
||||
|
|
|
@ -251,6 +251,7 @@ enum m68k_features {
|
|||
M68K_FEATURE_FPU,
|
||||
M68K_FEATURE_CAS,
|
||||
M68K_FEATURE_BKPT,
|
||||
M68K_FEATURE_RTD,
|
||||
};
|
||||
|
||||
static inline int m68k_feature(CPUM68KState *env, int feature)
|
||||
|
|
|
@ -2483,6 +2483,16 @@ DISAS_INSN(nop)
|
|||
{
|
||||
}
|
||||
|
||||
DISAS_INSN(rtd)
|
||||
{
|
||||
TCGv tmp;
|
||||
int16_t offset = read_im16(env, s);
|
||||
|
||||
tmp = gen_load(s, OS_LONG, QREG_SP, 0);
|
||||
tcg_gen_addi_i32(QREG_SP, QREG_SP, offset + 4);
|
||||
gen_jmp(s, tmp);
|
||||
}
|
||||
|
||||
DISAS_INSN(rts)
|
||||
{
|
||||
TCGv tmp;
|
||||
|
@ -4904,6 +4914,7 @@ void register_m68k_insns (CPUM68KState *env)
|
|||
BASE(nop, 4e71, ffff);
|
||||
BASE(stop, 4e72, ffff);
|
||||
BASE(rte, 4e73, ffff);
|
||||
INSN(rtd, 4e74, ffff, RTD);
|
||||
BASE(rts, 4e75, ffff);
|
||||
INSN(movec, 4e7b, ffff, CF_ISA_A);
|
||||
BASE(jump, 4e80, ffc0);
|
||||
|
|
Loading…
Reference in New Issue