From patchwork Tue May 15 22:25:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135960 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp93242lji; Tue, 15 May 2018 15:48:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr+W7+pyQtHIkgCDy7EqIMgy4EweN3+DEmNkmf4fulxqFcFvqFIJv5VuLT53i6f/6e1cg8i X-Received: by 2002:a37:7f02:: with SMTP id a2-v6mr14859041qkd.414.1526424491262; Tue, 15 May 2018 15:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526424491; cv=none; d=google.com; s=arc-20160816; b=TtqU+wpSEy2z64+UJ/8Cw//QrR5Qi+IQZsSpOxNdzHLaHuYYGqRAieQQSb3XpcJFfd kfr364XeSZBIW0+GXu5HRcDljWuHaztDbraR9s6hJb/tg26ZaBRCK8lo6WU6mitc9i67 kmS1szKzWdOVme2zQ+u65Haet3ouT5AA/eFDZ8Nj3lOxB0mMUNvHoRi+2hpktlKH0AR8 y0HsV9K+NwxuiM5wy3AUDnXRMsq1YRK+YGKCX/n0ceBqSTJpIq2HtMy3xBsPrt9Am/XU hrNFU41ERuhei75NnjqqVtYOX5f+Dp/snz0pEN+sP3SlIPMLiUIvdXVUerYjNO1jDbVm WA5Q== 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=ZdAL+k/0jt62W+JzkjVmDzFB+4HgXU67ml+EKqjjY0aqHbvHXDcnqvyocWhaX25ZKf 92Qbd/g8Mqc6RbkCAvfHU552cUbzKpg6YG8VW5nm29YwgSO3LAzloQu7rQPPZDBVy7r9 l7erqM5fOV4wZOh+M7ZxQImu+T1nqq9/ZHH1TVWbHKBLOqW7QOktI/sdnpFcQ2OQcFXI IvnJgJKiwm73RQskT3gJlORfHIu3Mh80/eA5u6UIhV/PCIZbaJOd/9cbwOQVLcRK9dWs IpRi6H8u+azkYzVO+w0vHx9yZ8BjbZkJrLNz0i5SGSgIZ4p4fdD5/rkdy3jPiWK32EAA ZquA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=bFp9Wkde; 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 12-v6si1143692qtc.338.2018.05.15.15.48.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 15 May 2018 15:48:11 -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=bFp9Wkde; 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]:36926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIijq-00042d-QY for patch@linaro.org; Tue, 15 May 2018 18:48:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIiOi-0003ho-NE for qemu-devel@nongnu.org; Tue, 15 May 2018 18:26:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIiOf-0007s6-Ak for qemu-devel@nongnu.org; Tue, 15 May 2018 18:26:20 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:35165) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIiOf-0007mL-41 for qemu-devel@nongnu.org; Tue, 15 May 2018 18:26:17 -0400 Received: by mail-pl0-x244.google.com with SMTP id i5-v6so870321plt.2 for ; Tue, 15 May 2018 15:26:17 -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=bFp9WkdeNIlJNVtQmBjEZ0ulT8QovOgNVU3//9pLDGW4RV9CXtyTfw2CP3CB8bKDjf i1Ygl/1RjsYB1flATX/BMJPrnfaqQyy942wm4JesQIYZ4ZWyy3lmzlnf9mzq1GbvEmVJ avmiF7hsM1qwp7gBjT7Izz30iySatmdugcwzI= 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=ohQFoPMaFPIC7YfsPzoxowAFwVQa3znPW2NRr/q9sA7YfvoPvkN3Qmkfz/0sU1ZLrb ZouwQa+XBcLJsG5caSVtl0764rurFzGW0bzTHLfiksXyEhQVKtK5yxCSILQWBmoddRA1 hT2H/oBqYzDYDCygnFW3Mrs4wkRn3Qpc4V3zhpuQbnjuaWeobOP7nwkDRgtw5Xvorx8/ K+BP/8J3IB6WfTp44VI9FGim/wgkjlArLjlv/dtTzvhPWl81suU5vqaierkogz5PW3A9 PG8n7/a5pHpTO78AKwJvEVDPbCJ7KIXa/R8zNMqD4geYokCel+I0w52p2uT42r32zS+/ i/xA== X-Gm-Message-State: ALKqPwdw4+wFBQqEZidjZfNTOn/+yL0DIXpUBJh1f8BZiZkSiluKbNKp +SnbEJBPQGlEIrSMeuyvUG1oimIlOK4= X-Received: by 2002:a17:902:6006:: with SMTP id r6-v6mr16006071plj.70.1526423175924; Tue, 15 May 2018 15:26:15 -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 g11-v6sm941419pgq.62.2018.05.15.15.26.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 15:26:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 15 May 2018 15:25:35 -0700 Message-Id: <20180515222540.9988-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515222540.9988-1-richard.henderson@linaro.org> References: <20180515222540.9988-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:c01::244 Subject: [Qemu-devel] [PATCH v6 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. 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) {