From nobody Tue Feb 10 08:27:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528768747269266.8142365209269; Mon, 11 Jun 2018 18:59:07 -0700 (PDT) Received: from localhost ([::1]:52268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSYaQ-0003dC-B5 for importer@patchew.org; Mon, 11 Jun 2018 21:59:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSYQm-00044D-9H for qemu-devel@nongnu.org; Mon, 11 Jun 2018 21:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSYQh-0003LY-Rs for qemu-devel@nongnu.org; Mon, 11 Jun 2018 21:49:08 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35369) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fSYQh-0003Ix-IS for qemu-devel@nongnu.org; Mon, 11 Jun 2018 21:49:03 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C9EFF21CF0; Mon, 11 Jun 2018 21:49:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 11 Jun 2018 21:49:01 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 8298C10266; Mon, 11 Jun 2018 21:49:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=KzUUdskvRawc5yhtZGF785MSLH EU2vZ9BnuIeu9zUhQ=; b=GBE+vvpiEBwK1ZVuN7CybdjA09CoOFMCpSy0j3XMCM jh9nJL+c/hYOJHa8PditbejReVSo43L3JVzMRq0qN3dNnzyWVgpfDvkaL2+K5aeg CLea3drCMCb5bqcZ8QhBV0AxQlod7ihg7JIDjelogbWAu9UDz9Z6bJ6PCrXreebc 4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=KzUUds kvRawc5yhtZGF785MSLHEU2vZ9BnuIeu9zUhQ=; b=cgVhlTpO9PNp8/xvMSNOh8 QFNxfWQQ9YMvvvsBbFPLKfQpSVUGsFl2djzXOgCQY6CONqMpgyM5FJmH5tHIz9lG lNJnUVTqgQxPaHzAPQMqWvbIK9EoZhgiB178WAqRtBURp4eNpWt+gRTulN1L3XY6 Q6myYaloM4XESaLMl5vvDzu6SMPtr3WxnVjPHXPQ+T+3fTAsrSsMQWN1LePkSqNc W2J3dlh1MqsjBHBnrpJEXfS71mqsO2S5kavXq7qHABfylEWkYfIxDE0h6Q+5CkiM IkhElFSd+7R0kRHME25i3YIqKF7eA/5m4NYEBkvjFTmFJGQxn/jYaZZ131feONjA == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 21:48:49 -0400 Message-Id: <1528768140-17894-4-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528768140-17894-1-git-send-email-cota@braap.org> References: <1528768140-17894-1-git-send-email-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH v4 03/14] softfloat: add float{32, 64}_is_{de, }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: Peter Maydell , Mark Cave-Ayland , Richard Henderson , Laurent Vivier , Bastian Koppelmann , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 This paves the way for upcoming work. Cc: Bastian Koppelmann Reviewed-by: Bastian Koppelmann Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota --- include/fpu/softfloat.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 69f4dbc..1fbece5 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -412,6 +412,16 @@ static inline int float32_is_zero_or_denormal(float32 = a) return (float32_val(a) & 0x7f800000) =3D=3D 0; } =20 +static inline bool float32_is_normal(float32 a) +{ + return ((float32_val(a) + 0x00800000) & 0x7fffffff) >=3D 0x01000000; +} + +static inline bool float32_is_denormal(float32 a) +{ + return float32_is_zero_or_denormal(a) && !float32_is_zero(a); +} + static inline float32 float32_set_sign(float32 a, int sign) { return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31)); @@ -541,6 +551,16 @@ static inline int float64_is_zero_or_denormal(float64 = a) return (float64_val(a) & 0x7ff0000000000000LL) =3D=3D 0; } =20 +static inline bool float64_is_normal(float64 a) +{ + return ((float64_val(a) + (1ULL << 52)) & -1ULL >> 1) >=3D 1ULL << 53; +} + +static inline bool float64_is_denormal(float64 a) +{ + return float64_is_zero_or_denormal(a) && !float64_is_zero(a); +} + static inline float64 float64_set_sign(float64 a, int sign) { return make_float64((float64_val(a) & 0x7fffffffffffffffULL) --=20 2.7.4