mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 05:25:11 +00:00
target/arm: Convert VDIV to decodetree
Convert the VDIV instruction to decodetree. Backports commit 519ee7ae31e050eb0ff9ad35c213f0bd7ab1c03e from qemu
This commit is contained in:
parent
76c74bc657
commit
321bcc822b
|
@ -1490,3 +1490,13 @@ static bool trans_VSUB_dp(DisasContext *s, arg_VSUB_sp *a)
|
|||
{
|
||||
return do_vfp_3op_dp(s, gen_helper_vfp_subd, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
||||
static bool trans_VDIV_sp(DisasContext *s, arg_VDIV_sp *a)
|
||||
{
|
||||
return do_vfp_3op_sp(s, gen_helper_vfp_divs, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
||||
static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_sp *a)
|
||||
{
|
||||
return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false);
|
||||
}
|
||||
|
|
|
@ -1429,23 +1429,6 @@ static TCGv_ptr get_fpstatus_ptr(DisasContext *s, int neon)
|
|||
return statusptr;
|
||||
}
|
||||
|
||||
#define VFP_OP2(name) \
|
||||
static inline void gen_vfp_##name(DisasContext *s, int dp) \
|
||||
{ \
|
||||
TCGContext *tcg_ctx = s->uc->tcg_ctx; \
|
||||
TCGv_ptr fpst = get_fpstatus_ptr(s, 0); \
|
||||
if (dp) { \
|
||||
gen_helper_vfp_##name##d(tcg_ctx, s->F0d, s->F0d, s->F1d, fpst); \
|
||||
} else { \
|
||||
gen_helper_vfp_##name##s(tcg_ctx, s->F0s, s->F0s, s->F1s, fpst); \
|
||||
} \
|
||||
tcg_temp_free_ptr(tcg_ctx, fpst); \
|
||||
}
|
||||
|
||||
VFP_OP2(div)
|
||||
|
||||
#undef VFP_OP2
|
||||
|
||||
static inline void gen_vfp_abs(DisasContext *s, int dp)
|
||||
{
|
||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||
|
@ -3211,7 +3194,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)
|
|||
rn = VFP_SREG_N(insn);
|
||||
|
||||
switch (op) {
|
||||
case 0 ... 7:
|
||||
case 0 ... 8:
|
||||
/* Already handled by decodetree */
|
||||
return 1;
|
||||
default:
|
||||
|
@ -3397,9 +3380,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn)
|
|||
for (;;) {
|
||||
/* Perform the calculation. */
|
||||
switch (op) {
|
||||
case 8: /* div: fn / fm */
|
||||
gen_vfp_div(s, dp);
|
||||
break;
|
||||
case 10: /* VFNMA : fd = muladd(-fd, fn, fm) */
|
||||
case 11: /* VFNMS : fd = muladd(-fd, -fn, fm) */
|
||||
case 12: /* VFMA : fd = muladd( fd, fn, fm) */
|
||||
|
|
|
@ -138,3 +138,7 @@ VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... \
|
|||
VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||
|
||||
VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... \
|
||||
vm=%vm_sp vn=%vn_sp vd=%vd_sp
|
||||
VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... \
|
||||
vm=%vm_dp vn=%vn_dp vd=%vd_dp
|
||||
|
|
Loading…
Reference in a new issue