]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
tcg: Add addr_type to TCGContext
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 10 Mar 2023 01:46:16 +0000 (17:46 -0800)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 16 May 2023 23:30:29 +0000 (16:30 -0700)
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>
accel/tcg/translate-all.c
include/tcg/tcg.h
tcg/tcg.c

index 7b7d9a5fffebb78d97812741d435bdeff958403c..99a9d0e34f1b4df9a0b8e05427fe2597924dde78 100644 (file)
@@ -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
index 42a3c05607fa3cdcb553cc298236a21b4b1737dd..b9748fd0c5b87aa233656c2f70f904af6aefb0f0 100644 (file)
@@ -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;
index 45e8aa67ec29d1757cd0767170b3e9efe254c58e..ff860b54693b42bbfa7e0503dec690bbd1713635 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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)