From patchwork Wed May 16 15:52:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 136030 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1120648lji; Wed, 16 May 2018 09:10:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr45de2tq/ANzd9MEm4IeVk8vQREGd8ns512Av5Ms9VNLLMalNuyTPxvhIvrih0CpK0/e0J X-Received: by 2002:a37:49d8:: with SMTP id w207-v6mr1430761qka.139.1526487017926; Wed, 16 May 2018 09:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526487017; cv=none; d=google.com; s=arc-20160816; b=DLPjsG9/m19CJIxK/z8KyC/rQbPA5+j5psVY/adtywqxnBbOf5uzNlMiaSndf8YhYf udT5n2IgQxIuCnt4PmItZ0Bo5LOtg/230Newch+mBO83uND26SBIqlKRoE4dEZGcsXAZ aFRuCZknHdCIC+F1lrU5ahAA1mfPJEdb5GtJerqhGuLnA7L2DoBfo5CZzvvroVwRSi7u ALwuT5S76o5pefBhrrpT91TTZedxWXayhQYZoNH9WWgZ/ReUA+tvmC0BBCP4mbKtqmQ5 Op8Ja9bLCwHKh0EiuXTCh4zLbrpxVyeJw7ryldr+W8RvnFzcdqsDmlHjVQHzOCvPGyx+ AkeA== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=69KH6e0KmS/GOAScDljSvnKlAK/69zrvY+8SeGJmqVM=; b=bWmSfmtDKDEDX187MnDHU3itUxxC5YKIb1e5lyoP37nvw2PVnD6RNT17dctwh6+kDv hO6d7VtDBTZ3xBiyeDm/FxXG5+GLhEVCukh4l+Vlwaq64MgVzJFL/P3Fi/Islyjb/z9E X+iv0tXEEKvgk9WkGX5YqcCXQr12GKrTMb2PFSOoBLzwHIOdVnKO/Y7nf1tS6qMj5+wR jaqnMxuSODYhb0ODWT3SjciIimYNpXCa4ACx1UuhKW68r9238auEiKX8+1EuTXaaIGky L5enMilgdhciEUGpNJSogAGO9E+XsUKkLO1QZc5EeXa50zrSYrvc75fvlHS+TjBRUN03 xF5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iRKbVnba; 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 g42-v6si3039713qta.157.2018.05.16.09.10.17 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 May 2018 09:10:17 -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=iRKbVnba; 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]:53226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIz0L-0001Db-8Y for patch@linaro.org; Wed, 16 May 2018 12:10:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIyjx-0004gE-0b for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIyjw-000593-4D for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:21 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:39990) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIyjv-00058r-Th for qemu-devel@nongnu.org; Wed, 16 May 2018 11:53:20 -0400 Received: by mail-pg0-x243.google.com with SMTP id l2-v6so468463pgc.7 for ; Wed, 16 May 2018 08:53:19 -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 :mime-version:content-transfer-encoding; bh=69KH6e0KmS/GOAScDljSvnKlAK/69zrvY+8SeGJmqVM=; b=iRKbVnbaQO1Blcjh8V8vJj2eGQgKEwNI7qw7MAxGls0q0e9Q+24WDjgrxZdzyV9VWi UoHYyknKPWnrJlRQFwbWfPny7wsKrXZPDEy95j4tWi8DD45eXgC8h+jZ1DNQDQpBJPe/ etL/7Ia/48ZBmxaLZPsyMxnwERw+gyleIxK5M= 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:mime-version:content-transfer-encoding; bh=69KH6e0KmS/GOAScDljSvnKlAK/69zrvY+8SeGJmqVM=; b=G1jS10A0Kme4STJEYOAj7fUvuhpgrNi9l+oYGwUgmVOPthyLY35S9hogPjnQcA3CqV X4srXGx3DGc9M9yqiYmDZZp8eK5KORbX5RFczjoPhK96CWJ7r3UeaqLDemo1LrTnJqyM 3jSLYlrkR3PZgBKxzFtuxbJ8WGCn/dp6MLFSrp4dS2cmklNtn1ZKkGMALGzWlDP+zaI0 x8+5nsA0IgWSgwLEV75Z5b2YsGMlzBZg26MYLw1B3itqTXdCmwV6qsV3X/yBIs2wjfSu 1eucgGaQMIfJhHbxVOwTQtDUVYnVORD/2Dhjtbz2R/QuYkMXuszvv0orw9aE+uavvgX0 EwQQ== X-Gm-Message-State: ALKqPwebygbqNrPij2jqmNUjSpuOcpEvLje8BRIZwTB58YBGSNwZ5Lo9 Fb/3lfAJiFCzEIQOdhSu26oWkNBcIJM= X-Received: by 2002:a62:cc08:: with SMTP id a8-v6mr1455829pfg.219.1526485998558; Wed, 16 May 2018 08:53:18 -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 c3-v6sm4966632pfn.62.2018.05.16.08.53.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 May 2018 08:53:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 16 May 2018 08:52:38 -0700 Message-Id: <20180516155243.16937-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180516155243.16937-1-richard.henderson@linaro.org> References: <20180516155243.16937-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PULL 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 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. Tested-by: Alex Bennée Reviewed-by: Alex Bennée Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- fpu/softfloat.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) -- 2.17.0 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 55e6701f26..ea252e0c84 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) {