From patchwork Mon Aug 11 19:23:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 379128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4978C14012A for ; Tue, 12 Aug 2014 05:30:00 +1000 (EST) Received: from localhost ([::1]:37726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGvI6-0005mA-88 for incoming@patchwork.ozlabs.org; Mon, 11 Aug 2014 15:29:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGvCl-0005fa-TG for qemu-devel@nongnu.org; Mon, 11 Aug 2014 15:24:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGvCc-0002ZK-T6 for qemu-devel@nongnu.org; Mon, 11 Aug 2014 15:24:27 -0400 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:48311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGvCc-0002Z5-OM; Mon, 11 Aug 2014 15:24:18 -0400 Received: by mail-oi0-f51.google.com with SMTP id g201so5860546oib.38 for ; Mon, 11 Aug 2014 12:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1v37FX1BiCjXx9l5jc82Fp2DG2N0rWVLMN8AgmlETl8=; b=ZDUYe659fRi5UmajTbp1YkA/Vlfen3P7AtSzO2GBJS8daYk1vG2Gc5p+q6dk9oBO/e 3z4uutwVwzab7zLGCxbACneonR1IaonuX/ca+KZArTJrTePebxN71JppSeot+TV3xk6M AMW1S+4BFl0BCiSahMHaR6Bqi8t4q4qjgPIdTWgx2xiqxsRhL1w9KAa+sPOrtvTM6UjM 66zvHcSAQjPdW398OobZc5KcwcilOfPYAhSsGzXmBqC3qrHU5pOtsFC9zIqjNE/Vb1A4 eJP8iDs/76OJkdbv7rolnSoKtB4jeNgXVgEUtt9nlH+TUY67z3/6wtmV2oibqAh4Ez0T I7mg== X-Received: by 10.182.186.73 with SMTP id fi9mr15918712obc.0.1407785058265; Mon, 11 Aug 2014 12:24:18 -0700 (PDT) Received: from tmusta-sc.rchland.ibm.com (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id u5sm1539939obt.18.2014.08.11.12.24.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 12:24:17 -0700 (PDT) From: Tom Musta To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Mon, 11 Aug 2014 14:23:29 -0500 Message-Id: <1407785009-6538-9-git-send-email-tommusta@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407785009-6538-1-git-send-email-tommusta@gmail.com> References: <1407785009-6538-1-git-send-email-tommusta@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::233 Cc: Tom Musta , agraf@suse.de Subject: [Qemu-devel] [PATCH 8/8] target-ppc: Bug Fix: srad 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 Fix the check for carry in the srad helper to properly construct the mask -- a "1ULL" must be used (instead of "1") in order to get the desired result. Signed-off-by: Tom Musta Reviewed-by: Richard Henderson --- target-ppc/int_helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c index e83a25d..e5b103b 100644 --- a/target-ppc/int_helper.c +++ b/target-ppc/int_helper.c @@ -248,7 +248,7 @@ target_ulong helper_srad(CPUPPCState *env, target_ulong value, if (likely((uint64_t)shift != 0)) { shift &= 0x3f; ret = (int64_t)value >> shift; - if (likely(ret >= 0 || (value & ((1 << shift) - 1)) == 0)) { + if (likely(ret >= 0 || (value & ((1ULL << shift) - 1)) == 0)) { env->ca = 0; } else { env->ca = 1;