From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Tom Musta Date: Mon, 11 Aug 2014 14:23:29 -0500 Message-Id: <1407785009-6538-9-git-send-email-tommusta@gmail.com> In-Reply-To: <1407785009-6538-1-git-send-email-tommusta@gmail.com> References: <1407785009-6538-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [PATCH 8/8] target-ppc: Bug Fix: srad List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Tom Musta , agraf@suse.de 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 --- 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; -- 1.7.1