[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 16/45] target/arm: Handle SME in sve_access_check
From: |
Richard Henderson |
Subject: |
[PATCH v6 16/45] target/arm: Handle SME in sve_access_check |
Date: |
Fri, 8 Jul 2022 20:45:11 +0530 |
The pseudocode for CheckSVEEnabled gains a check for Streaming
SVE mode, and for SME present but SVE absent.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-a64.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index b16d81bf19..b7b64f7358 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -1183,21 +1183,31 @@ static bool fp_access_check(DisasContext *s)
return true;
}
-/* Check that SVE access is enabled. If it is, return true.
+/*
+ * Check that SVE access is enabled. If it is, return true.
* If not, emit code to generate an appropriate exception and return false.
+ * This function corresponds to CheckSVEEnabled().
*/
bool sve_access_check(DisasContext *s)
{
- if (s->sve_excp_el) {
- assert(!s->sve_access_checked);
- s->sve_access_checked = true;
-
+ if (s->pstate_sm || !dc_isar_feature(aa64_sve, s)) {
+ assert(dc_isar_feature(aa64_sme, s));
+ if (!sme_sm_enabled_check(s)) {
+ goto fail_exit;
+ }
+ } else if (s->sve_excp_el) {
gen_exception_insn_el(s, s->pc_curr, EXCP_UDEF,
syn_sve_access_trap(), s->sve_excp_el);
- return false;
+ goto fail_exit;
}
s->sve_access_checked = true;
return fp_access_check(s);
+
+ fail_exit:
+ /* Assert that we only raise one exception per instruction. */
+ assert(!s->sve_access_checked);
+ s->sve_access_checked = true;
+ return false;
}
/*
--
2.34.1
- [PATCH v6 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming, (continued)
- [PATCH v6 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 08/45] target/arm: Mark FTSMUL, FTMAD, FADDA as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 10/45] target/arm: Mark string/histo/crypto as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 07/45] target/arm: Mark PMULL, FMMLA as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 11/45] target/arm: Mark gather/scatter load/store as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 12/45] target/arm: Mark gather prefetch as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 14/45] target/arm: Mark LD1RO as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 15/45] target/arm: Add SME enablement checks, Richard Henderson, 2022/07/08
- [PATCH v6 13/45] target/arm: Mark LDFF1 and LDNF1 as non-streaming, Richard Henderson, 2022/07/08
- [PATCH v6 16/45] target/arm: Handle SME in sve_access_check,
Richard Henderson <=
- [PATCH v6 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL, Richard Henderson, 2022/07/08
- [PATCH v6 18/45] target/arm: Implement SME ZERO, Richard Henderson, 2022/07/08
- [PATCH v6 19/45] target/arm: Implement SME MOVA, Richard Henderson, 2022/07/08
- [PATCH v6 20/45] target/arm: Implement SME LD1, ST1, Richard Henderson, 2022/07/08
- [PATCH v6 21/45] target/arm: Export unpredicated ld/st from translate-sve.c, Richard Henderson, 2022/07/08
- [PATCH v6 22/45] target/arm: Implement SME LDR, STR, Richard Henderson, 2022/07/08
- [PATCH v6 23/45] target/arm: Implement SME ADDHA, ADDVA, Richard Henderson, 2022/07/08
- [PATCH v6 24/45] target/arm: Implement FMOPA, FMOPS (non-widening), Richard Henderson, 2022/07/08
- [PATCH v6 25/45] target/arm: Implement BFMOPA, BFMOPS, Richard Henderson, 2022/07/08
- [PATCH v6 26/45] target/arm: Implement FMOPA, FMOPS (widening), Richard Henderson, 2022/07/08