From patchwork Fri Feb 3 18:50:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 93297 Delivered-To: patches@linaro.org Received: by 10.140.20.99 with SMTP id 90csp726018qgi; Fri, 3 Feb 2017 10:50:03 -0800 (PST) X-Received: by 10.28.211.205 with SMTP id k196mr2558679wmg.124.1486147803500; Fri, 03 Feb 2017 10:50:03 -0800 (PST) Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id e2si33330147wra.193.2017.02.03.10.50.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 10:50:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1cZivq-0002ig-Fw; Fri, 03 Feb 2017 18:50:02 +0000 From: Peter Maydell To: qemu-trival@archaic.org.uk Cc: patches@linaro.org Subject: [PATCH] softfloat: Use correct type in float64_to_uint64_round_to_zero() Date: Fri, 3 Feb 2017 18:50:01 +0000 Message-Id: <1486147801-11445-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In float64_to_uint64_round_to_zero() a typo meant that we were taking the uint64_t return value from float64_to_uint64() and putting it into an int64_t variable before returning it as uint64_t again. Use uint64_t instead of pointlessly casting it back and forth to int64_t. Signed-off-by: Peter Maydell --- Spotted while reading the code... fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index c295f31..218b375 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7386,7 +7386,7 @@ uint64_t float64_to_uint64_round_to_zero(float64 a, float_status *status) { signed char current_rounding_mode = status->float_rounding_mode; set_float_rounding_mode(float_round_to_zero, status); - int64_t v = float64_to_uint64(a, status); + uint64_t v = float64_to_uint64(a, status); set_float_rounding_mode(current_rounding_mode, status); return v; }