From: Balamuruhan S <bala24@linux•ibm.com>
To: mpe@ellerman•id.au
Cc: ravi.bangoria@linux•ibm.com, jniethe5@gmail•com,
Balamuruhan S <bala24@linux•ibm.com>,
paulus@samba•org, sandipan@linux•ibm.com,
naveen.n.rao@linux•vnet.ibm.com, linuxppc-dev@lists•ozlabs.org
Subject: [PATCH v4 2/3] powerpc sstep: add support for divde[.] and divdeu[.] instructions
Date: Thu, 2 Apr 2020 20:49:22 +0530 [thread overview]
Message-ID: <20200402151923.605791-3-bala24@linux.ibm.com> (raw)
In-Reply-To: <20200402151923.605791-1-bala24@linux.ibm.com>
This patch adds emulation support for divde, divdeu instructions,
* Divide Doubleword Extended (divde[.])
* Divide Doubleword Extended Unsigned (divdeu[.])
Reviewed-by: Sandipan Das <sandipan@linux•ibm.com>
Signed-off-by: Balamuruhan S <bala24@linux•ibm.com>
Acked-by: Naveen N. Rao <naveen.n.rao@linux•vnet.ibm.com>
---
arch/powerpc/lib/sstep.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 5f3a7bd9d90d..c9036a75730c 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -1736,7 +1736,18 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
op->val = (int) regs->gpr[ra] /
(int) regs->gpr[rb];
goto arith_done;
-
+#ifdef __powerpc64__
+ case 425: /* divde[.] */
+ asm volatile(PPC_DIVDE(%0, %1, %2) :
+ "=r" (op->val) : "r" (regs->gpr[ra]),
+ "r" (regs->gpr[rb]));
+ goto arith_done;
+ case 393: /* divdeu[.] */
+ asm volatile(PPC_DIVDEU(%0, %1, %2) :
+ "=r" (op->val) : "r" (regs->gpr[ra]),
+ "r" (regs->gpr[rb]));
+ goto arith_done;
+#endif
case 755: /* darn */
if (!cpu_has_feature(CPU_FTR_ARCH_300))
return -1;
--
2.24.1
next prev parent reply other threads:[~2020-04-02 15:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 15:19 [PATCH v4 0/3] Add support for divde[.] and divdeu[.] instruction emulation Balamuruhan S
2020-04-02 15:19 ` [PATCH v4 1/3] powerpc ppc-opcode: add divde and divdeu opcodes Balamuruhan S
2020-04-02 15:19 ` Balamuruhan S [this message]
2020-04-02 15:19 ` [PATCH v4 3/3] powerpc test_emulate_step: add testcases for divde[.] and divdeu[.] instructions Balamuruhan S
-- strict thread matches above, loose matches on Subject: below --
2020-07-28 13:03 [PATCH v4 0/3] Add support for divde[.] and divdeu[.] instruction emulation Balamuruhan S
2020-07-28 13:03 ` [PATCH v4 2/3] powerpc sstep: add support for divde[.] and divdeu[.] instructions Balamuruhan S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200402151923.605791-3-bala24@linux.ibm.com \
--to=bala24@linux$(echo .)ibm.com \
--cc=jniethe5@gmail$(echo .)com \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mpe@ellerman$(echo .)id.au \
--cc=naveen.n.rao@linux$(echo .)vnet.ibm.com \
--cc=paulus@samba$(echo .)org \
--cc=ravi.bangoria@linux$(echo .)ibm.com \
--cc=sandipan@linux$(echo .)ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox