mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-22 18:11:02 +00:00
target/arm: Convert VNMUL to decodetree
Convert the VNMUL instruction to decodetree. Backports commit 43c4be1236c105090d134540da1036073d157cd4 from qemu
This commit is contained in:
parent
2c5e102017
commit
06584edf61
|
@ -1446,3 +1446,27 @@ static bool trans_VMUL_dp(DisasContext *s, arg_VMUL_sp *a)
|
|||
{
|
||||
return do_vfp_3op_dp(s, gen_helper_vfp_muld, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
||||
static void gen_VNMUL_sp(TCGContext *tcg_ctx, TCGv_i32 vd, TCGv_i32 vn, TCGv_i32 vm, TCGv_ptr fpst)
|
||||
{
|
||||
/* VNMUL: -(fn * fm) */
|
||||
gen_helper_vfp_muls(tcg_ctx, vd, vn, vm, fpst);
|
||||
gen_helper_vfp_negs(tcg_ctx, vd, vd);
|
||||
}
|
||||
|
||||
static bool trans_VNMUL_sp(DisasContext *s, arg_VNMUL_sp *a)
|
||||
{
|
||||
return do_vfp_3op_sp(s, gen_VNMUL_sp, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
||||
static void gen_VNMUL_dp(TCGContext *tcg_ctx, TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst)
|
||||
{
|
||||
/* VNMUL: -(fn * fm) */
|
||||
gen_helper_vfp_muld(tcg_ctx, vd, vn, vm, fpst);
|
||||
gen_helper_vfp_negd(tcg_ctx, vd, vd);
|
||||
}
|
||||
|
||||
static bool trans_VNMUL_dp(DisasContext *s, arg_VNMUL_sp *a)
|
||||
{
|
||||
return do_vfp_3op_dp(s, gen_VNMUL_dp, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
|
|
@ -1444,7 +1444,6 @@ static inline void gen_vfp_##name(DisasContext *s, int dp)
|
|||
|
||||
VFP_OP2(add)
|
||||
VFP_OP2(sub)
|
||||
VFP_OP2(mul)
|
||||
VFP_OP2(div)
|
||||
|
||||
#undef VFP_OP2
|
||||
|
@ -3214,7 +3213,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)
|
|||
rn = VFP_SREG_N(insn);
|
||||
|
||||
switch (op) {
|
||||
case 0 ... 4:
|
||||
case 0 ... 5:
|
||||
/* Already handled by decodetree */
|
||||
return 1;
|
||||
default:
|
||||
|
@ -3400,10 +3399,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)
|
|||
for (;;) {
|
||||
/* Perform the calculation. */
|
||||
switch (op) {
|
||||
case 5: /* nmul: -(fn * fm) */
|
||||
gen_vfp_mul(s, dp);
|
||||
gen_vfp_neg(s, dp);
|
||||
break;
|
||||
case 6: /* add: fn + fm */
|
||||
gen_vfp_add(s, dp);
|
||||
break;
|
||||
|
|
|
@ -122,3 +122,8 @@ VMUL_sp ---- 1110 0.10 .... .... 1010 .0.0 .... \
|
|||
vm=%vm_sp vn=%vn_sp vd=%vd_sp
|
||||
VMUL_dp ---- 1110 0.10 .... .... 1011 .0.0 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||
|
||||
VNMUL_sp ---- 1110 0.10 .... .... 1010 .1.0 .... \
|
||||
vm=%vm_sp vn=%vn_sp vd=%vd_sp
|
||||
VNMUL_dp ---- 1110 0.10 .... .... 1011 .1.0 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||
|
|
Loading…
Reference in a new issue