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

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

Perf impact: see next commit's log.

Backports commit fe62089563ffc6a42f16ff28a6b6be34d2697766 from qemu
This commit is contained in:
Emilio G. Cota 2018-03-03 14:07:48 -05:00 committed by Lioncash
parent baa017d29b
commit 3895eea3b4
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -2430,9 +2430,8 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip)
gen_jmp_im(s, eip); gen_jmp_im(s, eip);
tcg_gen_exit_tb(tcg_ctx, (uintptr_t)s->tb + tb_num); tcg_gen_exit_tb(tcg_ctx, (uintptr_t)s->tb + tb_num);
} else { } else {
/* jump to another page: currently not optimized */ /* jump to another page */
gen_jmp_im(s, eip); gen_jr(s, tcg_ctx->cpu_tmp0);
gen_eob(s);
} }
} }