aboutsummaryrefslogtreecommitdiff
path: root/target-xtensa
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-09-17 14:25:46 -0700
committerRichard Henderson <rth@twiddle.net>2015-10-07 20:36:27 +1100
commit959082fc4a93a016a6b697e1e0c2b373d8a3a373 (patch)
treedda759b30da56f02813c9328372a4af3b23c0cb0 /target-xtensa
parent667b8e29c5b1d8c5b4e6ad5f780ca60914eb6e96 (diff)
target-*: Increment num_insns immediately after tcg_gen_insn_start
This does tidy the icount test common to all targets. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-xtensa')
-rw-r--r--target-xtensa/translate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index ab9e8f9c21..3607e41535 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -3077,10 +3077,11 @@ void gen_intermediate_code_internal(XtensaCPU *cpu,
tcg_ctx.gen_opc_icount[lj] = insn_count;
}
tcg_gen_insn_start(dc.pc);
+ ++insn_count;
++dc.ccount_delta;
- if (insn_count + 1 == max_insns && (tb->cflags & CF_LAST_IO)) {
+ if (insn_count == max_insns && (tb->cflags & CF_LAST_IO)) {
gen_io_start();
}
@@ -3101,7 +3102,6 @@ void gen_intermediate_code_internal(XtensaCPU *cpu,
}
disas_xtensa_insn(env, &dc);
- ++insn_count;
if (dc.icount) {
tcg_gen_mov_i32(cpu_SR[ICOUNT], dc.next_icount);
}