From: James Hogan <james.ho...@mips.com> ERET and ERETNC shouldn't clear MIPS_HFLAG_M16 for nanoMIPS since there is no ISA bit, so fix set_pc() to skip the hflags update.
Signed-off-by: James Hogan <james.ho...@mips.com> Signed-off-by: Yongbok Kim <yongbok....@mips.com> Signed-off-by: Aleksandar Markovic <amarko...@wavecomp.com> Signed-off-by: Stefan Markovic <smarko...@wavecomp.com> Reviewed-by: Aleksandar Markovic <amarko...@wavecomp.com> --- target/mips/op_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index b3eef9f..53c1eea 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -2392,6 +2392,9 @@ static void debug_post_eret(CPUMIPSState *env) static void set_pc(CPUMIPSState *env, target_ulong error_pc) { env->active_tc.PC = error_pc & ~(target_ulong)1; + if (env->insn_flags & ISA_NANOMIPS32) { + return; + } if (error_pc & 1) { env->hflags |= MIPS_HFLAG_M16; } else { -- 2.7.4