diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-06-08 19:38:57 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-06-08 19:38:57 +0100 |
commit | 886902ece71b5e795fea3e052a32f047d2f8fe33 (patch) | |
tree | 4d5e81ad570d44e4b574c4b3f272bb8eb07a829c /target/arm/internals.h | |
parent | 9b5f422559a528f4117aa9c3098fddf3d7c535ba (diff) |
target/arm: Use uint32_t instead of bitmap for sve vq's
The bitmap need only hold 15 bits; bitmap is over-complicated.
We can simplify operations quite a bit with plain logical ops.
The introduction of SVE_VQ_POW2_MAP eliminates the need for
looping in order to search for powers of two. Simply perform
the logical ops and use count leading or trailing zeros as
required to find the result.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220607203306.657998-12-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/internals.h')
-rw-r--r-- | target/arm/internals.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/target/arm/internals.h b/target/arm/internals.h index 79eb463753..a1bae4588a 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -1340,4 +1340,9 @@ bool el_is_in_host(CPUARMState *env, int el); void aa32_max_features(ARMCPU *cpu); +/* Powers of 2 for sve_vq_map et al. */ +#define SVE_VQ_POW2_MAP \ + ((1 << (1 - 1)) | (1 << (2 - 1)) | \ + (1 << (4 - 1)) | (1 << (8 - 1)) | (1 << (16 - 1))) + #endif |