From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZrb-0008Lc-Cd for qemu-devel@nongnu.org; Fri, 08 Jan 2016 11:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHZra-00086L-Gg for qemu-devel@nongnu.org; Fri, 08 Jan 2016 11:26:07 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:32904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHZra-00086G-BG for qemu-devel@nongnu.org; Fri, 08 Jan 2016 11:26:06 -0500 Received: by mail-pf0-x243.google.com with SMTP id e65so888930pfe.0 for ; Fri, 08 Jan 2016 08:26:06 -0800 (PST) From: "Edgar E. Iglesias" Date: Fri, 8 Jan 2016 17:25:55 +0100 Message-Id: <1452270356-26373-2-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1452270356-26373-1-git-send-email-edgar.iglesias@gmail.com> References: <1452270356-26373-1-git-send-email-edgar.iglesias@gmail.com> Subject: [Qemu-devel] [RFC 1/2] tcg: Add tcg_set_insn_param List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, rth@twiddle.net From: "Edgar E. Iglesias" Add tcg_set_insn_param as a mechanism to modify an insn parameter after emiting the insn. This is useful for icount and also for embedding fault information for a specific insn. Signed-off-by: Edgar E. Iglesias --- tcg/tcg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcg/tcg.h b/tcg/tcg.h index a696922..9f2f4b8 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -585,6 +585,12 @@ struct TCGContext { extern TCGContext tcg_ctx; +static inline void tcg_set_insn_param(int op_idx, int arg, TCGArg v) +{ + int op_argi = tcg_ctx.gen_op_buf[op_idx].args; + tcg_ctx.gen_opparam_buf[op_argi + arg] = v; +} + /* The number of opcodes emitted so far. */ static inline int tcg_op_buf_count(void) { -- 1.9.1