diff options
author | Richard Henderson <rth@twiddle.net> | 2014-03-30 15:36:56 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-02-12 21:21:38 -0800 |
commit | fe700adb3db5b028b504423b946d4ee5200a8f2f (patch) | |
tree | 09389b35e12808f2eb2e2f9754e50842b7b5a799 /target-xtensa | |
parent | 0a7df5da986bd7ee0789f2d7b8611f2e8eee5046 (diff) | |
download | qemu-fe700adb3db5b028b504423b946d4ee5200a8f2f.zip |
tcg: Introduce tcg_op_buf_count and tcg_op_buf_full
The method by which we count the number of ops emitted
is going to change. Abstract that away into some inlines.
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-xtensa')
-rw-r--r-- | target-xtensa/translate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 2024ba90be..f112e2ac44 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -3021,7 +3021,6 @@ void gen_intermediate_code_internal(XtensaCPU *cpu, DisasContext dc; int insn_count = 0; int j, lj = -1; - uint16_t *gen_opc_end = tcg_ctx.gen_opc_buf + OPC_MAX_SIZE; int max_insns = tb->cflags & CF_COUNT_MASK; uint32_t pc_start = tb->pc; uint32_t next_page_start = @@ -3065,7 +3064,7 @@ void gen_intermediate_code_internal(XtensaCPU *cpu, check_breakpoint(env, &dc); if (search_pc) { - j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; + j = tcg_op_buf_count(); if (lj < j) { lj++; while (lj < j) { @@ -3117,7 +3116,7 @@ void gen_intermediate_code_internal(XtensaCPU *cpu, insn_count < max_insns && dc.pc < next_page_start && dc.pc + xtensa_insn_len(env, &dc) <= next_page_start && - tcg_ctx.gen_opc_ptr < gen_opc_end); + !tcg_op_buf_full()); reset_litbase(&dc); reset_sar_tracker(&dc); @@ -3143,7 +3142,7 @@ void gen_intermediate_code_internal(XtensaCPU *cpu, } #endif if (search_pc) { - j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; + j = tcg_op_buf_count(); memset(tcg_ctx.gen_opc_instr_start + lj + 1, 0, (j - lj) * sizeof(tcg_ctx.gen_opc_instr_start[0])); } else { |