mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-24 13:05:11 +00:00
target/arm: Convert VFM[AS]L (vector) to decodetree
Convert the VFM[AS]L (vector) insns to decodetree. This is the last insn in the legacy decoder for the 3same_ext group, so we can delete the legacy decoder function for the group entirely. Note that in disas_thumb2_insn() the parts of this encoding space where the decodetree decoder returns false will correctly be directed to illegal_op by the "(insn & (1 << 28))" check so they won't fall into disas_coproc_insn() by mistake. Backports commit 9a107e7b8a3c87ab63ec830d3d60f319fc577ff7 from qemu
This commit is contained in:
parent
c06bdf4cc2
commit
1ab06d3eb5
|
@ -43,3 +43,9 @@ VCADD 1111 110 rot:1 1 . 0 size:1 .... .... 1000 . q:1 . 0 .... \
|
||||||
# VUDOT and VSDOT
|
# VUDOT and VSDOT
|
||||||
VDOT 1111 110 00 . 10 .... .... 1101 . q:1 . u:1 .... \
|
VDOT 1111 110 00 . 10 .... .... 1101 . q:1 . u:1 .... \
|
||||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||||
|
|
||||||
|
# VFM[AS]L
|
||||||
|
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
|
||||||
|
|
|
@ -139,3 +139,36 @@ static bool trans_VDOT(DisasContext *s, arg_VDOT *a)
|
||||||
opr_sz, opr_sz, 0, fn_gvec);
|
opr_sz, opr_sz, 0, fn_gvec);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool trans_VFML(DisasContext *s, arg_VFML *a)
|
||||||
|
{
|
||||||
|
int opr_sz;
|
||||||
|
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||||
|
|
||||||
|
if (!dc_isar_feature(aa32_fhm, s)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UNDEF accesses to D16-D31 if they don't exist. */
|
||||||
|
if (!dc_isar_feature(aa32_simd_r32, s) &&
|
||||||
|
(a->vd & 0x10)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (a->vd & a->q) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!vfp_access_check(s)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
opr_sz = (1 + a->q) * 8;
|
||||||
|
tcg_gen_gvec_3_ptr(tcg_ctx, vfp_reg_offset(1, a->vd),
|
||||||
|
vfp_reg_offset(a->q, a->vn),
|
||||||
|
vfp_reg_offset(a->q, a->vm),
|
||||||
|
tcg_ctx->cpu_env, opr_sz, opr_sz, a->s, /* is_2 == 0 */
|
||||||
|
gen_helper_gvec_fmlal_a32);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -7164,85 +7164,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Advanced SIMD three registers of the same length extension.
|
|
||||||
* 31 25 23 22 20 16 12 11 10 9 8 3 0
|
|
||||||
* +---------------+-----+---+-----+----+----+---+----+---+----+---------+----+
|
|
||||||
* | 1 1 1 1 1 1 0 | op1 | D | op2 | Vn | Vd | 1 | o3 | 0 | o4 | N Q M U | Vm |
|
|
||||||
* +---------------+-----+---+-----+----+----+---+----+---+----+---------+----+
|
|
||||||
*/
|
|
||||||
static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn)
|
|
||||||
{
|
|
||||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
|
||||||
gen_helper_gvec_3 *fn_gvec = NULL;
|
|
||||||
gen_helper_gvec_3_ptr *fn_gvec_ptr = NULL;
|
|
||||||
int rd, rn, rm, opr_sz;
|
|
||||||
int data = 0;
|
|
||||||
int off_rn, off_rm;
|
|
||||||
bool is_long = false, q = extract32(insn, 6, 1);
|
|
||||||
bool ptr_is_env = false;
|
|
||||||
|
|
||||||
if ((insn & 0xff300f10) == 0xfc200810) {
|
|
||||||
/* VFM[AS]L -- 1111 1100 S.10 .... .... 1000 .Q.1 .... */
|
|
||||||
int is_s = extract32(insn, 23, 1);
|
|
||||||
if (!dc_isar_feature(aa32_fhm, s)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
is_long = true;
|
|
||||||
data = is_s; /* is_2 == 0 */
|
|
||||||
fn_gvec_ptr = gen_helper_gvec_fmlal_a32;
|
|
||||||
ptr_is_env = true;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
VFP_DREG_D(rd, insn);
|
|
||||||
if (rd & q) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (q || !is_long) {
|
|
||||||
VFP_DREG_N(rn, insn);
|
|
||||||
VFP_DREG_M(rm, insn);
|
|
||||||
if ((rn | rm) & q & !is_long) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
off_rn = vfp_reg_offset(1, rn);
|
|
||||||
off_rm = vfp_reg_offset(1, rm);
|
|
||||||
} else {
|
|
||||||
rn = VFP_SREG_N(insn);
|
|
||||||
rm = VFP_SREG_M(insn);
|
|
||||||
off_rn = vfp_reg_offset(0, rn);
|
|
||||||
off_rm = vfp_reg_offset(0, rm);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s->fp_excp_el) {
|
|
||||||
gen_exception_insn(s, s->pc_curr, EXCP_UDEF,
|
|
||||||
syn_simd_access_trap(1, 0xe, false), s->fp_excp_el);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!s->vfp_enabled) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
opr_sz = (1 + q) * 8;
|
|
||||||
if (fn_gvec_ptr) {
|
|
||||||
TCGv_ptr ptr;
|
|
||||||
if (ptr_is_env) {
|
|
||||||
ptr = tcg_ctx->cpu_env;
|
|
||||||
} else {
|
|
||||||
ptr = get_fpstatus_ptr(s, 1);
|
|
||||||
}
|
|
||||||
tcg_gen_gvec_3_ptr(tcg_ctx, vfp_reg_offset(1, rd), off_rn, off_rm, ptr,
|
|
||||||
opr_sz, opr_sz, data, fn_gvec_ptr);
|
|
||||||
if (!ptr_is_env) {
|
|
||||||
tcg_temp_free_ptr(tcg_ctx, ptr);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
tcg_gen_gvec_3_ool(tcg_ctx, vfp_reg_offset(1, rd), off_rn, off_rm,
|
|
||||||
opr_sz, opr_sz, data, fn_gvec);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Advanced SIMD two registers and a scalar extension.
|
/* Advanced SIMD two registers and a scalar extension.
|
||||||
* 31 24 23 22 20 16 12 11 10 9 8 3 0
|
* 31 24 23 22 20 16 12 11 10 9 8 3 0
|
||||||
* +-----------------+----+---+----+----+----+---+----+---+----+---------+----+
|
* +-----------------+----+---+----+----+----+---+----+---+----+---------+----+
|
||||||
|
@ -11261,12 +11182,6 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((insn & 0x0e000a00) == 0x0c000800
|
|
||||||
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
|
||||||
if (disas_neon_insn_3same_ext(s, insn)) {
|
|
||||||
goto illegal_op;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if ((insn & 0x0f000a00) == 0x0e000800
|
} else if ((insn & 0x0f000a00) == 0x0e000800
|
||||||
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
||||||
if (disas_neon_insn_2reg_scalar_ext(s, insn)) {
|
if (disas_neon_insn_2reg_scalar_ext(s, insn)) {
|
||||||
|
@ -11450,15 +11365,9 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((insn & 0xfe000a00) == 0xfc000800
|
if ((insn & 0xff000a00) == 0xfe000800
|
||||||
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
||||||
/* The Thumb2 and ARM encodings are identical. */
|
/* The Thumb2 and ARM encodings are identical. */
|
||||||
if (disas_neon_insn_3same_ext(s, insn)) {
|
|
||||||
goto illegal_op;
|
|
||||||
}
|
|
||||||
} else if ((insn & 0xff000a00) == 0xfe000800
|
|
||||||
&& arm_dc_feature(s, ARM_FEATURE_V8)) {
|
|
||||||
/* The Thumb2 and ARM encodings are identical. */
|
|
||||||
if (disas_neon_insn_2reg_scalar_ext(s, insn)) {
|
if (disas_neon_insn_2reg_scalar_ext(s, insn)) {
|
||||||
goto illegal_op;
|
goto illegal_op;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue