[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 041/114] target/arm: Introduce gen_gvec_fn_arg_zzi
From: |
Richard Henderson |
Subject: |
[PATCH 041/114] target/arm: Introduce gen_gvec_fn_arg_zzi |
Date: |
Fri, 27 May 2022 11:17:54 -0700 |
We have two places that perform this particular operation.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sve.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 62bfc6fe7c..7a3b5f137a 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -273,6 +273,16 @@ static bool gen_gvec_fn_zzi(DisasContext *s, GVecGen2iFn
*gvec_fn,
return true;
}
+static bool gen_gvec_fn_arg_zzi(DisasContext *s, GVecGen2iFn *gvec_fn,
+ arg_rri_esz *a)
+{
+ if (a->esz < 0) {
+ /* Invalid tsz encoding -- see tszimm_esz. */
+ return false;
+ }
+ return gen_gvec_fn_zzi(s, gvec_fn, a->esz, a->rd, a->rn, a->imm);
+}
+
/* Invoke a vector expander on three Zregs. */
static bool gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn,
int esz, int rd, int rn, int rm)
@@ -3503,12 +3513,7 @@ static bool trans_ADD_zzi(DisasContext *s, arg_rri_esz
*a)
if (a->esz == 0 && extract32(s->insn, 13, 1)) {
return false;
}
- if (sve_access_check(s)) {
- unsigned vsz = vec_full_reg_size(s);
- tcg_gen_gvec_addi(a->esz, vec_full_reg_offset(s, a->rd),
- vec_full_reg_offset(s, a->rn), a->imm, vsz, vsz);
- }
- return true;
+ return gen_gvec_fn_arg_zzi(s, tcg_gen_gvec_addi, a);
}
static bool trans_SUB_zzi(DisasContext *s, arg_rri_esz *a)
@@ -6825,10 +6830,10 @@ TRANS_FEAT(ADCLT, aa64_sve2, do_adcl, a, true)
static bool do_sve2_fn2i(DisasContext *s, arg_rri_esz *a, GVecGen2iFn *fn)
{
- if (a->esz < 0 || !dc_isar_feature(aa64_sve2, s)) {
+ if (!dc_isar_feature(aa64_sve2, s)) {
return false;
}
- return gen_gvec_fn_zzi(s, fn, a->esz, a->rd, a->rn, a->imm);
+ return gen_gvec_fn_arg_zzi(s, fn, a);
}
static bool trans_SSRA(DisasContext *s, arg_rri_esz *a)
--
2.34.1
- [PATCH 034/114] target/arm: Use TRANS_FEAT for do_sve2_fn_zzz, (continued)
- [PATCH 034/114] target/arm: Use TRANS_FEAT for do_sve2_fn_zzz, Richard Henderson, 2022/05/27
- [PATCH 035/114] target/arm: Use TRANS_FEAT for RAX1, Richard Henderson, 2022/05/27
- [PATCH 032/114] target/arm: More use of gen_gvec_fn_arg_zzz, Richard Henderson, 2022/05/27
- [PATCH 033/114] target/arm: Use TRANS_FEAT for gen_gvec_fn_arg_zzz, Richard Henderson, 2022/05/27
- [PATCH 036/114] target/arm: Introduce gen_gvec_fn_arg_zzzz, Richard Henderson, 2022/05/27
- [PATCH 038/114] target/arm: Introduce gen_gvec_fn_zzi, Richard Henderson, 2022/05/27
- [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 <=
- [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, 2022/05/27
- [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