Received: from eggs.gnu.org ([2001:4830:134:3::10]:56495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0em2-0003Xt-N5 for qemu-devel@nongnu.org; Thu, 04 Jun 2015 19:42:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0elz-0001wc-GY for qemu-devel@nongnu.org; Thu, 04 Jun 2015 19:42:10 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48730 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0elz-0001wM-AY for qemu-devel@nongnu.org; Thu, 04 Jun 2015 19:42:07 -0400 From: Alexander Graf Date: Fri, 5 Jun 2015 01:41:32 +0200 Message-Id: <1433461324-23584-3-git-send-email-agraf@suse.de> In-Reply-To: <1433461324-23584-1-git-send-email-agraf@suse.de> References: <1433461324-23584-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 02/34] target-s390x: fix CC computation for LOAD POSITIVE instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aurel@aurel32.net, Aurelien Jarno , rth@twiddle.net From: Aurelien Jarno LOAD POSITIVE instructions (LPR, LPGR and LPGFR) set the following condition code: 0: Result zero; no overflow 1: -- 2: Result greater than zero; no overflow 3: Overflow The current code wrongly returns 1 instead of 2 in case of a result greater than 0. This patches fixes that. This fixes the marshalling of the value '0L' in Python. Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson Signed-off-by: Alexander Graf --- target-s390x/cc_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-s390x/cc_helper.c b/target-s390x/cc_helper.c index 00bc883..bfce3f1 100644 --- a/target-s390x/cc_helper.c +++ b/target-s390x/cc_helper.c @@ -195,7 +195,7 @@ static uint32_t cc_calc_abs_64(int64_t dst) if ((uint64_t)dst == 0x8000000000000000ULL) { return 3; } else if (dst) { - return 1; + return 2; } else { return 0; } @@ -296,7 +296,7 @@ static uint32_t cc_calc_abs_32(int32_t dst) if ((uint32_t)dst == 0x80000000UL) { return 3; } else if (dst) { - return 1; + return 2; } else { return 0; } -- 1.7.12.4