[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 059/114] target/arm: Use TRANS_FEAT for do_zip, do_zip_q
From: |
Richard Henderson |
Subject: |
[PATCH 059/114] target/arm: Use TRANS_FEAT for do_zip, do_zip_q |
Date: |
Fri, 27 May 2022 11:18:12 -0700 |
Convert SVE translation functions using do_zip*
to use TRANS_FEAT and gen_gvec_ool_arg_zzz.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sve.c | 54 +++++++++-----------------------------
1 file changed, 13 insertions(+), 41 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 75c52d8ce1..7c9deb267f 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -2287,48 +2287,20 @@ TRANS_FEAT(PUNPKHI, aa64_sve, do_perm_pred2, a, 1,
gen_helper_sve_punpk_p)
*** SVE Permute - Interleaving Group
*/
-static bool do_zip(DisasContext *s, arg_rrr_esz *a, bool high)
-{
- static gen_helper_gvec_3 * const fns[4] = {
- gen_helper_sve_zip_b, gen_helper_sve_zip_h,
- gen_helper_sve_zip_s, gen_helper_sve_zip_d,
- };
- unsigned vsz = vec_full_reg_size(s);
- unsigned high_ofs = high ? vsz / 2 : 0;
+static gen_helper_gvec_3 * const zip_fns[4] = {
+ gen_helper_sve_zip_b, gen_helper_sve_zip_h,
+ gen_helper_sve_zip_s, gen_helper_sve_zip_d,
+};
+TRANS_FEAT(ZIP1_z, aa64_sve, gen_gvec_ool_arg_zzz,
+ zip_fns[a->esz], a, 0)
+TRANS_FEAT(ZIP2_z, aa64_sve, gen_gvec_ool_arg_zzz,
+ zip_fns[a->esz], a, vec_full_reg_size(s) / 2)
- return gen_gvec_ool_arg_zzz(s, fns[a->esz], a, high_ofs);
-}
-
-static bool trans_ZIP1_z(DisasContext *s, arg_rrr_esz *a)
-{
- return do_zip(s, a, false);
-}
-
-static bool trans_ZIP2_z(DisasContext *s, arg_rrr_esz *a)
-{
- return do_zip(s, a, true);
-}
-
-static bool do_zip_q(DisasContext *s, arg_rrr_esz *a, bool high)
-{
- unsigned vsz = vec_full_reg_size(s);
- unsigned high_ofs = high ? QEMU_ALIGN_DOWN(vsz, 32) / 2 : 0;
-
- if (!dc_isar_feature(aa64_sve_f64mm, s)) {
- return false;
- }
- return gen_gvec_ool_arg_zzz(s, gen_helper_sve2_zip_q, a, high_ofs);
-}
-
-static bool trans_ZIP1_q(DisasContext *s, arg_rrr_esz *a)
-{
- return do_zip_q(s, a, false);
-}
-
-static bool trans_ZIP2_q(DisasContext *s, arg_rrr_esz *a)
-{
- return do_zip_q(s, a, true);
-}
+TRANS_FEAT(ZIP1_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
+ gen_helper_sve2_zip_q, a, 0)
+TRANS_FEAT(ZIP2_q, aa64_sve_f64mm, gen_gvec_ool_arg_zzz,
+ gen_helper_sve2_zip_q, a,
+ QEMU_ALIGN_DOWN(vec_full_reg_size(s), 32) / 2)
static gen_helper_gvec_3 * const uzp_fns[4] = {
gen_helper_sve_uzp_b, gen_helper_sve_uzp_h,
--
2.34.1
- [PATCH 047/114] target/arm: Use TRANS_FEAT for do_zpzzz_ool, (continued)
- [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
- [PATCH 068/114] target/arm: Use TRANS_FEAT for do_ppzi_flags, Richard Henderson, 2022/05/27
- [PATCH 072/114] target/arm: Reject add/sub w/ shifted byte early, Richard Henderson, 2022/05/27
- [PATCH 077/114] target/arm: Introduce gen_gvec_{ptr,fpst}_zzzz, Richard Henderson, 2022/05/27
- [PATCH 059/114] target/arm: Use TRANS_FEAT for do_zip, do_zip_q,
Richard Henderson <=
- [PATCH 074/114] target/arm: Use TRANS_FEAT for ADD_zzi, Richard Henderson, 2022/05/27
- [PATCH 067/114] target/arm: Use TRANS_FEAT for do_sve2_ppzz_flags, Richard Henderson, 2022/05/27
- [PATCH 076/114] target/arm: Use TRANS_FEAT for do_zzi_ool, Richard Henderson, 2022/05/27
- [PATCH 075/114] target/arm: Use TRANS_FEAT for do_zzi_sat, Richard Henderson, 2022/05/27
- [PATCH 056/114] target/arm: Use TRANS_FEAT for do_perm_pred2, Richard Henderson, 2022/05/27
- [PATCH 063/114] target/arm: Use TRANS_FEAT for do_last_fp, Richard Henderson, 2022/05/27
- [PATCH 062/114] target/arm: Use TRANS_FEAT for do_clast_general, Richard Henderson, 2022/05/27
- [PATCH 060/114] target/arm: Use TRANS_FEAT for do_clast_vector, Richard Henderson, 2022/05/27
- [PATCH 058/114] target/arm: Use gen_gvec_ool_arg_zzz for do_zip, do_zip_q, Richard Henderson, 2022/05/27
- [PATCH 066/114] target/arm: Use TRANS_FEAT for do_ppzz_flags, Richard Henderson, 2022/05/27