summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2017-09-20 01:32:19 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2017-09-20 05:30:09 +0200
commit1575fe06f6b1d156ed31fb22c8631d49d79751d8 (patch)
treeaed176e7eb68819db1178de75db6959d83d79566
parentpowerpc/sstep: Fix issues with mcrf (diff)
downloadlinux-1575fe06f6b1d156ed31fb22c8631d49d79751d8.tar.xz
linux-1575fe06f6b1d156ed31fb22c8631d49d79751d8.zip
powerpc/sstep: mullw should calculate a 64 bit signed result
mullw should do a 32 bit signed multiply and create a 64 bit signed result. It currently truncates the result to 32 bits. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/lib/sstep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index c4cda1afb49d..5e8418c28bd8 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -1651,8 +1651,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
goto arith_done;
case 235: /* mullw */
- op->val = (unsigned int) regs->gpr[ra] *
- (unsigned int) regs->gpr[rb];
+ op->val = (long)(int) regs->gpr[ra] *
+ (int) regs->gpr[rb];
+
goto arith_done;
case 266: /* add */