From patchwork Mon May 18 13:39:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 473396 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 F02CD1402B5 for ; Mon, 18 May 2015 23:41:13 +1000 (AEST) Received: from localhost ([::1]:40998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuLI6-0007XF-M5 for incoming@patchwork.ozlabs.org; Mon, 18 May 2015 09:41:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuLHg-0006rr-Lz for qemu-devel@nongnu.org; Mon, 18 May 2015 09:40:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuLHc-0004sm-46 for qemu-devel@nongnu.org; Mon, 18 May 2015 09:40:44 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:60107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuLHb-0004pQ-NW for qemu-devel@nongnu.org; Mon, 18 May 2015 09:40:39 -0400 Received: from [188.85.25.42] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1YuLHR-0006nI-60; Mon, 18 May 2015 15:40:29 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.84) (envelope-from ) id 1YuLHF-0004ya-II; Mon, 18 May 2015 15:40:17 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Mon, 18 May 2015 15:39:58 +0200 Message-Id: <1431956400-19091-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:bc8:30d7:101::1 Cc: Alexander Graf , Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 1/3] target-s390x: fix CC computation for LOAD POSITIVE instructions 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 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. Cc: Richard Henderson Cc: Alexander Graf Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson --- 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; }