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
This commit is contained in:
Edgar E. Iglesias 2018-02-23 19:58:39 -05:00 committed by Lioncash
parent 98a6d44c54
commit a30a478538
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -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)
{