[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/84] tcg: Add addr_type to TCGContext
From: |
Richard Henderson |
Subject: |
[PATCH 11/84] tcg: Add addr_type to TCGContext |
Date: |
Wed, 3 May 2023 08:22:18 +0100 |
This will enable replacement of TARGET_LONG_BITS within tcg/.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/tcg.h | 1 +
accel/tcg/translate-all.c | 2 ++
tcg/tcg.c | 3 +++
3 files changed, 6 insertions(+)
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index 7d6df5eabe..026b2dd362 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -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;
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 7b7d9a5fff..99a9d0e34f 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -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
diff --git a/tcg/tcg.c b/tcg/tcg.c
index b4e1e0e612..ce92336eec 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1423,6 +1423,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)
--
2.34.1
- [PATCH 26/84] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL, (continued)
- [PATCH 26/84] tcg/riscv: Remove TARGET_LONG_BITS, TCG_TYPE_TL, Richard Henderson, 2023/05/03
- [PATCH 21/84] tcg/aarch64: Remove USE_GUEST_BASE, Richard Henderson, 2023/05/03
- [PATCH 29/84] tcg: Remove TARGET_LONG_BITS, TCG_TYPE_TL, Richard Henderson, 2023/05/03
- [PATCH 32/84] tcg: Add tlb_dyn_max_bits to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 35/84] tcg: Remove TCG_TARGET_TLB_DISPLACEMENT_BITS, Richard Henderson, 2023/05/03
- [PATCH 39/84] *: Add missing includes of tcg/tcg.h, Richard Henderson, 2023/05/03
- [PATCH 33/84] tcg: Widen CPUTLBEntry comparators to 64-bits, Richard Henderson, 2023/05/03
- [PATCH 11/84] tcg: Add addr_type to TCGContext,
Richard Henderson <=
- [PATCH 31/84] tcg: Add page_bits and page_mask to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 37/84] *: Add missing includes of qemu/error-report.h, Richard Henderson, 2023/05/03
- [PATCH 34/84] tcg: Add tlb_fast_offset to TCGContext, Richard Henderson, 2023/05/03
- [PATCH 40/84] tcg: Split out tcg-target-reg-bits.h, Richard Henderson, 2023/05/03
- [PATCH 41/84] target/arm: Fix test of TCG_OVERSIZED_GUEST, Richard Henderson, 2023/05/03
- [PATCH 42/84] tcg: Split out tcg/oversized-guest.h, Richard Henderson, 2023/05/03
- [PATCH 43/84] tcg: Move TCGv, dup_const_tl definitions to tcg-op.h, Richard Henderson, 2023/05/03
- [PATCH 45/84] target/arm: Include helper-gen.h in translator.h, Richard Henderson, 2023/05/03