[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 095/117] target/arm: Expand frint_fns for MO_8
From: |
Peter Maydell |
Subject: |
[PULL 095/117] target/arm: Expand frint_fns for MO_8 |
Date: |
Mon, 30 May 2022 17:06:46 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Simplify indexing of this array. This will allow folding
of the illegal esz == 0 into the normal fn == NULL check.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220527181907.189259-93-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 | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 2f7651249ad..99e5d896457 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -4167,7 +4167,8 @@ static bool trans_FCVTZU_dd(DisasContext *s, arg_rpr_esz
*a)
return do_zpz_ptr(s, a->rd, a->rn, a->pg, false, gen_helper_sve_fcvtzu_dd);
}
-static gen_helper_gvec_3_ptr * const frint_fns[3] = {
+static gen_helper_gvec_3_ptr * const frint_fns[] = {
+ NULL,
gen_helper_sve_frint_h,
gen_helper_sve_frint_s,
gen_helper_sve_frint_d
@@ -4179,7 +4180,7 @@ static bool trans_FRINTI(DisasContext *s, arg_rpr_esz *a)
return false;
}
return do_zpz_ptr(s, a->rd, a->rn, a->pg, a->esz == MO_16,
- frint_fns[a->esz - 1]);
+ frint_fns[a->esz]);
}
static bool trans_FRINTX(DisasContext *s, arg_rpr_esz *a)
@@ -4222,7 +4223,7 @@ static bool trans_FRINTN(DisasContext *s, arg_rpr_esz *a)
if (a->esz == 0) {
return false;
}
- return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz -
1]);
+ return do_frint_mode(s, a, float_round_nearest_even, frint_fns[a->esz]);
}
static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a)
@@ -4230,7 +4231,7 @@ static bool trans_FRINTP(DisasContext *s, arg_rpr_esz *a)
if (a->esz == 0) {
return false;
}
- return do_frint_mode(s, a, float_round_up, frint_fns[a->esz - 1]);
+ return do_frint_mode(s, a, float_round_up, frint_fns[a->esz]);
}
static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a)
@@ -4238,7 +4239,7 @@ static bool trans_FRINTM(DisasContext *s, arg_rpr_esz *a)
if (a->esz == 0) {
return false;
}
- return do_frint_mode(s, a, float_round_down, frint_fns[a->esz - 1]);
+ return do_frint_mode(s, a, float_round_down, frint_fns[a->esz]);
}
static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a)
@@ -4246,7 +4247,7 @@ static bool trans_FRINTZ(DisasContext *s, arg_rpr_esz *a)
if (a->esz == 0) {
return false;
}
- return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz - 1]);
+ return do_frint_mode(s, a, float_round_to_zero, frint_fns[a->esz]);
}
static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a)
@@ -4254,7 +4255,7 @@ static bool trans_FRINTA(DisasContext *s, arg_rpr_esz *a)
if (a->esz == 0) {
return false;
}
- return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz - 1]);
+ return do_frint_mode(s, a, float_round_ties_away, frint_fns[a->esz]);
}
static bool trans_FRECPX(DisasContext *s, arg_rpr_esz *a)
--
2.25.1
- [PULL 058/117] target/arm: Use TRANS_FEAT for do_perm_pred3, (continued)
- [PULL 058/117] target/arm: Use TRANS_FEAT for do_perm_pred3, Peter Maydell, 2022/05/30
- [PULL 090/117] target/arm: Use TRANS_FEAT for FMUL_zzx, Peter Maydell, 2022/05/30
- [PULL 046/117] target/arm: Use TRANS_FEAT for do_vpz_ool, Peter Maydell, 2022/05/30
- [PULL 052/117] target/arm: Use TRANS_FEAT for do_index, Peter Maydell, 2022/05/30
- [PULL 060/117] target/arm: Move sve zip high_ofs into simd_data, Peter Maydell, 2022/05/30
- [PULL 061/117] target/arm: Use gen_gvec_ool_arg_zzz for do_zip, do_zip_q, Peter Maydell, 2022/05/30
- [PULL 070/117] target/arm: Use TRANS_FEAT for do_sve2_ppzz_flags, Peter Maydell, 2022/05/30
- [PULL 073/117] target/arm: Use TRANS_FEAT for MUL_zzi, Peter Maydell, 2022/05/30
- [PULL 074/117] target/arm: Reject dup_i w/ shifted byte early, Peter Maydell, 2022/05/30
- [PULL 094/117] target/arm: Use TRANS_FEAT for FRECPE, FRSQRTE, Peter Maydell, 2022/05/30
- [PULL 095/117] target/arm: Expand frint_fns for MO_8,
Peter Maydell <=
- [PULL 096/117] target/arm: Rename do_zpz_ptr to gen_gvec_ool_fpst_arg_zpz, Peter Maydell, 2022/05/30
- [PULL 082/117] target/arm: Move sve check into gen_gvec_fn_ppp, Peter Maydell, 2022/05/30
- [PULL 084/117] target/arm: Use TRANS_FEAT for SEL_zpzz, Peter Maydell, 2022/05/30
- [PULL 086/117] target/arm: Use TRANS_FEAT for FMLA, Peter Maydell, 2022/05/30
- [PULL 092/117] target/arm: Move null function and sve check into do_reduce, Peter Maydell, 2022/05/30
- [PULL 064/117] target/arm: Use TRANS_FEAT for do_clast_fp, Peter Maydell, 2022/05/30
- [PULL 075/117] target/arm: Reject add/sub w/ shifted byte early, Peter Maydell, 2022/05/30
- [PULL 080/117] target/arm: Introduce gen_gvec_{ptr,fpst}_zzzz, Peter Maydell, 2022/05/30
- [PULL 027/117] target/arm: Use TRANS_FEAT for gen_gvec_ool_arg_zpzi, Peter Maydell, 2022/05/30
- [PULL 079/117] target/arm: Use TRANS_FEAT for do_zzi_ool, Peter Maydell, 2022/05/30