mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
target/arm: Implement MVE VAND, VBIC, VORR, VORN, VEOR
Implement the MVE vector logical operations operating on two registers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210617121628.20116-12-peter.maydell@linaro.org
This commit is contained in:
parent
ab59362fca
commit
68245e442c
4 changed files with 78 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
typedef void MVEGenLdStFn(TCGv_ptr, TCGv_ptr, TCGv_i32);
|
||||
typedef void MVEGenOneOpFn(TCGv_ptr, TCGv_ptr, TCGv_ptr);
|
||||
typedef void MVEGenTwoOpFn(TCGv_ptr, TCGv_ptr, TCGv_ptr, TCGv_ptr);
|
||||
|
||||
/* Return the offset of a Qn register (same semantics as aa32_vfp_qreg()) */
|
||||
static inline long mve_qreg_offset(unsigned reg)
|
||||
|
@ -294,3 +295,39 @@ static bool trans_VNEG_fp(DisasContext *s, arg_1op *a)
|
|||
}
|
||||
return do_1op(s, a, fns[a->size]);
|
||||
}
|
||||
|
||||
static bool do_2op(DisasContext *s, arg_2op *a, MVEGenTwoOpFn fn)
|
||||
{
|
||||
TCGv_ptr qd, qn, qm;
|
||||
|
||||
if (!dc_isar_feature(aa32_mve, s) ||
|
||||
!mve_check_qreg_bank(s, a->qd | a->qn | a->qm) ||
|
||||
!fn) {
|
||||
return false;
|
||||
}
|
||||
if (!mve_eci_check(s) || !vfp_access_check(s)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
qd = mve_qreg_ptr(a->qd);
|
||||
qn = mve_qreg_ptr(a->qn);
|
||||
qm = mve_qreg_ptr(a->qm);
|
||||
fn(cpu_env, qd, qn, qm);
|
||||
tcg_temp_free_ptr(qd);
|
||||
tcg_temp_free_ptr(qn);
|
||||
tcg_temp_free_ptr(qm);
|
||||
mve_update_eci(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
#define DO_LOGIC(INSN, HELPER) \
|
||||
static bool trans_##INSN(DisasContext *s, arg_2op *a) \
|
||||
{ \
|
||||
return do_2op(s, a, HELPER); \
|
||||
}
|
||||
|
||||
DO_LOGIC(VAND, gen_helper_mve_vand)
|
||||
DO_LOGIC(VBIC, gen_helper_mve_vbic)
|
||||
DO_LOGIC(VORR, gen_helper_mve_vorr)
|
||||
DO_LOGIC(VORN, gen_helper_mve_vorn)
|
||||
DO_LOGIC(VEOR, gen_helper_mve_veor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue