diff mbox

[v2,15/16] tcg: Fix types in tcg_regset_{set, reset}_reg

Message ID 20170912162513.21694-16-richard.henderson@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Henderson Sept. 12, 2017, 4:25 p.m. UTC
There was a problem here with an ILP32 host with 64 host registers.
E.g. aarch64 running in ILP32 mode.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tcg/tcg.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index d4412102ba..c5ada53358 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -210,9 +210,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"