From 2c5e10201775ea268eb497f1afa4027ed953e222 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 13 Jun 2019 18:12:01 -0400 Subject: [PATCH] target/arm: Convert VMUL to decodetree Convert the VMUL instruction to decodetree. Backports commit 88c5188ced60e9f2b8cc3af3b9bc4a8031c8c996 from qemu --- qemu/target/arm/translate-vfp.inc.c | 10 ++++++++++ qemu/target/arm/translate.c | 8 +------- qemu/target/arm/vfp.decode | 5 +++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/qemu/target/arm/translate-vfp.inc.c b/qemu/target/arm/translate-vfp.inc.c index 0e04bf7e..6a87b86d 100644 --- a/qemu/target/arm/translate-vfp.inc.c +++ b/qemu/target/arm/translate-vfp.inc.c @@ -1436,3 +1436,13 @@ static bool trans_VNMLA_dp(DisasContext *s, arg_VNMLA_sp *a) { return do_vfp_3op_dp(s, gen_VNMLA_dp, a->vd, a->vn, a->vm, true); } + +static bool trans_VMUL_sp(DisasContext *s, arg_VMUL_sp *a) +{ + return do_vfp_3op_sp(s, gen_helper_vfp_muls, a->vd, a->vn, a->vm, false); +} + +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); +} diff --git a/qemu/target/arm/translate.c b/qemu/target/arm/translate.c index d8ca3320..321a3db0 100644 --- a/qemu/target/arm/translate.c +++ b/qemu/target/arm/translate.c @@ -3214,10 +3214,7 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) rn = VFP_SREG_N(insn); switch (op) { - case 0: - case 1: - case 2: - case 3: + case 0 ... 4: /* Already handled by decodetree */ return 1; default: @@ -3403,9 +3400,6 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) for (;;) { /* Perform the calculation. */ switch (op) { - case 4: /* mul: fn * fm */ - gen_vfp_mul(s, dp); - break; case 5: /* nmul: -(fn * fm) */ gen_vfp_mul(s, dp); gen_vfp_neg(s, dp); diff --git a/qemu/target/arm/vfp.decode b/qemu/target/arm/vfp.decode index c50d2c3e..d7fcb970 100644 --- a/qemu/target/arm/vfp.decode +++ b/qemu/target/arm/vfp.decode @@ -117,3 +117,8 @@ VNMLA_sp ---- 1110 0.01 .... .... 1010 .1.0 .... \ vm=%vm_sp vn=%vn_sp vd=%vd_sp VNMLA_dp ---- 1110 0.01 .... .... 1011 .1.0 .... \ vm=%vm_dp vn=%vn_dp vd=%vd_dp + +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