aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-09-11 12:50:42 -0700
committerRichard Henderson <richard.henderson@linaro.org>2017-09-17 06:52:19 -0700
commit80a8b9a910e14d4a1937f70dce944891990f3441 (patch)
tree6f1d2079c620a8ca2b29f8ba5174571bc422b018
parentf46934df662182097dce07d57ec00f37e4d2abf1 (diff)
downloadqemu-80a8b9a910e14d4a1937f70dce944891990f3441.zip
qemu-80a8b9a910e14d4a1937f70dce944891990f3441.tar.gz
qemu-80a8b9a910e14d4a1937f70dce944891990f3441.tar.bz2
tcg: Fix types in tcg_regset_{set,reset}_reg
There was a potential problem here with an ILP32 host with 64 host registers. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--tcg/tcg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 50dfd7c..25662c3 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -186,9 +186,9 @@ typedef enum TCGOpcode {
NB_OPS,
} TCGOpcode;
-#define tcg_regset_set_reg(d, r) (d) |= 1L << (r)
-#define tcg_regset_reset_reg(d, r) (d) &= ~(1L << (r))
-#define tcg_regset_test_reg(d, r) (((d) >> (r)) & 1)
+#define tcg_regset_set_reg(d, r) ((d) |= (TCGRegSet)1 << (r))
+#define tcg_regset_reset_reg(d, r) ((d) &= ~((TCGRegSet)1 << (r)))
+#define tcg_regset_test_reg(d, r) (((d) >> (r)) & 1)
#ifndef TCG_TARGET_INSN_UNIT_SIZE
# error "Missing TCG_TARGET_INSN_UNIT_SIZE"