aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-05-27 11:18:32 -0700
committerPeter Maydell <peter.maydell@linaro.org>2022-05-30 17:05:09 +0100
commit23e5fa5f90a6073f270ec89418085e4cb341a4ea (patch)
tree7363e7c7a0ce028a96c025f075b7877971a5482e /target
parent25aee7cc3bd0c9a1b273ec2ead99ddde42f5c04a (diff)
downloadqemu-23e5fa5f90a6073f270ec89418085e4cb341a4ea.zip
qemu-23e5fa5f90a6073f270ec89418085e4cb341a4ea.tar.gz
qemu-23e5fa5f90a6073f270ec89418085e4cb341a4ea.tar.bz2
target/arm: Move sve check into gen_gvec_fn_ppp
Combined with the check already present in gen_mov_p, we can simplify some special cases in trans_AND_pppp and trans_BIC_pppp. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220527181907.189259-80-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/arm/translate-sve.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c
index 364e419..f33bc9d 100644
--- a/target/arm/translate-sve.c
+++ b/target/arm/translate-sve.c
@@ -370,13 +370,16 @@ static void do_dupi_z(DisasContext *s, int rd, uint64_t word)
}
/* Invoke a vector expander on three Pregs. */
-static void gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn,
+static bool gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn,
int rd, int rn, int rm)
{
- unsigned psz = pred_gvec_reg_size(s);
- gvec_fn(MO_64, pred_full_reg_offset(s, rd),
- pred_full_reg_offset(s, rn),
- pred_full_reg_offset(s, rm), psz, psz);
+ if (sve_access_check(s)) {
+ unsigned psz = pred_gvec_reg_size(s);
+ gvec_fn(MO_64, pred_full_reg_offset(s, rd),
+ pred_full_reg_offset(s, rn),
+ pred_full_reg_offset(s, rm), psz, psz);
+ }
+ return true;
}
/* Invoke a vector move on two Pregs. */
@@ -1317,19 +1320,13 @@ static bool trans_AND_pppp(DisasContext *s, arg_rprr_s *a)
};
if (!a->s) {
- if (!sve_access_check(s)) {
- return true;
- }
if (a->rn == a->rm) {
if (a->pg == a->rn) {
- do_mov_p(s, a->rd, a->rn);
- } else {
- gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->pg);
+ return do_mov_p(s, a->rd, a->rn);
}
- return true;
+ return gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->pg);
} else if (a->pg == a->rn || a->pg == a->rm) {
- gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->rm);
- return true;
+ return gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->rm);
}
}
return do_pppp_flags(s, a, &op);
@@ -1358,10 +1355,7 @@ static bool trans_BIC_pppp(DisasContext *s, arg_rprr_s *a)
};
if (!a->s && a->pg == a->rn) {
- if (sve_access_check(s)) {
- gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm);
- }
- return true;
+ return gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm);
}
return do_pppp_flags(s, a, &op);
}