From patchwork Mon Dec 17 10:56:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 153991 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2343117ljp; Mon, 17 Dec 2018 03:16:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/X/DWMD2R7tepLK8nJ8mzcUETWgGB9HoLxu0SEFWA02m512sRHqwdk54LwgEMphgpnRqVMW X-Received: by 2002:a37:360a:: with SMTP id d10mr11859323qka.40.1545045386949; Mon, 17 Dec 2018 03:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545045386; cv=none; d=google.com; s=arc-20160816; b=elDqIuxZwXWoH3vNc80q0t8ZDK6aWXbAd3mU2+u4as7QdoZm6BKi8z+gWij8wRDzIk 0HnjvAsCB16WNmJ9HY7bgFTvRdLdMaH/j520Pv49CF5wA4lZeBApG9ChAL+wm5xjqotK UnU9IIcp/av0Ec+RxqKcCDXhM4Rbm4sQ5JNIu49TqJG4jUybqZlFr0vpwzgL13348gwf as7d/HKwiZ48tND5fDFxDrPkAkYXgBP9+DKar1FC6cb0D0hdnyH1HSdp2Sj3IJg5Pbor fallVvHZiEVWdMYAG9Eb2lCln6y3E6KTXeAbR1KenIvyVDY1QKzB3kuoI+mA3RJqe5PX 1Chg== 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; bh=fg/ZIxwklhVpkdxua263VSnlqI6ZJvuK+mHRcjFmBvM=; b=RKprIUnyJIzTxAwlFdyKUZE39YTsbgths81HZUGgyz3CHKYd3UAS+Vyzcvdg86Bm8Z 9/iRsj6jGimgy0furKVksKTmu9H9Cq4Ah8smh9ERGM13N8pTobpHTQRCXGc5ZS4rST5g BNSyFKEPGH0VML0iMuW2BvFl5yakfzAQiEAcv6TkvG3XRywGxQFJWbNAtXrmvX4wY665 ARTwTVPjpkwoLnbjnA5K21QpsicJgcBckomuBxiiBh+wG6a8KhJLybl1xGbcgBv36dQM HahGTp5vY7Zt4F+DS6tDCuRmPBH24LuuYqelIjSNtIMkWMhMZhtWcndG4uHVp5f5cias jMmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=V3iLfXTl; 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 h50si2480414qte.159.2018.12.17.03.16.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 17 Dec 2018 03:16:26 -0800 (PST) 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=V3iLfXTl; 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]:45986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYqss-0007Pr-C8 for patch@linaro.org; Mon, 17 Dec 2018 06:16:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYqbo-0002Y7-0b for qemu-devel@nongnu.org; Mon, 17 Dec 2018 05:58:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYqa2-00008m-UQ for qemu-devel@nongnu.org; Mon, 17 Dec 2018 05:56:59 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:32831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gYqa2-000083-MG for qemu-devel@nongnu.org; Mon, 17 Dec 2018 05:56:58 -0500 Received: by mail-wr1-x42b.google.com with SMTP id c14so11796455wrr.0 for ; Mon, 17 Dec 2018 02:56:58 -0800 (PST) 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=fg/ZIxwklhVpkdxua263VSnlqI6ZJvuK+mHRcjFmBvM=; b=V3iLfXTlDUZS2QtAQ1DxNSgIsYyDFZlMu66ijOc/IymzJ77mdUmK2495y8e8d+Ub9m 2oekttfBg5CRcJ+AvdAmurzuiYk78Y3LDaFq/aNnUoj3ax61n5csqE6f5FU22K2+Hpue Czg8Kd6uwAHAAe7y06m/M+dIpD/tQDvCD1P8g= 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=fg/ZIxwklhVpkdxua263VSnlqI6ZJvuK+mHRcjFmBvM=; b=T3f16rfxA3rD6nXT7hE4CbCRBw3DaUGxk9euDRAKePmnofJ/8yu7szTosT/9lPS/gh daY9zva5t+KIxKhs9ddq+RopnUpYleFvMtBjjfN7E1of6uORo/huCnr7UjZkHVeIXpDr xNfPUVa3dU/4uFXWwMQHkU4MSKU/r1LV3DPv4ZXxwHkFzShGY9aOnXawQE/I+4+seO9a GlC/f2dHbimL0Vq5b1FEzgsE3GXlmnRkO4URD3JxIwJ9hTf4QRcWgQHbfFY9nVZfRbb1 WTM+eaf9Hgjfd49+PRdTcw4W8bBtwdmwpQSI4aHmH/Gp0lWP2Q2y65NTItXBMoOEdlz1 sGkQ== X-Gm-Message-State: AA+aEWbqFhUkr2FxXdj9VkQtQjEWzLAjYmE6s6jemm7yaV18gCPWDEYA TMYs9RTD72518jWhkpOGZVDKlQ== X-Received: by 2002:adf:ec50:: with SMTP id w16mr10556453wrn.171.1545044217427; Mon, 17 Dec 2018 02:56:57 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c7sm26586962wre.64.2018.12.17.02.56.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 02:56:54 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 33EC33E0575; Mon, 17 Dec 2018 10:56:51 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 17 Dec 2018 10:56:42 +0000 Message-Id: <20181217105650.27361-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181217105650.27361-1-alex.bennee@linaro.org> References: <20181217105650.27361-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b Subject: [Qemu-devel] [PULL v3 07/15] softfloat: add float{32, 64}_is_zero_or_normal 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: "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" These will gain some users very soon. Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée -- 2.17.1 diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 9eeccd88a5..38a5e99cf3 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -474,6 +474,11 @@ static inline bool float32_is_denormal(float32 a) return float32_is_zero_or_denormal(a) && !float32_is_zero(a); } +static inline bool float32_is_zero_or_normal(float32 a) +{ + return float32_is_normal(a) || float32_is_zero(a); +} + static inline float32 float32_set_sign(float32 a, int sign) { return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31)); @@ -625,6 +630,11 @@ static inline bool float64_is_denormal(float64 a) return float64_is_zero_or_denormal(a) && !float64_is_zero(a); } +static inline bool float64_is_zero_or_normal(float64 a) +{ + return float64_is_normal(a) || float64_is_zero(a); +} + static inline float64 float64_set_sign(float64 a, int sign) { return make_float64((float64_val(a) & 0x7fffffffffffffffULL)