Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tcg: Add addr_type to TCGContext
This will enable replacement of TARGET_LONG_BITS within tcg/.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed May 16, 2023
1 parent f0a9867 commit a7133db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions accel/tcg/translate-all.c
Expand Up @@ -356,6 +356,8 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
tb_set_page_addr0(tb, phys_pc);
tb_set_page_addr1(tb, -1);
tcg_ctx->gen_tb = tb;
tcg_ctx->addr_type = TCG_TYPE_TL;

tb_overflow:

#ifdef CONFIG_PROFILER
Expand Down
1 change: 1 addition & 0 deletions include/tcg/tcg.h
Expand Up @@ -558,6 +558,7 @@ struct TCGContext {
int nb_temps;
int nb_indirects;
int nb_ops;
TCGType addr_type; /* TCG_TYPE_I32 or TCG_TYPE_I64 */

TCGRegSet reserved_regs;
intptr_t current_frame_offset;
Expand Down
3 changes: 3 additions & 0 deletions tcg/tcg.c
Expand Up @@ -1520,6 +1520,9 @@ void tcg_func_start(TCGContext *s)
QTAILQ_INIT(&s->ops);
QTAILQ_INIT(&s->free_ops);
QSIMPLEQ_INIT(&s->labels);

tcg_debug_assert(s->addr_type == TCG_TYPE_I32 ||
s->addr_type == TCG_TYPE_I64);
}

static TCGTemp *tcg_temp_alloc(TCGContext *s)
Expand Down

0 comments on commit a7133db

Please sign in to comment.