From a30a4785381fd06c5ef7a4dd8f9db84502c218e4 Mon Sep 17 00:00:00 2001 From: "Edgar E. Iglesias" Date: Fri, 23 Feb 2018 19:58:39 -0500 Subject: [PATCH] tcg: Add tcg_set_insn_param 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. Backports commit 1d41478fd428e01f057d3248292e4cdcdb048523 from qemu --- qemu/tcg/tcg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qemu/tcg/tcg.h b/qemu/tcg/tcg.h index ee1b49e5..fcaab47a 100644 --- a/qemu/tcg/tcg.h +++ b/qemu/tcg/tcg.h @@ -853,6 +853,12 @@ struct TCGContext { TCGLabel *exitreq_label; // gen_tb_start() }; +static inline void tcg_set_insn_param(TCGContext *tcg_ctx, 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(TCGContext *tcg_ctx) {