From patchwork Wed Jan 25 15:27:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 137782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C45CB6F65 for ; Thu, 26 Jan 2012 02:48:32 +1100 (EST) Received: from localhost ([::1]:38633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4lo-0005xY-KN for incoming@patchwork.ozlabs.org; Wed, 25 Jan 2012 10:28:20 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4la-0005OX-Tw for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:28:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq4lO-0005i7-7X for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:28:06 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:55085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq4lN-0005hb-BJ for qemu-devel@nongnu.org; Wed, 25 Jan 2012 10:27:53 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Rq4lF-0001Yt-GC; Wed, 25 Jan 2012 15:27:45 +0000 From: Peter Maydell To: Aurelien Jarno , Blue Swirl Date: Wed, 25 Jan 2012 15:27:42 +0000 Message-Id: <1327505265-5976-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1327505265-5976-1-git-send-email-peter.maydell@linaro.org> References: <1327505265-5976-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: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 2/5] target-arm/helper.c: Don't assume softfloat int32 is 32 bits only 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 In the helper routines for VCVT float-to-int conversions, add an explicit cast rather than relying on the softfloat int32 type being exactly 32 bits wide (which it is not guaranteed to be). Without this, if the softfloat type was 64 bits wide we would get zero-extension of the 32 bit value from the ARM register rather than sign-extension, since TCG i32 values are passed as uint32_t. Signed-off-by: Peter Maydell --- 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 f11279e..f6e998b 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2785,7 +2785,7 @@ DO_VFP_cmp(d, float64) float##fsz HELPER(name)(uint32_t x, void *fpstp) \ { \ float_status *fpst = fpstp; \ - return sign##int32_to_##float##fsz(x, fpst); \ + return sign##int32_to_##float##fsz((sign##int32_t)x, fpst); \ } #define CONV_FTOI(name, fsz, sign, round) \