[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 048/114] target/arm: Move sve check into do_index
From: |
Richard Henderson |
Subject: |
[PATCH 048/114] target/arm: Move sve check into do_index |
Date: |
Fri, 27 May 2022 11:18:01 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sve.c | 53 ++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 28 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 52bbd1a4fa..44c2342923 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -1087,12 +1087,20 @@ TRANS_FEAT(MLS, aa64_sve, do_zpzzz_ool, a,
mls_fns[a->esz])
*** SVE Index Generation Group
*/
-static void do_index(DisasContext *s, int esz, int rd,
+static bool do_index(DisasContext *s, int esz, int rd,
TCGv_i64 start, TCGv_i64 incr)
{
- unsigned vsz = vec_full_reg_size(s);
- TCGv_i32 desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
- TCGv_ptr t_zd = tcg_temp_new_ptr();
+ unsigned vsz;
+ TCGv_i32 desc;
+ TCGv_ptr t_zd;
+
+ if (!sve_access_check(s)) {
+ return true;
+ }
+
+ vsz = vec_full_reg_size(s);
+ desc = tcg_constant_i32(simd_desc(vsz, vsz, 0));
+ t_zd = tcg_temp_new_ptr();
tcg_gen_addi_ptr(t_zd, cpu_env, vec_full_reg_offset(s, rd));
if (esz == 3) {
@@ -1115,46 +1123,35 @@ static void do_index(DisasContext *s, int esz, int rd,
tcg_temp_free_i32(i32);
}
tcg_temp_free_ptr(t_zd);
+ return true;
}
static bool trans_INDEX_ii(DisasContext *s, arg_INDEX_ii *a)
{
- if (sve_access_check(s)) {
- TCGv_i64 start = tcg_constant_i64(a->imm1);
- TCGv_i64 incr = tcg_constant_i64(a->imm2);
- do_index(s, a->esz, a->rd, start, incr);
- }
- return true;
+ TCGv_i64 start = tcg_constant_i64(a->imm1);
+ TCGv_i64 incr = tcg_constant_i64(a->imm2);
+ return do_index(s, a->esz, a->rd, start, incr);
}
static bool trans_INDEX_ir(DisasContext *s, arg_INDEX_ir *a)
{
- if (sve_access_check(s)) {
- TCGv_i64 start = tcg_constant_i64(a->imm);
- TCGv_i64 incr = cpu_reg(s, a->rm);
- do_index(s, a->esz, a->rd, start, incr);
- }
- return true;
+ TCGv_i64 start = tcg_constant_i64(a->imm);
+ TCGv_i64 incr = cpu_reg(s, a->rm);
+ return do_index(s, a->esz, a->rd, start, incr);
}
static bool trans_INDEX_ri(DisasContext *s, arg_INDEX_ri *a)
{
- if (sve_access_check(s)) {
- TCGv_i64 start = cpu_reg(s, a->rn);
- TCGv_i64 incr = tcg_constant_i64(a->imm);
- do_index(s, a->esz, a->rd, start, incr);
- }
- return true;
+ TCGv_i64 start = cpu_reg(s, a->rn);
+ TCGv_i64 incr = tcg_constant_i64(a->imm);
+ return do_index(s, a->esz, a->rd, start, incr);
}
static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a)
{
- if (sve_access_check(s)) {
- TCGv_i64 start = cpu_reg(s, a->rn);
- TCGv_i64 incr = cpu_reg(s, a->rm);
- do_index(s, a->esz, a->rd, start, incr);
- }
- return true;
+ TCGv_i64 start = cpu_reg(s, a->rn);
+ TCGv_i64 incr = cpu_reg(s, a->rm);
+ return do_index(s, a->esz, a->rd, start, incr);
}
/*
--
2.34.1
- [PATCH 039/114] target/arm: Use TRANS_FEAT for do_zz_dbm, (continued)
- [PATCH 039/114] target/arm: Use TRANS_FEAT for do_zz_dbm, Richard Henderson, 2022/05/27
- [PATCH 037/114] target/arm: Use TRANS_FEAT for do_sve2_zzzz_fn, Richard Henderson, 2022/05/27
- [PATCH 050/114] target/arm: Use TRANS_FEAT for do_adr, Richard Henderson, 2022/05/27
- [PATCH 049/114] target/arm: Use TRANS_FEAT for do_index, Richard Henderson, 2022/05/27
- [PATCH 041/114] target/arm: Introduce gen_gvec_fn_arg_zzi, Richard Henderson, 2022/05/27
- [PATCH 046/114] target/arm: Use TRANS_FEAT for do_shift_zpzi, Richard Henderson, 2022/05/27
- [PATCH 042/114] target/arm: Use TRANS_FEAT for do_sve2_fn2i, Richard Henderson, 2022/05/27
- [PATCH 044/114] target/arm: Use TRANS_FEAT for do_shift_imm, Richard Henderson, 2022/05/27
- [PATCH 043/114] target/arm: Use TRANS_FEAT for do_vpz_ool, Richard Henderson, 2022/05/27
- [PATCH 045/114] target/arm: Introduce do_shift_zpzi, Richard Henderson, 2022/05/27
- [PATCH 048/114] target/arm: Move sve check into do_index,
Richard Henderson <=
- [PATCH 053/114] target/arm: Use TRANS_FEAT for do_pfirst_pnext, Richard Henderson, 2022/05/27
- [PATCH 052/114] target/arm: Use TRANS_FEAT for RDFFR, WRFFR, Richard Henderson, 2022/05/27
- [PATCH 051/114] target/arm: Use TRANS_FEAT for do_predset, Richard Henderson, 2022/05/27
- [PATCH 047/114] target/arm: Use TRANS_FEAT for do_zpzzz_ool, Richard Henderson, 2022/05/27
- [PATCH 054/114] target/arm: Use TRANS_FEAT for do_EXT, Richard Henderson, 2022/05/27
- [PATCH 055/114] target/arm: Use TRANS_FEAT for do_perm_pred3, Richard Henderson, 2022/05/27
- [PATCH 057/114] target/arm: Move sve zip high_ofs into simd_data, Richard Henderson, 2022/05/27
- [PATCH 061/114] target/arm: Use TRANS_FEAT for do_clast_fp, Richard Henderson, 2022/05/27
- [PATCH 040/114] target/arm: Hoist sve access check through do_sel_z, Richard Henderson, 2022/05/27
- [PATCH 064/114] target/arm: Use TRANS_FEAT for do_last_general, Richard Henderson, 2022/05/27