From: Andreas Schwab <sch...@linux-m68k.org> Laurent Vivier <laur...@vivier.eu> writes:
> + tmp = tcg_temp_new(); > + tcg_gen_ext16s_i32(tmp, reg); > + tcg_gen_addi_i32(tmp, tmp, -1); > + gen_partset_reg(OS_WORD, reg, tmp); > + tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, l1); The counter needs to be compared with -1, not 0. Andreas. --- target-m68k/translate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 218210c..d4d2f44 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -939,7 +939,7 @@ DISAS_INSN(dbcc) tcg_gen_ext16s_i32(tmp, reg); tcg_gen_addi_i32(tmp, tmp, -1); gen_partset_reg(OS_WORD, reg, tmp); - tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, l1); + tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, -1, l1); gen_jmp_tb(s, 1, base + offset); gen_set_label(l1); gen_jmp_tb(s, 0, s->pc); -- 1.7.2.3