target/arm: Create gen_gvec_{qrdmla,qrdmls}

Provide a functional interface for the vector expansion.
This fits better with the existing set of helpers that
we provide for other operations.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200513163245.17915-13-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2020-05-13 09:32:41 -07:00 committed by Peter Maydell
parent fe6fb4beb2
commit 146aa66ce5
3 changed files with 34 additions and 59 deletions

View File

@ -587,18 +587,6 @@ static void gen_gvec_op3_ool(DisasContext *s, bool is_q, int rd,
is_q ? 16 : 8, vec_full_reg_size(s), data, fn); is_q ? 16 : 8, vec_full_reg_size(s), data, fn);
} }
/* Expand a 3-operand + env pointer operation using
* an out-of-line helper.
*/
static void gen_gvec_op3_env(DisasContext *s, bool is_q, int rd,
int rn, int rm, gen_helper_gvec_3_ptr *fn)
{
tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd),
vec_full_reg_offset(s, rn),
vec_full_reg_offset(s, rm), cpu_env,
is_q ? 16 : 8, vec_full_reg_size(s), 0, fn);
}
/* Expand a 3-operand + fpstatus pointer + simd data value operation using /* Expand a 3-operand + fpstatus pointer + simd data value operation using
* an out-of-line helper. * an out-of-line helper.
*/ */
@ -11693,29 +11681,11 @@ static void disas_simd_three_reg_same_extra(DisasContext *s, uint32_t insn)
switch (opcode) { switch (opcode) {
case 0x0: /* SQRDMLAH (vector) */ case 0x0: /* SQRDMLAH (vector) */
switch (size) { gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_sqrdmlah_qc, size);
case 1:
gen_gvec_op3_env(s, is_q, rd, rn, rm, gen_helper_gvec_qrdmlah_s16);
break;
case 2:
gen_gvec_op3_env(s, is_q, rd, rn, rm, gen_helper_gvec_qrdmlah_s32);
break;
default:
g_assert_not_reached();
}
return; return;
case 0x1: /* SQRDMLSH (vector) */ case 0x1: /* SQRDMLSH (vector) */
switch (size) { gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_sqrdmlsh_qc, size);
case 1:
gen_gvec_op3_env(s, is_q, rd, rn, rm, gen_helper_gvec_qrdmlsh_s16);
break;
case 2:
gen_gvec_op3_env(s, is_q, rd, rn, rm, gen_helper_gvec_qrdmlsh_s32);
break;
default:
g_assert_not_reached();
}
return; return;
case 0x2: /* SDOT / UDOT */ case 0x2: /* SDOT / UDOT */

View File

@ -3629,20 +3629,26 @@ static const uint8_t neon_2rm_sizes[] = {
[NEON_2RM_VCVT_UF] = 0x4, [NEON_2RM_VCVT_UF] = 0x4,
}; };
void gen_gvec_sqrdmlah_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
/* Expand v8.1 simd helper. */ uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz)
static int do_v81_helper(DisasContext *s, gen_helper_gvec_3_ptr *fn,
int q, int rd, int rn, int rm)
{ {
if (dc_isar_feature(aa32_rdm, s)) { static gen_helper_gvec_3_ptr * const fns[2] = {
int opr_sz = (1 + q) * 8; gen_helper_gvec_qrdmlah_s16, gen_helper_gvec_qrdmlah_s32
tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), };
vfp_reg_offset(1, rn), tcg_debug_assert(vece >= 1 && vece <= 2);
vfp_reg_offset(1, rm), cpu_env, tcg_gen_gvec_3_ptr(rd_ofs, rn_ofs, rm_ofs, cpu_env,
opr_sz, opr_sz, 0, fn); opr_sz, max_sz, 0, fns[vece - 1]);
return 0; }
}
return 1; void gen_gvec_sqrdmlsh_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz)
{
static gen_helper_gvec_3_ptr * const fns[2] = {
gen_helper_gvec_qrdmlsh_s16, gen_helper_gvec_qrdmlsh_s32
};
tcg_debug_assert(vece >= 1 && vece <= 2);
tcg_gen_gvec_3_ptr(rd_ofs, rn_ofs, rm_ofs, cpu_env,
opr_sz, max_sz, 0, fns[vece - 1]);
} }
#define GEN_CMP0(NAME, COND) \ #define GEN_CMP0(NAME, COND) \
@ -5197,13 +5203,10 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
break; /* VPADD */ break; /* VPADD */
} }
/* VQRDMLAH */ /* VQRDMLAH */
switch (size) { if (dc_isar_feature(aa32_rdm, s) && (size == 1 || size == 2)) {
case 1: gen_gvec_sqrdmlah_qc(size, rd_ofs, rn_ofs, rm_ofs,
return do_v81_helper(s, gen_helper_gvec_qrdmlah_s16, vec_size, vec_size);
q, rd, rn, rm); return 0;
case 2:
return do_v81_helper(s, gen_helper_gvec_qrdmlah_s32,
q, rd, rn, rm);
} }
return 1; return 1;
@ -5216,13 +5219,10 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
break; break;
} }
/* VQRDMLSH */ /* VQRDMLSH */
switch (size) { if (dc_isar_feature(aa32_rdm, s) && (size == 1 || size == 2)) {
case 1: gen_gvec_sqrdmlsh_qc(size, rd_ofs, rn_ofs, rm_ofs,
return do_v81_helper(s, gen_helper_gvec_qrdmlsh_s16, vec_size, vec_size);
q, rd, rn, rm); return 0;
case 2:
return do_v81_helper(s, gen_helper_gvec_qrdmlsh_s32,
q, rd, rn, rm);
} }
return 1; return 1;

View File

@ -332,6 +332,11 @@ void gen_gvec_sri(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs,
void gen_gvec_sli(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs, void gen_gvec_sli(unsigned vece, uint32_t rd_ofs, uint32_t rm_ofs,
int64_t shift, uint32_t opr_sz, uint32_t max_sz); int64_t shift, uint32_t opr_sz, uint32_t max_sz);
void gen_gvec_sqrdmlah_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz);
void gen_gvec_sqrdmlsh_qc(unsigned vece, uint32_t rd_ofs, uint32_t rn_ofs,
uint32_t rm_ofs, uint32_t opr_sz, uint32_t max_sz);
/* /*
* Forward to the isar_feature_* tests given a DisasContext pointer. * Forward to the isar_feature_* tests given a DisasContext pointer.
*/ */