From patchwork Tue Dec 7 15:43:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 74564 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 ADCDEB70A5 for ; Wed, 8 Dec 2010 02:51:12 +1100 (EST) Received: from localhost ([127.0.0.1]:42105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPzor-0004xj-Vg for incoming@patchwork.ozlabs.org; Tue, 07 Dec 2010 10:51:10 -0500 Received: from [140.186.70.92] (port=52503 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPzhp-0001A4-L4 for qemu-devel@nongnu.org; Tue, 07 Dec 2010 10:43:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPzho-0006bH-BO for qemu-devel@nongnu.org; Tue, 07 Dec 2010 10:43:53 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:13451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPzho-0006Zf-3z for qemu-devel@nongnu.org; Tue, 07 Dec 2010 10:43:52 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PPzhf-0000yT-AX; Tue, 07 Dec 2010 15:43:43 +0000 From: Peter Maydell To: Anthony Liguori , qemu-devel@nongnu.org Date: Tue, 7 Dec 2010 15:43:43 +0000 Message-Id: <1291736623-3695-15-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1291736623-3695-1-git-send-email-peter.maydell@linaro.org> References: <1291736623-3695-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [PATCH 14/14] ARM: Implement VCVT to 16 bit integer using new softfloat routines 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 Use the softfloat conversion routines for conversion to 16 bit integers, because just casting to a 16 bit type truncates the value rather than saturating it at 16-bit MAXINT/MININT. Signed-off-by: Peter Maydell Reviewed-by: Nathan Froyd --- target-arm/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 2925782..9ba2f4f 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2560,7 +2560,7 @@ ftype VFP_HELPER(to##name, p)(ftype x, uint32_t shift, CPUState *env) \ return ftype##_zero; \ } \ tmp = ftype##_scalbn(x, shift, &env->vfp.fp_status); \ - return vfp_ito##p((itype)ftype##_to_##sign##int32_round_to_zero(tmp, \ + return vfp_ito##p(ftype##_to_##itype##_round_to_zero(tmp, \ &env->vfp.fp_status)); \ }