[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 092/114] target/arm: Expand frint_fns for MO_8
From: |
Richard Henderson |
Subject: |
[PATCH 092/114] target/arm: Expand frint_fns for MO_8 |
Date: |
Fri, 27 May 2022 11:18:45 -0700 |
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>
---
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 2f7651249a..99e5d89645 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.34.1
- [PATCH 070/114] target/arm: Use TRANS_FEAT for MUL_zzi, (continued)
- [PATCH 070/114] target/arm: Use TRANS_FEAT for MUL_zzi, Richard Henderson, 2022/05/27
- [PATCH 071/114] target/arm: Reject dup_i w/ shifted byte early, Richard Henderson, 2022/05/27
- [PATCH 079/114] target/arm: Move sve check into gen_gvec_fn_ppp, Richard Henderson, 2022/05/27
- [PATCH 073/114] target/arm: Reject copy w/ shifted byte early, Richard Henderson, 2022/05/27
- [PATCH 083/114] target/arm: Use TRANS_FEAT for FMLA, Richard Henderson, 2022/05/27
- [PATCH 080/114] target/arm: Implement NOT (prediates) alias, Richard Henderson, 2022/05/27
- [PATCH 085/114] target/arm: Rename do_zzz_fp to gen_gvec_ool_fpst_arg_zzz, Richard Henderson, 2022/05/27
- [PATCH 081/114] target/arm: Use TRANS_FEAT for SEL_zpzz, Richard Henderson, 2022/05/27
- [PATCH 082/114] target/arm: Use TRANS_FEAT for MOVPRFX, Richard Henderson, 2022/05/27
- [PATCH 090/114] target/arm: Use TRANS_FEAT for do_reduce, Richard Henderson, 2022/05/27
- [PATCH 092/114] target/arm: Expand frint_fns for MO_8,
Richard Henderson <=
- [PATCH 086/114] target/arm: Use TRANS_FEAT for DO_FP3, Richard Henderson, 2022/05/27
- [PATCH 088/114] target/arm: Use TRANS_FEAT for FTMAD, Richard Henderson, 2022/05/27
- [PATCH 091/114] target/arm: Use TRANS_FEAT for FRECPE, FRSQRTE, Richard Henderson, 2022/05/27
- [PATCH 084/114] target/arm: Use TRANS_FEAT for BFMLA, Richard Henderson, 2022/05/27
- [PATCH 093/114] target/arm: Rename do_zpz_ptr to gen_gvec_ool_fpst_arg_zpz, Richard Henderson, 2022/05/27
- [PATCH 097/114] target/arm: Use TRANS_FEAT for do_ppz_fp, Richard Henderson, 2022/05/27
- [PATCH 087/114] target/arm: Use TRANS_FEAT for FMUL_zzx, Richard Henderson, 2022/05/27
- [PATCH 100/114] target/arm: Use TRANS_FEAT for FCADD, Richard Henderson, 2022/05/27
- [PATCH 089/114] target/arm: Move null function and sve check into do_reduce, Richard Henderson, 2022/05/27
- [PATCH 098/114] target/arm: Rename do_zpzz_ptr to gen_gvec_fpst_arg_zpzz, Richard Henderson, 2022/05/27