From patchwork Mon May 14 22:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135788 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp206241lji; Mon, 14 May 2018 15:38:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr9+5ZeFfezz6ORZ97rHsWbNTXF9LJL71wqTpzrJcdKpE47noG9PFrhrNYFQ1bKmEgikNsK X-Received: by 2002:a37:1fea:: with SMTP id n103-v6mr10347162qkh.412.1526337528233; Mon, 14 May 2018 15:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526337528; cv=none; d=google.com; s=arc-20160816; b=klaGk9dhdP/ib5YqMWsR8UHHxQLHpzqBy/mZJ1ixKwboHz2T81nKoa4rmXPp1fIEW2 0dAcHtvCh0BCGYTGff5g7kULa9ZeKWJ0s+jU6XZpIj4OKSg0ZWrB/nR962E1f1eMBjcj lFSSZL8ch2ouHIh5xscFKUQjyRtiYFiTvddQgVHNdlS555KCUx65EsBfaXyujU31jjKE nASpoTFAougfpllhWlkW/gz+h4+toDtC/uFblanq6Fsnt4h6wsK1ijiokohqpCdhQ3++ p7uyyUBWJN1UnWoT2UILJi6uqNbGf7pGPcLQNSEVaXqbWKK/v6w8jIeEBbrO6w9tIIf+ 0RHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=pmLpbzFSlcK9txUGPmlidLMrXkASMO30TbCTe2kBrY8=; b=zRmwL6h+vtIhDYe7RT5P7j1OGQu//S5mvJyqUKT+57i2OtptDubx1swi1uN6z/ek4f 39BVBJKrN2lK7MsBBMP4TNHREl64XDF7D87iH0WVoUiAyUDRuw3saDMgEm3iovneW3XV 24COcODETAVhPuXFK921zErTz1CZdl4ln4wAt6QjXTiQeIGlqDbU+DMYBlf+XX4bOW6P CtccSYyNDejX+94LPRdi66N7RuCNeXj5QTAGe9SKZBMr6Q4RxgKjguXqpA77G55MT6tb JYI0xjsgCuu7wlISEgPCwZxIedn+Io4FF5LLGTEUQranbx6eQJQLbjFgRBcqgu8q38bX cW2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QR/7me5H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c40-v6si10529912qtk.393.2018.05.14.15.38.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 May 2018 15:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QR/7me5H; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIM7D-0005QX-Mv for patch@linaro.org; Mon, 14 May 2018 18:38:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fILiC-0008FG-4q for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fILiA-0008OR-Ss for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:56 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:39314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fILiA-0008Mh-N0 for qemu-devel@nongnu.org; Mon, 14 May 2018 18:12:54 -0400 Received: by mail-pl0-x241.google.com with SMTP id c19-v6so8153578pls.6 for ; Mon, 14 May 2018 15:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pmLpbzFSlcK9txUGPmlidLMrXkASMO30TbCTe2kBrY8=; b=QR/7me5Hn9fDOeuw7QuZu/251zQZWmoXsH6cPGv84psG6K4DID5bhMQnPRYvppOkfN Gg0mSSO2/VmlBq07TdJtEBASmZiMrN9zzv2pMtHGhp3skNAZ9qMmTtWyUe0ukWtGLEo6 /8ZMueCT8xmpnQ7bsVV4Lk2vdcud5l+9yWsng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pmLpbzFSlcK9txUGPmlidLMrXkASMO30TbCTe2kBrY8=; b=rOGFH8FL/odfxbArIEiXldMaeEWZE3Oi8KTi49mLAwPZRY5cJlCuKClkgRqSHgU8ve w5tUaIsC3BAS2dVQ1eSTJm5xdJvtehmoQQoUrQhKWrFMXplen/fEQ1cwLHIHrdttC6EK obyBCNILFgONuqiPFI8L9u7rkrD2nDAt+cetLJwuluBAjmPWv0H+kAll2vJAH49Skf6D QxWkc7AjkXXdqy59jnWLcOJYXnKadmc9p71QD3aMxyyEmXvBEDhVbQWTOf+h28/yl2pm ffBf9idI4l+PInK41JTwJUYbjutEyCAdmOv8rq0GclufZUbF3/OLBU8s5gYJ02dvMk8z RB1A== X-Gm-Message-State: ALKqPwfW4Gi1xs0C5THN5UJrXW8zWeM6AJjIvUfSzAAIovHACofWG9rE dTQSSU0S0lkYcJMhXcBZxbQi/Jo6hLg= X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr11372552plo.278.1526335973511; Mon, 14 May 2018 15:12:53 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id y2-v6sm14512457pgp.92.2018.05.14.15.12.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 15:12:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 May 2018 15:12:14 -0700 Message-Id: <20180514221219.7091-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514221219.7091-1-richard.henderson@linaro.org> References: <20180514221219.7091-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH v5 23/28] fpu/softfloat: Make is_nan et al available to softfloat-specialize.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will need these helpers within softfloat-specialize.h, so move the definitions above the include. After specialization, they will not always be used so mark them to avoid the Werror. Signed-off-by: Richard Henderson --- fpu/softfloat.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) -- 2.17.0 Reviewed-by: Peter Maydell Reviewed-by: Alex Bennée diff --git a/fpu/softfloat.c b/fpu/softfloat.c index e9e421728b..9934adbae5 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -181,6 +181,22 @@ typedef enum __attribute__ ((__packed__)) { float_class_snan, } FloatClass; +/* Simple helpers for checking if, or what kind of, NaN we have */ +static inline __attribute__((unused)) bool is_nan(FloatClass c) +{ + return unlikely(c >= float_class_qnan); +} + +static inline __attribute__((unused)) bool is_snan(FloatClass c) +{ + return c == float_class_snan; +} + +static inline __attribute__((unused)) bool is_qnan(FloatClass c) +{ + return c == float_class_qnan; +} + /* * Structure holding all of the decomposed parts of a float. The * exponent is unbiased and the fraction is normalized. All @@ -536,20 +552,6 @@ static float64 float64_round_pack_canonical(FloatParts p, float_status *s) return float64_pack_raw(round_canonical(p, s, &float64_params)); } -/* Simple helpers for checking if what NaN we have */ -static bool is_nan(FloatClass c) -{ - return unlikely(c >= float_class_qnan); -} -static bool is_snan(FloatClass c) -{ - return c == float_class_snan; -} -static bool is_qnan(FloatClass c) -{ - return c == float_class_qnan; -} - static FloatParts return_nan(FloatParts a, float_status *s) { switch (a.cls) {