aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-08-07 18:42:02 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-08-18 12:17:57 +0100
commitd65d0b043244806ee25de60fa8acc1529943e830 (patch)
tree7933625b71f195feba10dfbbdb23913592d0c4fa
parent75b92f26e07c2026814561dc2321d3f7862b8a5d (diff)
downloadqemu-arm-d65d0b043244806ee25de60fa8acc1529943e830.tar.gz
target-arm: A64: Avoid duplicate exit_tb(0) in non-linked goto_tb
If gen_goto_tb() decides not to link the two TBs, then the fallback path generates unnecessary code: * if singlestep is enabled then we generate unreachable code after the gen_exception_internal(EXCP_DEBUG) * if singlestep is disabled then we will generate exit_tb(0) twice, once in gen_goto_tb() and once coming out of the main loop with is_jmp set to DISAS_JUMP Correct these deficiencies by only emitting exit_tb() in the non-singlestep case, in which case we can use DISAS_TB_JUMP to suppress the main-loop exit_tb(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target-arm/translate-a64.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index fc319d5b2f..14e8d29b58 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -232,9 +232,10 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest)
gen_a64_set_pc_im(dest);
if (s->singlestep_enabled) {
gen_exception_internal(EXCP_DEBUG);
+ } else {
+ tcg_gen_exit_tb(0);
+ s->is_jmp = DISAS_TB_JUMP;
}
- tcg_gen_exit_tb(0);
- s->is_jmp = DISAS_JUMP;
}
}