summaryrefslogtreecommitdiff
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2017-07-30 13:13:21 -0700
committerRichard Henderson <rth@twiddle.net>2017-09-07 11:57:35 -0700
commit57a269469dbf70013dab3a176e1735636010a772 (patch)
tree1ff2db5b5d660b3ef87e7fd106aba052c222bfb9 /tcg/tcg.c
parent659ef5cbb893872d25e9d95191cc23b16546c8a1 (diff)
downloadqemu-57a269469dbf70013dab3a176e1735636010a772.tar.gz
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>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index dd74eabb0a..fd8a3dfe93 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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);