From patchwork Thu Apr 5 18:12:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 7684 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 C4B8E23ED0 for ; Thu, 5 Apr 2012 18:12:43 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7A114A182E6 for ; Thu, 5 Apr 2012 18:12:43 +0000 (UTC) Received: by iage36 with SMTP id e36so2867050iag.11 for ; Thu, 05 Apr 2012 11:12:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=XHfD3fbpQGj7/FGtXSt1UjBMS4v9M4BlRaOA7vY2rm4=; b=P3fZ1ZSo719P1QAYtmnfI5Z9v23LzVo/vEkgd+f8c1b+0rvHwcyiuxTOKIygUIaXiS cz2tIbxaI0q72kpjRZFQaPWOSBd6mkmFALfeg4ClaJVKyMRDFjRYtTQBqxaNFSauCIc8 LUFdh7fvibPIdkIX8sFEv4UG04fwys2ZmoajvAwJrscBkZiu5e3nAwOh0l6WQDZZ7cdB UnvqI+Px73cvWfTopesma7V+XwaNunlO4JkOAg4LMVED6JH6ox2zaJ0xd+ZSytdFH1FS tKcb+lw89gunSIB+4pzp6uAuxoTuCZb5JN6Y27R/r8tP/RQ7VtLSgcEmsitk/l4uHZ6J B52w== Received: by 10.50.173.35 with SMTP id bh3mr6014453igc.38.1333649562797; Thu, 05 Apr 2012 11:12:42 -0700 (PDT) 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.231.164.217 with SMTP id f25csp73267iby; Thu, 5 Apr 2012 11:12:40 -0700 (PDT) Received: by 10.204.154.83 with SMTP id n19mr1543328bkw.69.1333649559058; Thu, 05 Apr 2012 11:12:39 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id ac7si2729393bkc.149.2012.04.05.11.12.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Apr 2012 11:12:38 -0700 (PDT) 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 1SFrAh-0003lB-HU; Thu, 05 Apr 2012 19:12:35 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH v2 2/2] softfloat: roundAndPackInt{32, 64}: Don't assume int32 is 32 bits Date: Thu, 5 Apr 2012 19:12:35 +0100 Message-Id: <1333649555-14424-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1333649555-14424-1-git-send-email-peter.maydell@linaro.org> References: <1333649555-14424-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmvPDEMGysdgCXAgoDKEghzu8eFVBUKbDvsmEy/eGyJFhu3nQq0pzZkKi259kMI53oLrueI 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 074fbc3..d37090a 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 );