mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
target/arm: Convert VCMLA (scalar) to decodetree
Convert VCMLA (scalar) in the 2reg-scalar-ext group to decodetree. Backports commit 7e1b5d615361bb0038cda0e08af41e350e42d081 from qemu
This commit is contained in:
parent
1ab06d3eb5
commit
73dbfbe4d7
|
@ -49,3 +49,8 @@ VFML 1111 110 0 s:1 . 10 .... .... 1000 . 0 . 1 .... \
|
|||
vm=%vm_sp vn=%vn_sp vd=%vd_dp q=0
|
||||
VFML 1111 110 0 s:1 . 10 .... .... 1000 . 1 . 1 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp q=1
|
||||
|
||||
VCMLA_scalar 1111 1110 0 . rot:2 .... .... 1000 . q:1 index:1 0 vm:4 \
|
||||
vn=%vn_dp vd=%vd_dp size=0
|
||||
VCMLA_scalar 1111 1110 1 . rot:2 .... .... 1000 . q:1 . 0 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp size=1 index=0
|
||||
|
|
|
@ -172,3 +172,43 @@ static bool trans_VFML(DisasContext *s, arg_VFML *a)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool trans_VCMLA_scalar(DisasContext *s, arg_VCMLA_scalar *a)
|
||||
{
|
||||
gen_helper_gvec_3_ptr *fn_gvec_ptr;
|
||||
int opr_sz;
|
||||
TCGv_ptr fpst;
|
||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||
|
||||
if (!dc_isar_feature(aa32_vcma, s)) {
|
||||
return false;
|
||||
}
|
||||
if (a->size == 0 && !dc_isar_feature(aa32_fp16_arith, s)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* UNDEF accesses to D16-D31 if they don't exist. */
|
||||
if (!dc_isar_feature(aa32_simd_r32, s) &&
|
||||
((a->vd | a->vn | a->vm) & 0x10)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((a->vd | a->vn) & a->q) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vfp_access_check(s)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
fn_gvec_ptr = (a->size ? gen_helper_gvec_fcmlas_idx
|
||||
: gen_helper_gvec_fcmlah_idx);
|
||||
opr_sz = (1 + a->q) * 8;
|
||||
fpst = get_fpstatus_ptr(s, 1);
|
||||
tcg_gen_gvec_3_ptr(tcg_ctx, vfp_reg_offset(1, a->vd),
|
||||
vfp_reg_offset(1, a->vn),
|
||||
vfp_reg_offset(1, a->vm),
|
||||
fpst, opr_sz, opr_sz,
|
||||
(a->index << 2) | a->rot, fn_gvec_ptr);
|
||||
tcg_temp_free_ptr(tcg_ctx, fpst);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -7182,31 +7182,7 @@ static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn)
|
|||
bool is_long = false, q = extract32(insn, 6, 1);
|
||||
bool ptr_is_env = false;
|
||||
|
||||
if ((insn & 0xff000f10) == 0xfe000800) {
|
||||
/* VCMLA (indexed) -- 1111 1110 S.RR .... .... 1000 ...0 .... */
|
||||
int rot = extract32(insn, 20, 2);
|
||||
int size = extract32(insn, 23, 1);
|
||||
int index;
|
||||
|
||||
if (!dc_isar_feature(aa32_vcma, s)) {
|
||||
return 1;
|
||||
}
|
||||
if (size == 0) {
|
||||
if (!dc_isar_feature(aa32_fp16_arith, s)) {
|
||||
return 1;
|
||||
}
|
||||
/* For fp16, rm is just Vm, and index is M. */
|
||||
rm = extract32(insn, 0, 4);
|
||||
index = extract32(insn, 5, 1);
|
||||
} else {
|
||||
/* For fp32, rm is the usual M:Vm, and index is 0. */
|
||||
VFP_DREG_M(rm, insn);
|
||||
index = 0;
|
||||
}
|
||||
data = (index << 2) | rot;
|
||||
fn_gvec_ptr = (size ? gen_helper_gvec_fcmlas_idx
|
||||
: gen_helper_gvec_fcmlah_idx);
|
||||
} else if ((insn & 0xffb00f00) == 0xfe200d00) {
|
||||
if ((insn & 0xffb00f00) == 0xfe200d00) {
|
||||
/* V[US]DOT -- 1111 1110 0.10 .... .... 1101 .Q.U .... */
|
||||
int u = extract32(insn, 4, 1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue