[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/71] target/arm: Merge aarch64_sve_zcr_get_valid_len into calle
From: |
Richard Henderson |
Subject: |
[PATCH 10/71] target/arm: Merge aarch64_sve_zcr_get_valid_len into caller |
Date: |
Thu, 2 Jun 2022 14:47:52 -0700 |
This function is used only once, and will need modification
for Streaming SVE mode.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/internals.h | 11 -----------
target/arm/helper.c | 30 +++++++++++-------------------
2 files changed, 11 insertions(+), 30 deletions(-)
diff --git a/target/arm/internals.h b/target/arm/internals.h
index a73f2a94c5..4dcdca918b 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -189,17 +189,6 @@ void arm_translate_init(void);
void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb);
#endif /* CONFIG_TCG */
-/**
- * aarch64_sve_zcr_get_valid_len:
- * @cpu: cpu context
- * @start_len: maximum len to consider
- *
- * Return the maximum supported sve vector length <= @start_len.
- * Note that both @start_len and the return value are in units
- * of ZCR_ELx.LEN, so the vector bit length is (x + 1) * 128.
- */
-uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len);
-
enum arm_fprounding {
FPROUNDING_TIEEVEN,
FPROUNDING_POSINF,
diff --git a/target/arm/helper.c b/target/arm/helper.c
index dc8f1e44cc..e84d30e5fc 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -6222,39 +6222,31 @@ int sve_exception_el(CPUARMState *env, int el)
return 0;
}
-uint32_t aarch64_sve_zcr_get_valid_len(ARMCPU *cpu, uint32_t start_len)
-{
- uint32_t end_len;
-
- start_len = MIN(start_len, ARM_MAX_VQ - 1);
- end_len = start_len;
-
- if (!test_bit(start_len, cpu->sve_vq_map)) {
- end_len = find_last_bit(cpu->sve_vq_map, start_len);
- assert(end_len < start_len);
- }
- return end_len;
-}
-
/*
* Given that SVE is enabled, return the vector length for EL.
*/
uint32_t sve_zcr_len_for_el(CPUARMState *env, int el)
{
ARMCPU *cpu = env_archcpu(env);
- uint32_t zcr_len = cpu->sve_max_vq - 1;
+ uint32_t len = cpu->sve_max_vq - 1;
+ uint32_t end_len;
if (el <= 1 && !el_is_in_host(env, el)) {
- zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]);
+ len = MIN(len, 0xf & (uint32_t)env->vfp.zcr_el[1]);
}
if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) {
- zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]);
+ len = MIN(len, 0xf & (uint32_t)env->vfp.zcr_el[2]);
}
if (arm_feature(env, ARM_FEATURE_EL3)) {
- zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]);
+ len = MIN(len, 0xf & (uint32_t)env->vfp.zcr_el[3]);
}
- return aarch64_sve_zcr_get_valid_len(cpu, zcr_len);
+ end_len = len;
+ if (!test_bit(len, cpu->sve_vq_map)) {
+ end_len = find_last_bit(cpu->sve_vq_map, len);
+ assert(end_len < len);
+ }
+ return end_len;
}
static void zcr_write(CPUARMState *env, const ARMCPRegInfo *ri,
--
2.34.1
- [PATCH 06/71] target/arm: Use el_is_in_host for sve_zcr_len_for_el, (continued)
- [PATCH 06/71] target/arm: Use el_is_in_host for sve_zcr_len_for_el, Richard Henderson, 2022/06/02
- [PATCH 03/71] target/arm: Remove route_to_el2 check from sve_exception_el, Richard Henderson, 2022/06/02
- [PATCH 08/71] target/arm: Hoist arm_is_el2_enabled check in sve_exception_el, Richard Henderson, 2022/06/02
- [PATCH 09/71] target/arm: Do not use aarch64_sve_zcr_get_valid_len in reset, Richard Henderson, 2022/06/02
- [PATCH 07/71] target/arm: Use el_is_in_host for sve_exception_el, Richard Henderson, 2022/06/02
- [PATCH 05/71] target/arm: Add el_is_in_host, Richard Henderson, 2022/06/02
- [PATCH 10/71] target/arm: Merge aarch64_sve_zcr_get_valid_len into caller,
Richard Henderson <=
- [PATCH 12/71] target/arm: Rename sve_zcr_len_for_el to sve_vqm1_for_el, Richard Henderson, 2022/06/02
- [PATCH 11/71] target/arm: Use uint32_t instead of bitmap for sve vq's, Richard Henderson, 2022/06/02
- [PATCH 13/71] target/arm: Split out load/store primitives to sve_ldst_internal.h, Richard Henderson, 2022/06/02
- [PATCH 15/71] target/arm: Move expand_pred_b to vec_internal.h, Richard Henderson, 2022/06/02
- [PATCH 16/71] target/arm: Use expand_pred_b in mve_helper.c, Richard Henderson, 2022/06/02
- [PATCH 17/71] target/arm: Move expand_pred_h to vec_internal.h, Richard Henderson, 2022/06/02
- [PATCH 20/71] target/arm: Add ID_AA64SMFR0_EL1, Richard Henderson, 2022/06/02