OSDN Git Service

powerpc/sstep: Add support for divde[.] and divdeu[.] instructions
authorBalamuruhan S <bala24@linux.ibm.com>
Tue, 28 Jul 2020 13:03:07 +0000 (18:33 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Jul 2020 13:47:52 +0000 (23:47 +1000)
This patch adds emulation support for divde, divdeu instructions,
  - Divide Doubleword Extended (divde[.])
  - Divide Doubleword Extended Unsigned (divdeu[.])

Signed-off-by: Balamuruhan S <bala24@linux.ibm.com>
Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200728130308.1790982-3-bala24@linux.ibm.com
arch/powerpc/lib/sstep.c

index c58ea9e..caee8cc 100644 (file)
@@ -1806,7 +1806,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;