aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-04-10 13:02:26 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-04-10 13:02:26 +0100
commit9743cd5736263e90d312b2c33bd739ffe1eae70d (patch)
treede17c37cc67f94ad6efdb338c919aee1d9b3b887 /tcg/tcg.h
parent7f0f4208b3a96f2202e86bc3e58a4c20d390ce1b (diff)
downloadqemu-9743cd5736263e90d312b2c33bd739ffe1eae70d.zip
qemu-9743cd5736263e90d312b2c33bd739ffe1eae70d.tar.gz
qemu-9743cd5736263e90d312b2c33bd739ffe1eae70d.tar.bz2
tcg: Introduce tcg_set_insn_start_param
The parameters for tcg_gen_insn_start are target_ulong, which may be split into two TCGArg parameters for storage in the opcode on 32-bit hosts. Fixes the ARM target and its direct use of tcg_set_insn_param, which would set the wrong argument in the 64-on-32 case. Cc: qemu-stable@nongnu.org Reported-by: alarson@ddci.com Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180410003558.2470-1-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r--tcg/tcg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 9e2d909..30896ca 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -825,6 +825,16 @@ static inline void tcg_set_insn_param(TCGOp *op, int arg, TCGArg v)
op->args[arg] = v;
}
+static inline void tcg_set_insn_start_param(TCGOp *op, int arg, target_ulong v)
+{
+#if TARGET_LONG_BITS <= TCG_TARGET_REG_BITS
+ tcg_set_insn_param(op, arg, v);
+#else
+ tcg_set_insn_param(op, arg * 2, v);
+ tcg_set_insn_param(op, arg * 2 + 1, v >> 32);
+#endif
+}
+
/* The last op that was emitted. */
static inline TCGOp *tcg_last_op(void)
{