From patchwork Thu Feb 7 18:36:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petar Jovanovic X-Patchwork-Id: 218975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E20D62C008D for ; Fri, 8 Feb 2013 05:37:56 +1100 (EST) Received: from localhost ([::1]:55398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3WM7-0006hb-02 for incoming@patchwork.ozlabs.org; Thu, 07 Feb 2013 13:37:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3WLz-0006hD-Al for qemu-devel@nongnu.org; Thu, 07 Feb 2013 13:37:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3WLy-0002It-2u for qemu-devel@nongnu.org; Thu, 07 Feb 2013 13:37:47 -0500 Received: from mail.rt-rk.ftn.uns.ac.rs ([147.91.177.140]:34894 helo=mail.rt-rk.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3WLx-0002IU-Sm for qemu-devel@nongnu.org; Thu, 07 Feb 2013 13:37:46 -0500 Received: from mail.rt-rk.com (mail.localdomain [127.0.0.1]) by mail.rt-rk.com (Postfix) with SMTP id DB81525BAE3 for ; Thu, 7 Feb 2013 19:37:41 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Petar Jovanovic To: qemu-devel@nongnu.org Date: Thu, 7 Feb 2013 19:36:09 +0100 Message-Id: <1360262169-823-1-git-send-email-petar.jovanovic@rt-rk.com> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.91.177.140 Cc: petarj@mips.com, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH] target-mips: fix for sign-issue in MULQ_W helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Petar Jovanovic Correct sign-propagation before multiplication in MULQ_W helper. The change also fixes previously incorrect expected values in the tests for MULQ_RS.W and MULQ_S.W. Signed-off-by: Petar Jovanovic Reviewed-by: Richard Henderson --- target-mips/dsp_helper.c | 2 +- tests/tcg/mips/mips32-dspr2/mulq_rs_w.c | 2 +- tests/tcg/mips/mips32-dspr2/mulq_s_w.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index 96cb044..c718707 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -2689,7 +2689,7 @@ MAQ_SA_W(maq_sa_w_phr, 0); target_ulong helper_##name(target_ulong rs, target_ulong rt, \ CPUMIPSState *env) \ { \ - uint32_t rs_t, rt_t; \ + int32_t rs_t, rt_t; \ int32_t tempI; \ int64_t tempL; \ \ diff --git a/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c b/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c index 669405f..7ba633b 100644 --- a/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c +++ b/tests/tcg/mips/mips32-dspr2/mulq_rs_w.c @@ -8,7 +8,7 @@ int main() rs = 0x80001234; rt = 0x80004321; - result = 0x80005555; + result = 0x7FFFAAAB; __asm ("mulq_rs.w %0, %1, %2\n\t" diff --git a/tests/tcg/mips/mips32-dspr2/mulq_s_w.c b/tests/tcg/mips/mips32-dspr2/mulq_s_w.c index df148b7..9c2be06 100644 --- a/tests/tcg/mips/mips32-dspr2/mulq_s_w.c +++ b/tests/tcg/mips/mips32-dspr2/mulq_s_w.c @@ -8,7 +8,7 @@ int main() rs = 0x80001234; rt = 0x80004321; - result = 0x80005555; + result = 0x7FFFAAAB; __asm ("mulq_s.w %0, %1, %2\n\t"