target/arm: Split out gen_gvec_ool_zzzp

Model after gen_gvec_fn_zzz et al.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20200815013145.539409-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2020-08-28 10:02:48 +01:00 committed by Peter Maydell
parent d4bc623254
commit 36cbb7a8e7

View File

@ -142,8 +142,19 @@ static int pred_gvec_reg_size(DisasContext *s)
return size_for_gvec(pred_full_reg_size(s)); return size_for_gvec(pred_full_reg_size(s));
} }
/* Invoke a vector expander on two Zregs. */ /* Invoke an out-of-line helper on 3 Zregs and a predicate. */
static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn,
int rd, int rn, int rm, int pg, int data)
{
unsigned vsz = vec_full_reg_size(s);
tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd),
vec_full_reg_offset(s, rn),
vec_full_reg_offset(s, rm),
pred_full_reg_offset(s, pg),
vsz, vsz, data, fn);
}
/* Invoke a vector expander on two Zregs. */
static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn,
int esz, int rd, int rn) int esz, int rd, int rn)
{ {
@ -314,16 +325,11 @@ static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a)
static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn)
{ {
unsigned vsz = vec_full_reg_size(s);
if (fn == NULL) { if (fn == NULL) {
return false; return false;
} }
if (sve_access_check(s)) { if (sve_access_check(s)) {
tcg_gen_gvec_4_ool(vec_full_reg_offset(s, a->rd), gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, 0);
vec_full_reg_offset(s, a->rn),
vec_full_reg_offset(s, a->rm),
pred_full_reg_offset(s, a->pg),
vsz, vsz, 0, fn);
} }
return true; return true;
} }
@ -337,12 +343,7 @@ static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz)
gen_helper_sve_sel_zpzz_b, gen_helper_sve_sel_zpzz_h, gen_helper_sve_sel_zpzz_b, gen_helper_sve_sel_zpzz_h,
gen_helper_sve_sel_zpzz_s, gen_helper_sve_sel_zpzz_d gen_helper_sve_sel_zpzz_s, gen_helper_sve_sel_zpzz_d
}; };
unsigned vsz = vec_full_reg_size(s); gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0);
tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd),
vec_full_reg_offset(s, rn),
vec_full_reg_offset(s, rm),
pred_full_reg_offset(s, pg),
vsz, vsz, 0, fns[esz]);
} }
#define DO_ZPZZ(NAME, name) \ #define DO_ZPZZ(NAME, name) \
@ -2704,12 +2705,8 @@ static bool trans_RBIT(DisasContext *s, arg_rpr_esz *a)
static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a)
{ {
if (sve_access_check(s)) { if (sve_access_check(s)) {
unsigned vsz = vec_full_reg_size(s); gen_gvec_ool_zzzp(s, gen_helper_sve_splice,
tcg_gen_gvec_4_ool(vec_full_reg_offset(s, a->rd), a->rd, a->rn, a->rm, a->pg, 0);
vec_full_reg_offset(s, a->rn),
vec_full_reg_offset(s, a->rm),
pred_full_reg_offset(s, a->pg),
vsz, vsz, a->esz, gen_helper_sve_splice);
} }
return true; return true;
} }