diff options
Diffstat (limited to 'target-cris')
-rw-r--r-- | target-cris/translate.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/target-cris/translate.c b/target-cris/translate.c index 9c8ff8f..f28b199 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -520,16 +520,22 @@ static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) gen_set_label(l1); } -static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) +static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) { - TranslationBlock *tb; - tb = dc->tb; +#ifndef CONFIG_USER_ONLY + return (dc->tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || + (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); +#else + return true; +#endif +} - if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || - (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK)) { +static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) +{ + if (use_goto_tb(dc, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(env_pc, dest); - tcg_gen_exit_tb((uintptr_t)tb + n); + tcg_gen_exit_tb((uintptr_t)dc->tb + n); } else { tcg_gen_movi_tl(env_pc, dest); tcg_gen_exit_tb(0); |