[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 025/117] target/arm: Use TRANS_FEAT for do_sve2_zpz_data
From: |
Peter Maydell |
Subject: |
[PULL 025/117] target/arm: Use TRANS_FEAT for do_sve2_zpz_data |
Date: |
Mon, 30 May 2022 17:05:36 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Convert SVE translation functions using do_sve2_zpz_data
to use TRANS_FEAT and gen_gvec_ool_arg_zpz.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220527181907.189259-23-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/translate-sve.c | 53 ++++++++++----------------------------
1 file changed, 14 insertions(+), 39 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index d5a09a60af4..fe11cfed6bb 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -6554,48 +6554,23 @@ static bool trans_UADALP_zpzz(DisasContext *s,
arg_rprr_esz *a)
* SVE2 integer unary operations (predicated)
*/
-static bool do_sve2_zpz_ool(DisasContext *s, arg_rpr_esz *a,
- gen_helper_gvec_3 *fn)
-{
- if (!dc_isar_feature(aa64_sve2, s)) {
- return false;
- }
- return gen_gvec_ool_arg_zpz(s, fn, a, 0);
-}
+TRANS_FEAT(URECPE, aa64_sve2, gen_gvec_ool_arg_zpz,
+ a->esz == 2 ? gen_helper_sve2_urecpe_s : NULL, a, 0)
-static bool trans_URECPE(DisasContext *s, arg_rpr_esz *a)
-{
- if (a->esz != 2) {
- return false;
- }
- return do_sve2_zpz_ool(s, a, gen_helper_sve2_urecpe_s);
-}
+TRANS_FEAT(URSQRTE, aa64_sve2, gen_gvec_ool_arg_zpz,
+ a->esz == 2 ? gen_helper_sve2_ursqrte_s : NULL, a, 0)
-static bool trans_URSQRTE(DisasContext *s, arg_rpr_esz *a)
-{
- if (a->esz != 2) {
- return false;
- }
- return do_sve2_zpz_ool(s, a, gen_helper_sve2_ursqrte_s);
-}
+static gen_helper_gvec_3 * const sqabs_fns[4] = {
+ gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h,
+ gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d,
+};
+TRANS_FEAT(SQABS, aa64_sve2, gen_gvec_ool_arg_zpz, sqabs_fns[a->esz], a, 0)
-static bool trans_SQABS(DisasContext *s, arg_rpr_esz *a)
-{
- static gen_helper_gvec_3 * const fns[4] = {
- gen_helper_sve2_sqabs_b, gen_helper_sve2_sqabs_h,
- gen_helper_sve2_sqabs_s, gen_helper_sve2_sqabs_d,
- };
- return do_sve2_zpz_ool(s, a, fns[a->esz]);
-}
-
-static bool trans_SQNEG(DisasContext *s, arg_rpr_esz *a)
-{
- static gen_helper_gvec_3 * const fns[4] = {
- gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h,
- gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d,
- };
- return do_sve2_zpz_ool(s, a, fns[a->esz]);
-}
+static gen_helper_gvec_3 * const sqneg_fns[4] = {
+ gen_helper_sve2_sqneg_b, gen_helper_sve2_sqneg_h,
+ gen_helper_sve2_sqneg_s, gen_helper_sve2_sqneg_d,
+};
+TRANS_FEAT(SQNEG, aa64_sve2, gen_gvec_ool_arg_zpz, sqneg_fns[a->esz], a, 0)
#define DO_SVE2_ZPZZ(NAME, name) \
static bool trans_##NAME(DisasContext *s, arg_rprr_esz *a) \
--
2.25.1
- [PULL 023/117] target/arm: Introduce gen_gvec_ool_arg_zpz, (continued)
- [PULL 023/117] target/arm: Introduce gen_gvec_ool_arg_zpz, Peter Maydell, 2022/05/30
- [PULL 008/117] target/arm: Introduce gen_gvec_ool_arg_zzz, Peter Maydell, 2022/05/30
- [PULL 014/117] target/arm: Use TRANS_FEAT for do_sve2_zzzz_ool, Peter Maydell, 2022/05/30
- [PULL 016/117] target/arm: Rename do_zzxz_ool to gen_gvec_ool_arg_zzxz, Peter Maydell, 2022/05/30
- [PULL 017/117] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zzxz, Peter Maydell, 2022/05/30
- [PULL 018/117] target/arm: Use TRANS_FEAT for do_sve2_zzz_data, Peter Maydell, 2022/05/30
- [PULL 004/117] target/arm: Introduce TRANS, TRANS_FEAT, Peter Maydell, 2022/05/30
- [PULL 021/117] target/arm: Use TRANS_FEAT for USDOT_zzzz, Peter Maydell, 2022/05/30
- [PULL 022/117] target/arm: Move null function and sve check into gen_gvec_ool_zzp, Peter Maydell, 2022/05/30
- [PULL 020/117] target/arm: Use TRANS_FEAT for do_sve2_zzw_data, Peter Maydell, 2022/05/30
- [PULL 025/117] target/arm: Use TRANS_FEAT for do_sve2_zpz_data,
Peter Maydell <=
- [PULL 030/117] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpzz, Peter Maydell, 2022/05/30
- [PULL 029/117] target/arm: Introduce gen_gvec_ool_arg_zpzz, Peter Maydell, 2022/05/30
- [PULL 024/117] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpz, Peter Maydell, 2022/05/30
- [PULL 034/117] target/arm: Rename do_zzz_fn to gen_gvec_fn_arg_zzz, Peter Maydell, 2022/05/30
- [PULL 039/117] target/arm: Introduce gen_gvec_fn_arg_zzzz, Peter Maydell, 2022/05/30
- [PULL 026/117] target/arm: Rename do_zpzi_ool to gen_gvec_ool_arg_zpzi, Peter Maydell, 2022/05/30
- [PULL 031/117] target/arm: Use TRANS_FEAT for do_sve2_zpzz_ool, Peter Maydell, 2022/05/30
- [PULL 033/117] target/arm: Move null function and sve check into gen_gvec_fn_zzz, Peter Maydell, 2022/05/30
- [PULL 032/117] target/arm: Merge gen_gvec_fn_zz into do_mov_z, Peter Maydell, 2022/05/30
- [PULL 035/117] target/arm: More use of gen_gvec_fn_arg_zzz, Peter Maydell, 2022/05/30