From patchwork Wed Feb 9 15:42:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 82493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E74BDB70B3 for ; Thu, 10 Feb 2011 02:44:40 +1100 (EST) Received: from localhost ([127.0.0.1]:53129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnCDd-0000q5-Np for incoming@patchwork.ozlabs.org; Wed, 09 Feb 2011 10:44:37 -0500 Received: from [140.186.70.92] (port=42004 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnCBk-00007N-1o for qemu-devel@nongnu.org; Wed, 09 Feb 2011 10:42:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnCBh-0002T4-4b for qemu-devel@nongnu.org; Wed, 09 Feb 2011 10:42:39 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:57899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnCBg-0002Se-IK for qemu-devel@nongnu.org; Wed, 09 Feb 2011 10:42:37 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PnCBd-0001Rb-Nc; Wed, 09 Feb 2011 15:42:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Wed, 9 Feb 2011 15:42:33 +0000 Message-Id: <1297266153-5526-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297266153-5526-1-git-send-email-peter.maydell@linaro.org> References: <1297266153-5526-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Christophe Lyon , patches@linaro.org Subject: [Qemu-devel] [PATCH 2/2] target-arm: Fix 32 bit signed saturating narrow X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The returned value when doing saturating signed 64->32 bit conversion of a negative number was incorrect due to a missing cast. Signed-off-by: Peter Maydell --- target-arm/neon_helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c index a7cf383..61890dd 100644 --- a/target-arm/neon_helper.c +++ b/target-arm/neon_helper.c @@ -1209,7 +1209,7 @@ uint32_t HELPER(neon_narrow_sat_s32)(CPUState *env, uint64_t x) { if ((int64_t)x != (int32_t)x) { SET_QC(); - return (x >> 63) ^ 0x7fffffff; + return ((int64_t)x >> 63) ^ 0x7fffffff; } return x; }