From patchwork Mon Jan 16 18:34:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6237 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 C988623E13 for ; Mon, 16 Jan 2012 18:34:46 +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 B21B7A1830D for ; Mon, 16 Jan 2012 18:34:46 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id zt4so851653bkb.11 for ; Mon, 16 Jan 2012 10:34:46 -0800 (PST) Received: by 10.204.41.143 with SMTP id o15mr5464267bke.63.1326738886534; Mon, 16 Jan 2012 10:34:46 -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 ac16cs97548bkc; Mon, 16 Jan 2012 10:34:46 -0800 (PST) Received: by 10.68.190.104 with SMTP id gp8mr11300341pbc.46.1326738884336; Mon, 16 Jan 2012 10:34:44 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id t7si25610559pbv.226.2012.01.16.10.34.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:34:44 -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-0005Cz-MY; 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 3/3] softfloat: roundAndPackInt{32, 64}: Don't assume int32 is 32 bits Date: Mon, 16 Jan 2012 18:34:18 +0000 Message-Id: <1326738858-19992-4-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> Fix code in roundAndPackInt32 that assumed that int32 was only 32 bits, by simply using int32_t instead. Fix the parallel bug in roundAndPackInt64 as well, although that one is only theoretical since it's unlikely that int64 will ever be more than 64 bits. Signed-off-by: Peter Maydell --- fpu/softfloat.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 08db899..e4ab9e1 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -117,7 +117,7 @@ static int32 roundAndPackInt32( flag zSign, uint64_t absZ STATUS_PARAM) int8 roundingMode; flag roundNearestEven; int8 roundIncrement, roundBits; - int32 z; + int32_t z; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); @@ -166,7 +166,7 @@ static int64 roundAndPackInt64( flag zSign, uint64_t absZ0, uint64_t absZ1 STATU { int8 roundingMode; flag roundNearestEven, increment; - int64 z; + int64_t z; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even );