Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/sstep: Add support for divde[.] and divdeu[.] instructions

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

authored by

Balamuruhan S and committed by
Michael Ellerman
151c32bf 8902c6f9

+12 -1
+12 -1
arch/powerpc/lib/sstep.c
··· 1806 1806 op->val = (int) regs->gpr[ra] / 1807 1807 (int) regs->gpr[rb]; 1808 1808 goto arith_done; 1809 - 1809 + #ifdef __powerpc64__ 1810 + case 425: /* divde[.] */ 1811 + asm volatile(PPC_DIVDE(%0, %1, %2) : 1812 + "=r" (op->val) : "r" (regs->gpr[ra]), 1813 + "r" (regs->gpr[rb])); 1814 + goto arith_done; 1815 + case 393: /* divdeu[.] */ 1816 + asm volatile(PPC_DIVDEU(%0, %1, %2) : 1817 + "=r" (op->val) : "r" (regs->gpr[ra]), 1818 + "r" (regs->gpr[rb])); 1819 + goto arith_done; 1820 + #endif 1810 1821 case 755: /* darn */ 1811 1822 if (!cpu_has_feature(CPU_FTR_ARCH_300)) 1812 1823 return -1;