From patchwork Mon Jan 16 18:34:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6236 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A580023E13 for ; Mon, 16 Jan 2012 18:34:24 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 95104A1830D for ; Mon, 16 Jan 2012 18:34:24 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id zt4so851653bkb.11 for ; Mon, 16 Jan 2012 10:34:24 -0800 (PST) Received: by 10.205.141.72 with SMTP id jd8mr922258bkc.135.1326738864410; Mon, 16 Jan 2012 10:34:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs97538bkc; Mon, 16 Jan 2012 10:34:24 -0800 (PST) Received: by 10.112.36.8 with SMTP id m8mr3344977lbj.54.1326738861309; Mon, 16 Jan 2012 10:34:21 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id z10si7788513lbd.78.2012.01.16.10.34.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:34:21 -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.72) (envelope-from ) id 1RmrNq-0005Cv-LQ; Mon, 16 Jan 2012 18:34:18 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 1/3] target-arm/helper.c: Don't assume softfloat int32 is 32 bits only Date: Mon, 16 Jan 2012 18:34:16 +0000 Message-Id: <1326738858-19992-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1326738858-19992-1-git-send-email-peter.maydell@linaro.org> References: <1326738858-19992-1-git-send-email-peter.maydell@linaro.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 00458fc..e968c9c 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2786,7 +2786,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) \