[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 103/114] target/arm: Move null function and sve check into do_fp_
From: |
Richard Henderson |
Subject: |
[PATCH 103/114] target/arm: Move null function and sve check into do_fp_imm |
Date: |
Fri, 27 May 2022 11:18:56 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/translate-sve.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 75854a7c6c..b47d5d7f21 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -3911,33 +3911,34 @@ static void do_fp_scalar(DisasContext *s, int zd, int
zn, int pg, bool is_fp16,
tcg_temp_free_ptr(t_zd);
}
-static void do_fp_imm(DisasContext *s, arg_rpri_esz *a, uint64_t imm,
+static bool do_fp_imm(DisasContext *s, arg_rpri_esz *a, uint64_t imm,
gen_helper_sve_fp2scalar *fn)
{
- do_fp_scalar(s, a->rd, a->rn, a->pg, a->esz == MO_16,
- tcg_constant_i64(imm), fn);
+ if (fn == NULL) {
+ return false;
+ }
+ if (sve_access_check(s)) {
+ do_fp_scalar(s, a->rd, a->rn, a->pg, a->esz == MO_16,
+ tcg_constant_i64(imm), fn);
+ }
+ return true;
}
#define DO_FP_IMM(NAME, name, const0, const1) \
static bool trans_##NAME##_zpzi(DisasContext *s, arg_rpri_esz *a) \
{ \
- static gen_helper_sve_fp2scalar * const fns[3] = { \
- gen_helper_sve_##name##_h, \
+ static gen_helper_sve_fp2scalar * const fns[4] = { \
+ NULL, gen_helper_sve_##name##_h, \
gen_helper_sve_##name##_s, \
gen_helper_sve_##name##_d \
}; \
- static uint64_t const val[3][2] = { \
+ static uint64_t const val[4][2] = { \
+ { -1, -1 }, \
{ float16_##const0, float16_##const1 }, \
{ float32_##const0, float32_##const1 }, \
{ float64_##const0, float64_##const1 }, \
}; \
- if (a->esz == 0) { \
- return false; \
- } \
- if (sve_access_check(s)) { \
- do_fp_imm(s, a, val[a->esz - 1][a->imm], fns[a->esz - 1]); \
- } \
- return true; \
+ return do_fp_imm(s, a, val[a->esz][a->imm], fns[a->esz]); \
}
DO_FP_IMM(FADD, fadds, half, one)
--
2.34.1
- [PATCH 089/114] target/arm: Move null function and sve check into do_reduce, (continued)
- [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
- [PATCH 095/114] target/arm: Use TRANS_FEAT for do_frint_mode, Richard Henderson, 2022/05/27
- [PATCH 094/114] target/arm: Move null function and sve check into do_frint_mode, Richard Henderson, 2022/05/27
- [PATCH 101/114] target/arm: Introduce gen_gvec_fpst_zzzzp, Richard Henderson, 2022/05/27
- [PATCH 102/114] target/arm: Use TRANS_FEAT for gen_gvec_fpst_zzzzp, Richard Henderson, 2022/05/27
- [PATCH 096/114] target/arm: Use TRANS_FEAT for FLOGB, Richard Henderson, 2022/05/27
- [PATCH 108/114] target/arm: Use TRANS_FEAT for do_narrow_extract, Richard Henderson, 2022/05/27
- [PATCH 104/114] target/arm: Use TRANS_FEAT for DO_FP_IMM, Richard Henderson, 2022/05/27
- [PATCH 106/114] target/arm: Remove assert in trans_FCMLA_zzxz, Richard Henderson, 2022/05/27
- [PATCH 103/114] target/arm: Move null function and sve check into do_fp_imm,
Richard Henderson <=
- [PATCH 110/114] target/arm: Use TRANS_FEAT for do_shr_narrow, Richard Henderson, 2022/05/27
- [PATCH 111/114] target/arm: Use TRANS_FEAT for do_FMLAL_zzzw, Richard Henderson, 2022/05/27
- [PATCH 105/114] target/arm: Use TRANS_FEAT for DO_FPCMP, Richard Henderson, 2022/05/27
- [PATCH 109/114] target/arm: Use TRANS_FEAT for do_shll_tb, Richard Henderson, 2022/05/27
- [PATCH 112/114] target/arm: Use TRANS_FEAT for do_FMLAL_zzxw, Richard Henderson, 2022/05/27
- [PATCH 099/114] target/arm: Use TRANS_FEAT for gen_gvec_fpst_arg_zpzz, Richard Henderson, 2022/05/27
- [PATCH 113/114] target/arm: Add sve feature check for remaining trans_* functions, Richard Henderson, 2022/05/27
- [PATCH 114/114] target/arm: Remove aa64_sve check from before disas_sve, Richard Henderson, 2022/05/27
- [PATCH 107/114] target/arm: Use TRANS_FEAT for FCMLA_zzxz, Richard Henderson, 2022/05/27
- Re: [PATCH 000/114] target/arm: Rewrite sve feature tests, Peter Maydell, 2022/05/30