diff options
author | Richard Henderson | 2022-07-08 17:15:10 +0200 |
---|---|---|
committer | Peter Maydell | 2022-07-11 14:19:35 +0200 |
commit | 3d74825f4d68a54cf1cd772dda8b502695b2d783 (patch) | |
tree | 6861efa8cc2e0de75d28191cdc5acdab570c7d8d /target/arm/translate-a64.h | |
parent | target/arm: Mark LD1RO as non-streaming (diff) | |
download | qemu-3d74825f4d68a54cf1cd772dda8b502695b2d783.tar.gz qemu-3d74825f4d68a54cf1cd772dda8b502695b2d783.tar.xz qemu-3d74825f4d68a54cf1cd772dda8b502695b2d783.zip |
target/arm: Add SME enablement checks
These functions will be used to verify that the cpu
is in the correct state for a given instruction.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220708151540.18136-16-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/translate-a64.h')
-rw-r--r-- | target/arm/translate-a64.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 789b6e8e78..02fb95e019 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -29,6 +29,27 @@ void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v); bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn, unsigned int imms, unsigned int immr); bool sve_access_check(DisasContext *s); +bool sme_enabled_check(DisasContext *s); +bool sme_enabled_check_with_svcr(DisasContext *s, unsigned); + +/* This function corresponds to CheckStreamingSVEEnabled. */ +static inline bool sme_sm_enabled_check(DisasContext *s) +{ + return sme_enabled_check_with_svcr(s, R_SVCR_SM_MASK); +} + +/* This function corresponds to CheckSMEAndZAEnabled. */ +static inline bool sme_za_enabled_check(DisasContext *s) +{ + return sme_enabled_check_with_svcr(s, R_SVCR_ZA_MASK); +} + +/* Note that this function corresponds to CheckStreamingSVEAndZAEnabled. */ +static inline bool sme_smza_enabled_check(DisasContext *s) +{ + return sme_enabled_check_with_svcr(s, R_SVCR_SM_MASK | R_SVCR_ZA_MASK); +} + TCGv_i64 clean_data_tbi(DisasContext *s, TCGv_i64 addr); TCGv_i64 gen_mte_check1(DisasContext *s, TCGv_i64 addr, bool is_write, bool tag_checked, int log2_size); |