tcg: Generate BB epilogue on ops flagged BB_END

This commit is contained in:
Matt Borgerson 2021-09-30 15:29:45 -07:00 committed by mborgerson
parent 55ea6adf5d
commit 5b04e4f499
2 changed files with 5 additions and 14 deletions

View File

@ -223,8 +223,6 @@ void tcg_gen_sari_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2)
void tcg_gen_brcond_i32(TCGCond cond, TCGv_i32 arg1, TCGv_i32 arg2, TCGLabel *l)
{
gen_bb_epilogue();
if (cond == TCG_COND_ALWAYS) {
tcg_gen_br(l);
} else if (cond != TCG_COND_NEVER) {
@ -235,8 +233,6 @@ void tcg_gen_brcond_i32(TCGCond cond, TCGv_i32 arg1, TCGv_i32 arg2, TCGLabel *l)
void tcg_gen_brcondi_i32(TCGCond cond, TCGv_i32 arg1, int32_t arg2, TCGLabel *l)
{
gen_bb_epilogue();
if (cond == TCG_COND_ALWAYS) {
tcg_gen_br(l);
} else if (cond != TCG_COND_NEVER) {
@ -1450,8 +1446,6 @@ void tcg_gen_sari_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2)
void tcg_gen_brcond_i64(TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2, TCGLabel *l)
{
gen_bb_epilogue();
if (cond == TCG_COND_ALWAYS) {
tcg_gen_br(l);
} else if (cond != TCG_COND_NEVER) {
@ -1469,8 +1463,6 @@ void tcg_gen_brcond_i64(TCGCond cond, TCGv_i64 arg1, TCGv_i64 arg2, TCGLabel *l)
void tcg_gen_brcondi_i64(TCGCond cond, TCGv_i64 arg1, int64_t arg2, TCGLabel *l)
{
gen_bb_epilogue();
if (TCG_TARGET_REG_BITS == 64) {
tcg_gen_brcond_i64(cond, arg1, tcg_constant_i64(arg2), l);
} else if (cond == TCG_COND_ALWAYS) {
@ -2722,8 +2714,6 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx)
* the translator_loop.
*/
gen_bb_epilogue();
uintptr_t val = (uintptr_t)tcg_splitwx_to_rx((void *)tb) + idx;
if (tb == NULL) {
@ -2745,8 +2735,6 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx)
void tcg_gen_goto_tb(unsigned idx)
{
gen_bb_epilogue();
/* We tested CF_NO_GOTO_TB in translator_use_goto_tb. */
tcg_debug_assert(!(tcg_ctx->tb_cflags & CF_NO_GOTO_TB));
/* We only support two chained exits. */
@ -2769,8 +2757,6 @@ void tcg_gen_lookup_and_goto_ptr(void)
return;
}
gen_bb_epilogue();
plugin_gen_disable_mem_helpers();
ptr = tcg_temp_new_ptr();
gen_helper_lookup_tb_ptr(ptr, cpu_env);

View File

@ -2290,6 +2290,11 @@ static TCGOp *tcg_op_alloc(TCGOpcode opc)
TCGOp *tcg_emit_op(TCGOpcode opc)
{
/* FIXME: Ugly opcode hook should be moved elsewhere */
if (tcg_op_defs[opc].flags & TCG_OPF_BB_END) {
gen_bb_epilogue();
}
TCGOp *op = tcg_op_alloc(opc);
QTAILQ_INSERT_TAIL(&tcg_ctx->ops, op, link);
return op;