[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 097/117] target/arm: Move null function and sve check into do_frin
From: |
Peter Maydell |
Subject: |
[PULL 097/117] target/arm: Move null function and sve check into do_frint_mode |
Date: |
Mon, 30 May 2022 17:06:48 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220527181907.189259-95-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 | 52 +++++++++++++++++---------------------
1 file changed, 23 insertions(+), 29 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 2a5fbec2d6d..43cfd2818ea 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -4140,62 +4140,56 @@ TRANS_FEAT(FRINTX, aa64_sve, gen_gvec_fpst_arg_zpz,
frintx_fns[a->esz],
static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a,
int mode, gen_helper_gvec_3_ptr *fn)
{
- if (sve_access_check(s)) {
- unsigned vsz = vec_full_reg_size(s);
- TCGv_i32 tmode = tcg_const_i32(mode);
- TCGv_ptr status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 :
FPST_FPCR);
+ unsigned vsz;
+ TCGv_i32 tmode;
+ TCGv_ptr status;
- gen_helper_set_rmode(tmode, tmode, status);
-
- tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd),
- vec_full_reg_offset(s, a->rn),
- pred_full_reg_offset(s, a->pg),
- status, vsz, vsz, 0, fn);
-
- gen_helper_set_rmode(tmode, tmode, status);
- tcg_temp_free_i32(tmode);
- tcg_temp_free_ptr(status);
+ if (fn == NULL) {
+ return false;
}
+ if (!sve_access_check(s)) {
+ return true;
+ }
+
+ vsz = vec_full_reg_size(s);
+ tmode = tcg_const_i32(mode);
+ status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR);
+
+ gen_helper_set_rmode(tmode, tmode, status);
+
+ tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd),
+ vec_full_reg_offset(s, a->rn),
+ pred_full_reg_offset(s, a->pg),
+ status, vsz, vsz, 0, fn);
+
+ gen_helper_set_rmode(tmode, tmode, status);
+ tcg_temp_free_i32(tmode);
+ tcg_temp_free_ptr(status);
return true;
}
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]);
}
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]);
}
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]);
}
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]);
}
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]);
}
--
2.25.1
- [PULL 051/117] target/arm: Move sve check into do_index, (continued)
- [PULL 051/117] target/arm: Move sve check into do_index, Peter Maydell, 2022/05/30
- [PULL 066/117] target/arm: Use TRANS_FEAT for do_last_fp, Peter Maydell, 2022/05/30
- [PULL 072/117] target/arm: Use TRANS_FEAT for do_brk2, do_brk3, Peter Maydell, 2022/05/30
- [PULL 071/117] target/arm: Use TRANS_FEAT for do_ppzi_flags, Peter Maydell, 2022/05/30
- [PULL 076/117] target/arm: Reject copy w/ shifted byte early, Peter Maydell, 2022/05/30
- [PULL 081/117] target/arm: Use TRANS_FEAT for FMMLA, Peter Maydell, 2022/05/30
- [PULL 099/117] target/arm: Use TRANS_FEAT for FLOGB, Peter Maydell, 2022/05/30
- [PULL 065/117] target/arm: Use TRANS_FEAT for do_clast_general, Peter Maydell, 2022/05/30
- [PULL 085/117] target/arm: Use TRANS_FEAT for MOVPRFX, Peter Maydell, 2022/05/30
- [PULL 089/117] target/arm: Use TRANS_FEAT for DO_FP3, Peter Maydell, 2022/05/30
- [PULL 097/117] target/arm: Move null function and sve check into do_frint_mode,
Peter Maydell <=
- [PULL 078/117] target/arm: Use TRANS_FEAT for do_zzi_sat, Peter Maydell, 2022/05/30
- [PULL 098/117] target/arm: Use TRANS_FEAT for do_frint_mode, Peter Maydell, 2022/05/30
- Re: [PULL 000/117] target-arm queue, Richard Henderson, 2022/05/30