Commit 6c180071 authored by PrasannaKumar Muralidharan's avatar PrasannaKumar Muralidharan Committed by Michael Ellerman

powerpc sstep: Add support for modsw, moduw instructions

This adds emulation support for the following integer instructions:
  * Modulo Signed Word (modsw)
  * Modulo Unsigned Word (moduw)
Signed-off-by: default avatarPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 3e751acb
......@@ -1708,6 +1708,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
case 266: /* add */
op->val = regs->gpr[ra] + regs->gpr[rb];
goto arith_done;
case 267: /* moduw */
if (!cpu_has_feature(CPU_FTR_ARCH_300))
return -1;
op->val = (unsigned int) regs->gpr[ra] %
(unsigned int) regs->gpr[rb];
goto compute_done;
#ifdef __powerpc64__
case 457: /* divdu */
op->val = regs->gpr[ra] / regs->gpr[rb];
......@@ -1750,6 +1757,13 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
return -1;
case 779: /* modsw */
if (!cpu_has_feature(CPU_FTR_ARCH_300))
return -1;
op->val = (int) regs->gpr[ra] %
(int) regs->gpr[rb];
goto compute_done;
/*
* Logical instructions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment