target/arm: optimize cross-page direct jumps in softmmu

Instead of unconditionally exiting to the exec loop, use the
lookup_and_goto_ptr helper to jump to the target if it is valid.

Perf impact: see next commit's log.

Backports commit 7ad55b4ffd982c80f26f7f3658138d94cdc678e8 from qemu
This commit is contained in:
Emilio G. Cota 2018-03-02 21:09:40 -05:00 committed by Lioncash
parent e4dfb7f807
commit 5a42602b92
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -4266,8 +4266,11 @@ static inline void gen_goto_tb(DisasContext *s, int n, target_ulong dest)
gen_set_pc_im(s, dest);
tcg_gen_exit_tb(tcg_ctx, (uintptr_t)s->tb + n);
} else {
TCGv addr = tcg_temp_new(tcg_ctx);
gen_set_pc_im(s, dest);
tcg_gen_exit_tb(tcg_ctx, 0);
tcg_gen_extu_i32_tl(tcg_ctx, addr, tcg_ctx->cpu_R[15]);
tcg_gen_lookup_and_goto_ptr(tcg_ctx, addr);
tcg_temp_free(tcg_ctx, addr);
}
}