[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 28/71] target/arm: Add PSTATE.{SM,ZA} to TB flags
From: |
Richard Henderson |
Subject: |
[PATCH v2 28/71] target/arm: Add PSTATE.{SM,ZA} to TB flags |
Date: |
Tue, 7 Jun 2022 13:32:23 -0700 |
These are required to determine if various insns
are allowed to issue.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.h | 2 ++
target/arm/translate.h | 4 ++++
target/arm/helper.c | 4 ++++
target/arm/translate-a64.c | 2 ++
4 files changed, 12 insertions(+)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 2f43b00843..b48a80dab7 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3284,6 +3284,8 @@ FIELD(TBFLAG_A64, TCMA, 16, 2)
FIELD(TBFLAG_A64, MTE_ACTIVE, 18, 1)
FIELD(TBFLAG_A64, MTE0_ACTIVE, 19, 1)
FIELD(TBFLAG_A64, SMEEXC_EL, 20, 2)
+FIELD(TBFLAG_A64, PSTATE_SM, 22, 1)
+FIELD(TBFLAG_A64, PSTATE_ZA, 23, 1)
/*
* Helpers for using the above.
diff --git a/target/arm/translate.h b/target/arm/translate.h
index a492e4217b..fbd6713572 100644
--- a/target/arm/translate.h
+++ b/target/arm/translate.h
@@ -101,6 +101,10 @@ typedef struct DisasContext {
bool align_mem;
/* True if PSTATE.IL is set */
bool pstate_il;
+ /* True if PSTATE.SM is set. */
+ bool pstate_sm;
+ /* True if PSTATE.ZA is set. */
+ bool pstate_za;
/* True if MVE insns are definitely not predicated by VPR or LTPSIZE */
bool mve_no_pred;
/*
diff --git a/target/arm/helper.c b/target/arm/helper.c
index e7e94213b1..bec7e47b78 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -13857,6 +13857,10 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState
*env, int el, int fp_el,
}
if (cpu_isar_feature(aa64_sme, env_archcpu(env))) {
DP_TBFLAG_A64(flags, SMEEXC_EL, sme_exception_el(env, el));
+ if (FIELD_EX64(env->svcr, SVCR, SM)) {
+ DP_TBFLAG_A64(flags, PSTATE_SM, 1);
+ }
+ DP_TBFLAG_A64(flags, PSTATE_ZA, FIELD_EX64(env->svcr, SVCR, ZA));
}
sctlr = regime_sctlr(env, stage1);
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index f51d80d816..fdc035ad9a 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -14635,6 +14635,8 @@ static void
aarch64_tr_init_disas_context(DisasContextBase *dcbase,
dc->ata = EX_TBFLAG_A64(tb_flags, ATA);
dc->mte_active[0] = EX_TBFLAG_A64(tb_flags, MTE_ACTIVE);
dc->mte_active[1] = EX_TBFLAG_A64(tb_flags, MTE0_ACTIVE);
+ dc->pstate_sm = EX_TBFLAG_A64(tb_flags, PSTATE_SM);
+ dc->pstate_za = EX_TBFLAG_A64(tb_flags, PSTATE_ZA);
dc->vec_len = 0;
dc->vec_stride = 0;
dc->cp_regs = arm_cpu->cp_regs;
--
2.34.1
- [PATCH v2 14/71] target/arm: Export sve contiguous ldst support functions, (continued)
- [PATCH v2 14/71] target/arm: Export sve contiguous ldst support functions, Richard Henderson, 2022/06/07
- [PATCH v2 16/71] target/arm: Use expand_pred_b in mve_helper.c, Richard Henderson, 2022/06/07
- [PATCH v2 21/71] target/arm: Implement TPIDR2_EL0, Richard Henderson, 2022/06/07
- [PATCH v2 22/71] target/arm: Add SMEEXC_EL to TB flags, Richard Henderson, 2022/06/07
- [PATCH v2 23/71] target/arm: Add syn_smetrap, Richard Henderson, 2022/06/07
- [PATCH v2 24/71] target/arm: Add ARM_CP_SME, Richard Henderson, 2022/06/07
- [PATCH v2 25/71] target/arm: Add SVCR, Richard Henderson, 2022/06/07
- [PATCH v2 27/71] target/arm: Add SMIDR_EL1, SMPRI_EL1, SMPRIMAP_EL2, Richard Henderson, 2022/06/07
- [PATCH v2 28/71] target/arm: Add PSTATE.{SM,ZA} to TB flags,
Richard Henderson <=
- [PATCH v2 29/71] target/arm: Add the SME ZA storage to CPUARMState, Richard Henderson, 2022/06/07
- [PATCH v2 20/71] target/arm: Add ID_AA64SMFR0_EL1, Richard Henderson, 2022/06/07
- [PATCH v2 33/71] target/arm: Generalize cpu_arm_{get,set}_vq, Richard Henderson, 2022/06/07
- [PATCH v2 31/71] target/arm: Move error for sve%d property to arm_cpu_sve_finalize, Richard Henderson, 2022/06/07
- [PATCH v2 30/71] target/arm: Implement SMSTART, SMSTOP, Richard Henderson, 2022/06/07
- [PATCH v2 34/71] target/arm: Generalize cpu_arm_{get, set}_default_vec_len, Richard Henderson, 2022/06/07