[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 26/42] target/arm: Convert VDIV to decodetree
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 26/42] target/arm: Convert VDIV to decodetree |
Date: |
Tue, 11 Jun 2019 11:53:35 +0100 |
Convert the VDIV instruction to decodetree.
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
target/arm/translate-vfp.inc.c | 10 ++++++++++
target/arm/translate.c | 21 +--------------------
target/arm/vfp.decode | 5 +++++
3 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c
index 12da3b8acb8..6af99605d5c 100644
--- a/target/arm/translate-vfp.inc.c
+++ b/target/arm/translate-vfp.inc.c
@@ -1471,3 +1471,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);
+}
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 18d4f9933ad..a9ec6eaef80 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -1374,22 +1374,6 @@ static TCGv_ptr get_fpstatus_ptr(int neon)
return statusptr;
}
-#define VFP_OP2(name) \
-static inline void gen_vfp_##name(int dp) \
-{ \
- TCGv_ptr fpst = get_fpstatus_ptr(0); \
- if (dp) { \
- gen_helper_vfp_##name##d(cpu_F0d, cpu_F0d, cpu_F1d, fpst); \
- } else { \
- gen_helper_vfp_##name##s(cpu_F0s, cpu_F0s, cpu_F1s, fpst); \
- } \
- tcg_temp_free_ptr(fpst); \
-}
-
-VFP_OP2(div)
-
-#undef VFP_OP2
-
static inline void gen_vfp_abs(int dp)
{
if (dp)
@@ -3109,7 +3093,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:
@@ -3295,9 +3279,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(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) */
diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode
index de56f44efc9..de305f60e18 100644
--- a/target/arm/vfp.decode
+++ b/target/arm/vfp.decode
@@ -137,3 +137,8 @@ VSUB_sp ---- 1110 0.11 .... .... 1010 .1.0 .... \
vm=%vm_sp vn=%vn_sp vd=%vd_sp
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
--
2.20.1
- [Qemu-devel] [PATCH v2 10/42] target/arm: Move the VFP trans_* functions to translate-vfp.inc.c, (continued)
- [Qemu-devel] [PATCH v2 10/42] target/arm: Move the VFP trans_* functions to translate-vfp.inc.c, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 20/42] target/arm: Convert VFP VNMLS to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 19/42] target/arm: Convert VFP VMLS to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 18/42] target/arm: Convert VFP VMLA to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 25/42] target/arm: Convert VSUB to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 24/42] target/arm: Convert VADD to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 22/42] target/arm: Convert VMUL to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 17/42] target/arm: Remove VLDR/VSTR/VLDM/VSTM use of cpu_F0s and cpu_F0d, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 21/42] target/arm: Convert VFP VNMLA to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 16/42] target/arm: Convert the VFP load/store multiple insns to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 26/42] target/arm: Convert VDIV to decodetree,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 39/42] target/arm: Convert VJCVT to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 35/42] target/arm: Convert the VCVT-to-f16 insns to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 42/42] target/arm: Fix short-vector increment behaviour, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 37/42] target/arm: Convert double-single precision conversion insns to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 28/42] target/arm: Convert VMOV (imm) to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 29/42] target/arm: Convert VABS to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 31/42] target/arm: Convert VSQRT to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 36/42] target/arm: Convert VFP round insns to decodetree, Peter Maydell, 2019/06/11
- [Qemu-devel] [PATCH v2 34/42] target/arm: Convert the VCVT-from-f16 insns to decodetree, Peter Maydell, 2019/06/11