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: 96 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:39:56 -0000 Delivered-To: patches@linaro.org Received: by 10.147.124.5 with SMTP id b5cs148520yan; Wed, 9 Feb 2011 07:42:37 -0800 (PST) Received: by 10.227.134.5 with SMTP id h5mr2429700wbt.26.1297266156721; Wed, 09 Feb 2011 07:42:36 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id s18si851048wbc.58.2011.02.09.07.42.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Feb 2011 07:42:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk 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 Cc: patches@linaro.org, Christophe Lyon Subject: [PATCH 2/2] target-arm: Fix 32 bit signed saturating narrow 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> 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; }