|
| From: | Bastian Koppelmann |
| Subject: | Re: [Qemu-devel] [PATCH 2.3 5/8] tcg: Put opcodes in a linked list |
| Date: | Fri, 14 Nov 2014 15:03:25 +0000 |
| User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 11/11/2014 04:24 PM, Richard Henderson wrote:
+static void tcg_gen_op_begin(TCGContext *ctx, TCGOpcode opc, int args)
+{
+ int oi = ctx->gen_next_op_idx;
+ int ni = oi + 1;
+ int pi = oi - 1;
+
+ tcg_debug_assert(oi < OPC_BUF_SIZE);
+ ctx->gen_last_op_idx = oi;
+ ctx->gen_next_op_idx = ni;
+
+ ctx->gen_op_buf[oi] = (TCGOp){
+ .opc = opc,
+ .args = args,
+ .prev = pi,
+ .next = ni
+ };
+}
+
The name of this function says begin while used at the end of each
tcg_gen_op. How about tcg_gen_op_list_add?
You forgot to remove gen_opc_ptr in the dummy function tcg_liveness_analysis, in case USE_LIVENESS_ANALYSIS is not defined.@@ -508,14 +521,10 @@ struct TCGContext { int goto_tb_issue_mask; #endif- uint16_t gen_opc_buf[OPC_BUF_SIZE];- TCGArg gen_opparam_buf[OPPARAM_BUF_SIZE]; - - uint16_t *gen_opc_ptr; - TCGArg *gen_opparam_ptr;
- target_ulong gen_opc_pc[OPC_BUF_SIZE]; - uint16_t gen_opc_icount[OPC_BUF_SIZE]; - uint8_t gen_opc_instr_start[OPC_BUF_SIZE]; + int gen_first_op_idx; + int gen_last_op_idx; + int gen_next_op_idx; + int gen_next_parm_idx;
Other than that it looks good to me. Cheers, Bastian
| [Prev in Thread] | Current Thread | [Next in Thread] |