From 2f482cf83c69b82bdec6307cabf3e86679cfb8f0 Mon Sep 17 00:00:00 2001 From: Denis Drakhnya Date: Fri, 13 Nov 2020 11:53:21 +0200 Subject: [PATCH] target: e2k: Remove type from macro GEN_MASK. --- target/e2k/helper.c | 2 +- target/e2k/translate.h | 8 ++++---- target/e2k/translate/control.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/e2k/helper.c b/target/e2k/helper.c index cf2c21ed3c..8fe3990621 100644 --- a/target/e2k/helper.c +++ b/target/e2k/helper.c @@ -47,7 +47,7 @@ uint64_t helper_sxt(uint64_t x, uint64_t y) } if (x & 4) { - return y & GEN_MASK(uint64_t, 0, size); + return y & GEN_MASK(0, size); } else { return (((int64_t) y) << (64 - size) >> (64 - size)); } diff --git a/target/e2k/translate.h b/target/e2k/translate.h index 0856cf4517..61086ac61c 100644 --- a/target/e2k/translate.h +++ b/target/e2k/translate.h @@ -8,8 +8,8 @@ #define DYNAMIC_JUMP DISAS_TARGET_1 #define DISAS_CALL DISAS_TARGET_2 -#define GEN_MASK(type, start, end) \ - ((((type) 1 << ((end) - (start) + 1)) - 1) << start) +#define GEN_MASK(start, end) \ + (((1UL << ((end) - (start) + 1)) - 1) << start) #define GET_BIT(v, index) (((v) >> (index)) & 1) #define GET_FIELD(v, start, end) \ (((v) >> (start)) & ((1 << ((end) - (start) + 1)) - 1)) @@ -182,7 +182,7 @@ static inline void e2k_gen_get_field_i64(TCGv_i64 ret, TCGv_i64 val, { TCGv_i64 t0 = tcg_temp_new_i64(); - tcg_gen_andi_i64(t0, val, GEN_MASK(uint64_t, start, end)); + tcg_gen_andi_i64(t0, val, GEN_MASK(start, end)); tcg_gen_shli_i64(ret, t0, start); tcg_temp_free_i64(t0); @@ -191,7 +191,7 @@ static inline void e2k_gen_get_field_i64(TCGv_i64 ret, TCGv_i64 val, static inline void e2k_gen_set_field_i64(TCGv_i64 ret, TCGv_i64 val, uint64_t field, unsigned int start, unsigned int end) { - uint64_t mask = GEN_MASK(uint64_t, start, end); + uint64_t mask = GEN_MASK(start, end); TCGv_i64 t0 = tcg_const_i64(~mask); TCGv_i64 t1 = tcg_const_i64((field << start) & mask); TCGv_i64 t2 = tcg_temp_new_i64(); diff --git a/target/e2k/translate/control.c b/target/e2k/translate/control.c index 42141b19bd..362928b7bc 100644 --- a/target/e2k/translate/control.c +++ b/target/e2k/translate/control.c @@ -432,7 +432,7 @@ static void gen_jmp(DisasContext *dc) } TCGv_i64 t0 = tcg_temp_new_i64(); - tcg_gen_andi_i64(t0, e2k_cs.ctprs[ctpr], GEN_MASK(uint64_t, 0, 47)); + tcg_gen_andi_i64(t0, e2k_cs.ctprs[ctpr], GEN_MASK(0, 47)); tcg_gen_mov_tl(dc->jmp.dest, t0); tcg_temp_free_i64(t0);