From patchwork Fri Dec 14 13:54:44 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: 10731219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 782CE14E5 for ; Fri, 14 Dec 2018 14:06:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79A782CB6F for ; Fri, 14 Dec 2018 14:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D2EE2CE24; Fri, 14 Dec 2018 14:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 007962CB6F for ; Fri, 14 Dec 2018 14:06:36 +0000 (UTC) Received: from localhost ([::1]:33715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXo6u-0003eA-7O for patchwork-qemu-devel@patchwork.kernel.org; Fri, 14 Dec 2018 09:06:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXnvh-0008Lw-Od for qemu-devel@nongnu.org; Fri, 14 Dec 2018 08:55:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXnvg-0001wQ-QI for qemu-devel@nongnu.org; Fri, 14 Dec 2018 08:55:01 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:55473) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXnvg-0001ve-DU for qemu-devel@nongnu.org; Fri, 14 Dec 2018 08:55:00 -0500 Received: by mail-wm1-x333.google.com with SMTP id y139so5727230wmc.5 for ; Fri, 14 Dec 2018 05:55:00 -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=TsBK99YrdTrfQP2ZZetrV9YJE8LAqOObN6Unu4RtG+aHEImsU6L5pK6LgsyA1WRBGo wrtm4kjHQRPwV6XtinMCmekR9VwiR3auTQzTIk56txCixqlNlXs5jPSWXC2xpAN2e5FH aABl9jq0H12OXymrqNT+oWrrO9nQiWYW3cPzU= 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=KXZnosJbAzuv33n6pwkifQu7Qgn8wyQU3E00VeToKcQDeYG5JN2FxUOwi+ceS9UVei KiTSrzkHWvVNnNGgXujLxuS5LoX4xSjfs4mjy7TXrsgeTKIeRx7Zc8oUNWcaLX40raeQ m/YFedMrtUb/uYwtacW7J+YkR0esoP5SMatm6N3hGMrZzSSp7YR44piarv7S1gg+k31X 8Q7ySSYXZ+Sz7dHbSvfv2PfOMfTtJJOolsJLWvcvtHmD/uO57APJOH6fHMOgZlHbmIqq 0TWeMvRBvKFwUaJLzS+P27w+lgVUxEVZS+Cj6urxInWI+fPYa202eIBjcDubS28HtpCA SiAw== X-Gm-Message-State: AA+aEWZ4WW8CCLjMTTYZTt13MTnknJ+0WBQmijZvrxKKFQHol2D7sZ5p 7p65pXLfb44iLRNPL0vRb7E0fA== X-Google-Smtp-Source: AFSGD/WjiXViIKqF4nILc1eBwfd6pwF68aNI/Z5+n1D+hs6HaEMEAMXq7QqJ6gfUBNBL1FtDQfYgaA== X-Received: by 2002:a1c:5604:: with SMTP id k4mr3218089wmb.107.1544795699137; Fri, 14 Dec 2018 05:54:59 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id k128sm6316222wmd.37.2018.12.14.05.54.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Dec 2018 05:54:56 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 897733E0561; Fri, 14 Dec 2018 13:54:53 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 14 Dec 2018 13:54:44 +0000 Message-Id: <20181214135452.25936-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181214135452.25936-1-alex.bennee@linaro.org> References: <20181214135452.25936-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::333 Subject: [Qemu-devel] [PULL 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 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)