diff options
author | Richard Henderson <rth@twiddle.net> | 2017-07-30 13:13:21 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2017-09-07 11:57:35 -0700 |
commit | 57a269469dbf70013dab3a176e1735636010a772 (patch) | |
tree | 1ff2db5b5d660b3ef87e7fd106aba052c222bfb9 /accel | |
parent | 659ef5cbb893872d25e9d95191cc23b16546c8a1 (diff) | |
download | qemu-57a269469dbf70013dab3a176e1735636010a772.zip qemu-57a269469dbf70013dab3a176e1735636010a772.tar.gz qemu-57a269469dbf70013dab3a176e1735636010a772.tar.bz2 |
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 'accel')
-rw-r--r-- | accel/tcg/translate-all.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 93a1cf2..2d1ed06 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1329,7 +1329,27 @@ TranslationBlock *tb_gen_code(CPUState *cpu, qemu_log_in_addr_range(tb->pc)) { qemu_log_lock(); qemu_log("OUT: [size=%d]\n", gen_code_size); - log_disas(tb->tc_ptr, gen_code_size); + if (tcg_ctx.data_gen_ptr) { + size_t code_size = tcg_ctx.data_gen_ptr - tb->tc_ptr; + size_t data_size = gen_code_size - code_size; + size_t i; + + log_disas(tb->tc_ptr, code_size); + + for (i = 0; i < data_size; i += sizeof(tcg_target_ulong)) { + if (sizeof(tcg_target_ulong) == 8) { + qemu_log("0x%08" PRIxPTR ": .quad 0x%016" PRIx64 "\n", + (uintptr_t)tcg_ctx.data_gen_ptr + i, + *(uint64_t *)(tcg_ctx.data_gen_ptr + i)); + } else { + qemu_log("0x%08" PRIxPTR ": .long 0x%08x\n", + (uintptr_t)tcg_ctx.data_gen_ptr + i, + *(uint32_t *)(tcg_ctx.data_gen_ptr + i)); + } + } + } else { + log_disas(tb->tc_ptr, gen_code_size); + } qemu_log("\n"); qemu_log_flush(); qemu_log_unlock(); |