From patchwork Sun Aug 7 01:15:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9266157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B95A60760 for ; Sun, 7 Aug 2016 01:16:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71A2927FAC for ; Sun, 7 Aug 2016 01:16:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 642EE2840A; Sun, 7 Aug 2016 01:16:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E9FC427FAC for ; Sun, 7 Aug 2016 01:16:28 +0000 (UTC) Received: from localhost ([::1]:51072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWChX-00034c-4m for patchwork-qemu-devel@patchwork.kernel.org; Sat, 06 Aug 2016 21:16:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWChC-00034H-6v for qemu-devel@nongnu.org; Sat, 06 Aug 2016 21:16:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWCh6-0006fU-28 for qemu-devel@nongnu.org; Sat, 06 Aug 2016 21:16:05 -0400 Received: from mail-yw0-x242.google.com ([2607:f8b0:4002:c05::242]:33905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWCh5-0006fQ-UF for qemu-devel@nongnu.org; Sat, 06 Aug 2016 21:15:59 -0400 Received: by mail-yw0-x242.google.com with SMTP id j12so23204964ywb.1 for ; Sat, 06 Aug 2016 18:15:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=LnHQ6UvzhsLZPhJD9X3ex7NtZZ0QxFqKnIeDLieFFwI=; b=HxmIy92St0dt3LSQf+cLrlFhIWbpILkQ4wzizjJ/2jq5HH2m0AyEMj5vHX1UDDkoUC hj2YmcK24DgRP5gRobmnVboUS/N9hRXHQEufjwdIuCpA6RSbZLfYsJ8Nj2GPV2UUy1ai h9C71C4a4t4J4y2CA5jeSO3H8Qx2KlWSThq8K4/21plc/4jee+Wpgwz3H2fmOG58FR4H ZdspaBPuMbW2C3dof9o4aSQJqxUTY1rNVpxfqsq+4Voi244hdZVVXFc/oadjCuDCHWm2 hduuRm+NQzUvVuAgue6YzTjW8WboYkNHvX0nLT/m4zEh4B1fruFz/DLKA1oAuHbOZjNy NzBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=LnHQ6UvzhsLZPhJD9X3ex7NtZZ0QxFqKnIeDLieFFwI=; b=FfzObyrTqMyGurChcU7w/qUYz/2JDI2n4EYS1heh+MZHRvnPEFZ99mCALspFgBtwFn LPR4XQv6vY6lReneV7N0up1VFzfYDSlfXmSrl6kbvyCg808S2fqYSLQ8Xevv1hmJjdhb K0tMeLbrAgzS0i5W8w0yT1RNekUidya5PBhY9AWm4frst3CqoJrmpSxgrwCM1wUlZW+C UjHKYFXx13N6+OWi5DQQOo62Euu9RSD+6juNk8u9zqRRvvPgyZbROHh9UVv1NSkF8WeQ CsE3OXUYcsWNLUiyiHEXKRFq0062GDkcCPfDx/ijuH38KHupmyx/IJu5kRs4bOzTARWN v34Q== X-Gm-Message-State: AEkooushTE8KFBOY1k/K7a43tQP6stsB1JueO4jT4IcHmbNoPib/p/cLOk2yCWkSR8frlw== X-Received: by 10.129.101.132 with SMTP id z126mr62792279ywb.241.1470532559275; Sat, 06 Aug 2016 18:15:59 -0700 (PDT) Received: from evgadesktop.attlocal.net (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by smtp.gmail.com with ESMTPSA id l1sm11088663ywc.41.2016.08.06.18.15.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Aug 2016 18:15:58 -0700 (PDT) From: Pranith Kumar To: Aurelien Jarno , Leon Alrae , qemu-devel@nongnu.org (open list:All patches CC here) Date: Sat, 6 Aug 2016 21:15:57 -0400 Message-Id: <20160807011557.31007-1-bobby.prani@gmail.com> X-Mailer: git-send-email 2.9.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::242 Subject: [Qemu-devel] [PATCH] target-mips: Fix warning about shifting negative value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP With latest clang you get the following warning: warning: shifting a negative signed value is undefined [-Wshift-negative-value] Fix the warning by changing negative shift to inverse 0 shift. Signed-off-by: Pranith Kumar --- target-mips/translate.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target-mips/translate.c b/target-mips/translate.c index bab52cb..d224de0 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -3282,7 +3282,7 @@ static void gen_r6_muldiv(DisasContext *ctx, int opc, int rd, int rs, int rt) { TCGv t2 = tcg_temp_new(); TCGv t3 = tcg_temp_new(); - tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, -1LL << 63); + tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, ~0ULL << 63); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, -1LL); tcg_gen_and_tl(t2, t2, t3); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, 0); @@ -3298,7 +3298,7 @@ static void gen_r6_muldiv(DisasContext *ctx, int opc, int rd, int rs, int rt) { TCGv t2 = tcg_temp_new(); TCGv t3 = tcg_temp_new(); - tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, -1LL << 63); + tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, ~0ULL << 63); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, -1LL); tcg_gen_and_tl(t2, t2, t3); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, 0); @@ -3444,7 +3444,7 @@ static void gen_muldiv(DisasContext *ctx, uint32_t opc, { TCGv t2 = tcg_temp_new(); TCGv t3 = tcg_temp_new(); - tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, -1LL << 63); + tcg_gen_setcondi_tl(TCG_COND_EQ, t2, t0, ~0ULL << 63); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, -1LL); tcg_gen_and_tl(t2, t2, t3); tcg_gen_setcondi_tl(TCG_COND_EQ, t3, t1, 0); @@ -3791,7 +3791,7 @@ static void gen_loongson_integer(DisasContext *ctx, uint32_t opc, tcg_gen_movi_tl(cpu_gpr[rd], 0); tcg_gen_br(l3); gen_set_label(l1); - tcg_gen_brcondi_tl(TCG_COND_NE, t0, -1LL << 63, l2); + tcg_gen_brcondi_tl(TCG_COND_NE, t0, ~0ULL << 63, l2); tcg_gen_brcondi_tl(TCG_COND_NE, t1, -1LL, l2); tcg_gen_mov_tl(cpu_gpr[rd], t0); tcg_gen_br(l3); @@ -3820,7 +3820,7 @@ static void gen_loongson_integer(DisasContext *ctx, uint32_t opc, TCGLabel *l2 = gen_new_label(); TCGLabel *l3 = gen_new_label(); tcg_gen_brcondi_tl(TCG_COND_EQ, t1, 0, l1); - tcg_gen_brcondi_tl(TCG_COND_NE, t0, -1LL << 63, l2); + tcg_gen_brcondi_tl(TCG_COND_NE, t0, ~0ULL << 63, l2); tcg_gen_brcondi_tl(TCG_COND_NE, t1, -1LL, l2); gen_set_label(l1); tcg_gen_movi_tl(cpu_gpr[rd], 0);