[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/29] target/arm: Replace bitmask64 with MAKE_64BIT_MASK
From: |
Peter Maydell |
Subject: |
[PULL 14/29] target/arm: Replace bitmask64 with MAKE_64BIT_MASK |
Date: |
Thu, 18 May 2023 13:50:52 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Use the bitops.h macro rather than rolling our own here.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20230512144106.3608981-9-peter.maydell@linaro.org
---
target/arm/tcg/translate-a64.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 8fa08cc2518..c744477d71a 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -4288,13 +4288,6 @@ static uint64_t bitfield_replicate(uint64_t mask,
unsigned int e)
return mask;
}
-/* Return a value with the bottom len bits set (where 0 < len <= 64) */
-static inline uint64_t bitmask64(unsigned int length)
-{
- assert(length > 0 && length <= 64);
- return ~0ULL >> (64 - length);
-}
-
/* Simplified variant of pseudocode DecodeBitMasks() for the case where we
* only require the wmask. Returns false if the imms/immr/immn are a reserved
* value (ie should cause a guest UNDEF exception), and true if they are
@@ -4350,10 +4343,10 @@ bool logic_imm_decode_wmask(uint64_t *result, unsigned
int immn,
/* Create the value of one element: s+1 set bits rotated
* by r within the element (which is e bits wide)...
*/
- mask = bitmask64(s + 1);
+ mask = MAKE_64BIT_MASK(0, s + 1);
if (r) {
mask = (mask >> r) | (mask << (e - r));
- mask &= bitmask64(e);
+ mask &= MAKE_64BIT_MASK(0, e);
}
/* ...then replicate the element over the whole 64 bit value */
mask = bitfield_replicate(mask, e);
--
2.34.1
- [PULL 11/29] target/arm: Split gen_add_CC and gen_sub_CC, (continued)
- [PULL 11/29] target/arm: Split gen_add_CC and gen_sub_CC, Peter Maydell, 2023/05/18
- [PULL 15/29] target/arm: Convert Logical (immediate) to decodetree, Peter Maydell, 2023/05/18
- [PULL 06/29] sbsa-ref: use Bochs graphics card instead of VGA, Peter Maydell, 2023/05/18
- [PULL 28/29] hw/arm/vexpress: Avoid trivial memory leak of 'flashalias', Peter Maydell, 2023/05/18
- [PULL 20/29] target/arm: Convert CBZ, CBNZ to decodetree, Peter Maydell, 2023/05/18
- [PULL 17/29] target/arm: Convert Bitfield to decodetree, Peter Maydell, 2023/05/18
- [PULL 12/29] target/arm: Convert Add/subtract (immediate) to decodetree, Peter Maydell, 2023/05/18
- [PULL 25/29] target/arm: Convert BRAA, BRAB, BLRAA, BLRAB to decodetree, Peter Maydell, 2023/05/18
- [PULL 22/29] target/arm: Convert conditional branch insns to decodetree, Peter Maydell, 2023/05/18
- [PULL 19/29] target/arm: Convert unconditional branch immediate to decodetree, Peter Maydell, 2023/05/18
- [PULL 14/29] target/arm: Replace bitmask64 with MAKE_64BIT_MASK,
Peter Maydell <=
- [PULL 18/29] target/arm: Convert Extract instructions to decodetree, Peter Maydell, 2023/05/18
- [PULL 29/29] docs: Convert u2f.txt to rST, Peter Maydell, 2023/05/18
- [PULL 13/29] target/arm: Convert Add/subtract (immediate with tags) to decodetree, Peter Maydell, 2023/05/18
- [PULL 21/29] target/arm: Convert TBZ, TBNZ to decodetree, Peter Maydell, 2023/05/18
- [PULL 24/29] target/arm: Convert BRA[AB]Z, BLR[AB]Z, RETA[AB] to decodetree, Peter Maydell, 2023/05/18
- [PULL 23/29] target/arm: Convert BR, BLR, RET to decodetree, Peter Maydell, 2023/05/18
- [PULL 16/29] target/arm: Convert Move wide (immediate) to decodetree, Peter Maydell, 2023/05/18
- [PULL 27/29] target/arm: Saturate L2CTLR_EL1 core count field rather than overflowing, Peter Maydell, 2023/05/18
- Re: [PULL 00/29] target-arm queue, Richard Henderson, 2023/05/18