mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
tcg: Infrastructure for managing constant pools
A new shared header tcg-pool.inc.c adds new_pool_label, for registering a tcg_target_ulong to be emitted after the generated code, plus relocation data to install a pointer to the data. A new pointer is added to the TCGContext, so that we dump the constant pool as data, not code. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
659ef5cbb8
commit
57a269469d
4 changed files with 119 additions and 1 deletions
|
@ -399,6 +399,7 @@ TranslationBlock *tcg_tb_alloc(TCGContext *s)
|
|||
return NULL;
|
||||
}
|
||||
s->code_gen_ptr = next;
|
||||
s->data_gen_ptr = NULL;
|
||||
return tb;
|
||||
}
|
||||
|
||||
|
@ -2619,6 +2620,9 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
|
|||
#ifdef TCG_TARGET_NEED_LDST_LABELS
|
||||
s->ldst_labels = NULL;
|
||||
#endif
|
||||
#ifdef TCG_TARGET_NEED_POOL_LABELS
|
||||
s->pool_labels = NULL;
|
||||
#endif
|
||||
|
||||
num_insns = -1;
|
||||
for (oi = s->gen_op_buf[0].next; oi != 0; oi = oi_next) {
|
||||
|
@ -2698,6 +2702,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
|
|||
return -1;
|
||||
}
|
||||
#endif
|
||||
#ifdef TCG_TARGET_NEED_POOL_LABELS
|
||||
if (!tcg_out_pool_finalize(s)) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* flush instruction cache */
|
||||
flush_icache_range((uintptr_t)s->code_buf, (uintptr_t)s->code_ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue