From patchwork Tue Sep 19 23:32:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Blanchard X-Patchwork-Id: 815947 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xxfMf1grJz9sPr for ; Wed, 20 Sep 2017 09:33:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="J+1HJK9M"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xxfMf0XpszDqYP for ; Wed, 20 Sep 2017 09:33:50 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="J+1HJK9M"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xxfKy1fXFzDqNm for ; Wed, 20 Sep 2017 09:32:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="J+1HJK9M"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1010) id 3xxfKy0syNz9sPs; Wed, 20 Sep 2017 09:32:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1505863942; bh=yRW5G/WWxhVkvQDyg64uua1yiFu/hJnuGw1FLcOSMh0=; h=From:To:Cc:Subject:Date:From; b=J+1HJK9MWq9Tq4ENRx+3SZ+5musuLryYqLJmMA0n+/izGVYxxKA37CavaAqXGxlXC KPOBGyYyX/txr/Mx1qcx3oomMDtsNHtRVbsW9nKe/HHHeNtZoB8cukOKAYXo22ufzW RtaIMxQg9O9pG/K5ukPu38EAgoa8wxioEzeAVDq5OxfAJoilv5fag3Rj1lhPJIL9YV YC7dhNITZf5KNbPK/uPAzgKxvio+o+BL1A0GxfNHG7a8ZTzcBrCuNuBrZvwJb3RS1i KOUVee0sjxPPeuOLvhuIlgQM7ZEnPQjzjhq6dUSAzSLV7A45xft7h0pu8IBICa0b+T MFj08eo66v1mw== From: Anton Blanchard To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Subject: [PATCH] powerpc/sstep: mullw should calculate a 64 bit signed result Date: Wed, 20 Sep 2017 09:32:19 +1000 Message-Id: <20170919233219.26184-1-anton@ozlabs.org> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Anton Blanchard 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 --- arch/powerpc/lib/sstep.c | 5 +++-- 1 file 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 */