From patchwork Mon Sep 24 16:28: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: 11678 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 A807723E57 for ; Mon, 24 Sep 2012 16:28:40 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4ADD2A18AF6 for ; Mon, 24 Sep 2012 16:28:40 +0000 (UTC) Received: by ieje10 with SMTP id e10so10446028iej.11 for ; Mon, 24 Sep 2012 09:28:39 -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:x-gm-message-state; bh=LC08t1gVu+f+wCNAuv9oTKuqGynlB9AT7KIe+KukkLk=; b=KoaEhj2E+dJ8DwS71uWNA0z+PNGL8CZW1hcAguPlbY1HMZh7vLgalIVzr6nnbgBar6 xqx3VxaK+r1H4lRxLzU/BggYnhEG7693uAyTn/rFU/JPziUMrL7pu3038+HRRlXFOcF9 z4ZWenLIINoPndQt6ftcRFLrXEejHgJeU0pY7V5M3puanzGZYJKUc2ybdJi2vYQaS1iW eQmYVR34Vq/j+0tvH3wnEw4pGs/3fS03Ux5CLMkcXrHpWNj1iamekVo1ELMtZuh2L9wd xK5gwwCh3zW1BbfrpSTkzWHm5jsk8d+WZGeCxutyUIU72P8O/4NCHgjmAcL+Lj7cSl2K In4g== Received: by 10.42.84.69 with SMTP id k5mr10096968icl.5.1348504119074; Mon, 24 Sep 2012 09:28:39 -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.50.184.232 with SMTP id ex8csp251297igc; Mon, 24 Sep 2012 09:28:38 -0700 (PDT) Received: by 10.180.100.131 with SMTP id ey3mr15482914wib.15.1348504117477; Mon, 24 Sep 2012 09:28:37 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id bu3si18922631wib.23.2012.09.24.09.28.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 09:28:37 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TGBWN-0003RO-1c; Mon, 24 Sep 2012 17:28:35 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org Subject: [PATCH] fpu/softfloat.c: Remove pointless shift of always-zero value Date: Mon, 24 Sep 2012 17:28:35 +0100 Message-Id: <1348504115-13203-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQmuiHMncKjIYuvKRqOkyrz1O0bngAcr10foPg3zV7ISyQtX45tL6LIBo5KWVkA6YNPYRx+V In float16_to_float32, when returning an infinity, just pass zero as the mantissa argument to packFloat32(), rather than shifting a value which we know must be zero. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Aurelien Jarno --- Spotted by the clang static analyzer. This brings this code into line with the other float-to-float conversion functions and was probably a harmless cut-n-paste error from the normal-return codepath. fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index b29256a..01a28ca 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -3007,7 +3007,7 @@ float32 float16_to_float32(float16 a, flag ieee STATUS_PARAM) if (aSig) { return commonNaNToFloat32(float16ToCommonNaN(a STATUS_VAR) STATUS_VAR); } - return packFloat32(aSign, 0xff, aSig << 13); + return packFloat32(aSign, 0xff, 0); } if (aExp == 0) { int8 shiftCount;