tcg_gen_goto_tb and tcg_gen_lookup_and_goto_ptr call plugin and lookup_tb_ptr helpers. Define them in tcg-op-ldst.c. tcg_gen_op1i is static in tcg-op.c, so the moved calls use tcg_gen_op1.
Signed-off-by: Yonggang Luo <[email protected]> --- tcg/tcg-op-ldst.c | 31 +++++++++++++++++++++++++++++++ tcg/tcg-op.c | 32 -------------------------------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c index 22211ccb452..fb13c2f1523 100644 --- a/tcg/tcg-op-ldst.c +++ b/tcg/tcg-op-ldst.c @@ -1346,3 +1346,34 @@ GEN_ATOMIC_HELPER128(xchg, mov2, 0) #undef GEN_ATOMIC_HELPER #undef GEN_ATOMIC_HELPER128 + +void tcg_gen_goto_tb(unsigned idx) +{ + /* We tested CF_NO_GOTO_TB in translator_use_goto_tb. */ + tcg_debug_assert(!(tcg_ctx->gen_tb->cflags & CF_NO_GOTO_TB)); + /* We only support two chained exits. */ + tcg_debug_assert(idx <= TB_EXIT_IDXMAX); +#ifdef CONFIG_DEBUG_TCG + /* Verify that we haven't seen this numbered exit before. */ + tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0); + tcg_ctx->goto_tb_issue_mask |= 1 << idx; +#endif + plugin_gen_disable_mem_helpers(); + tcg_gen_op1(INDEX_op_goto_tb, 0, idx); +} + +void tcg_gen_lookup_and_goto_ptr(void) +{ + TCGv_ptr ptr; + + if (tcg_ctx->gen_tb->cflags & CF_NO_GOTO_PTR) { + tcg_gen_exit_tb(NULL, 0); + return; + } + + plugin_gen_disable_mem_helpers(); + ptr = tcg_temp_ebb_new_ptr(); + gen_helper_lookup_tb_ptr(ptr, tcg_env); + tcg_gen_op1(INDEX_op_goto_ptr, TCG_TYPE_PTR, tcgv_ptr_arg(ptr)); + tcg_temp_free_ptr(ptr); +} diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 2c88f4f7ca9..bd3bae37500 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -27,7 +27,6 @@ #include "tcg/tcg-temp-internal.h" #include "tcg/tcg-op-common.h" #include "exec/translation-block.h" -#include "exec/plugin-gen.h" #include "tcg-internal.h" #include "tcg-has.h" @@ -2699,34 +2698,3 @@ void tcg_gen_exit_tb(const TranslationBlock *tb, unsigned idx) tcg_gen_op1i(INDEX_op_exit_tb, 0, val); } - -void tcg_gen_goto_tb(unsigned idx) -{ - /* We tested CF_NO_GOTO_TB in translator_use_goto_tb. */ - tcg_debug_assert(!(tcg_ctx->gen_tb->cflags & CF_NO_GOTO_TB)); - /* We only support two chained exits. */ - tcg_debug_assert(idx <= TB_EXIT_IDXMAX); -#ifdef CONFIG_DEBUG_TCG - /* Verify that we haven't seen this numbered exit before. */ - tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0); - tcg_ctx->goto_tb_issue_mask |= 1 << idx; -#endif - plugin_gen_disable_mem_helpers(); - tcg_gen_op1i(INDEX_op_goto_tb, 0, idx); -} - -void tcg_gen_lookup_and_goto_ptr(void) -{ - TCGv_ptr ptr; - - if (tcg_ctx->gen_tb->cflags & CF_NO_GOTO_PTR) { - tcg_gen_exit_tb(NULL, 0); - return; - } - - plugin_gen_disable_mem_helpers(); - ptr = tcg_temp_ebb_new_ptr(); - gen_helper_lookup_tb_ptr(ptr, tcg_env); - tcg_gen_op1i(INDEX_op_goto_ptr, TCG_TYPE_PTR, tcgv_ptr_arg(ptr)); - tcg_temp_free_ptr(ptr); -} -- 2.52.0.windows.1
