From patchwork Wed Mar 21 20:11:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 889046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=braap.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="UOoZv04G"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="hFobb4tt"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4061FD5XpBz9s0p for ; Thu, 22 Mar 2018 07:12:47 +1100 (AEDT) Received: from localhost ([::1]:57117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyk6H-0002B6-Gn for incoming@patchwork.ozlabs.org; Wed, 21 Mar 2018 16:12:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyk5V-00029x-V7 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:11:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyk5R-0000yy-6f for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:11:57 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53301) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eyk5R-0000y4-0N for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:11:53 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C627A20C2B; Wed, 21 Mar 2018 16:11:51 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 21 Mar 2018 16:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=tSx/mS+tOkT0qr FlNGeSdHUK1T5YsIS7exhwkkK1Cfk=; b=UOoZv04Gcu7mfMSAQDpY0fenzIlWpm ZkBGpPJ3XAZSTP3e4EGGXYymrtuRfP6gnkgpVCaIOPdMSA060iDdkXAMZQL4sK3y ipsJ+8wGZF9J7TMIPr4ZLq6ZsqZyaH6wsBRM5W5RB7aR4+iFhY8k3qDUu3MfHFl1 ne+mga9caoX0U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=tSx/mS+tOkT0qrFlNGeSdHUK1T5YsIS7exhwkkK1Cfk=; b=hFobb4tt /Ufwn/jHbEEQSQLMAJEb06OWLuDRji9NKHA9yklPNVyoIAgNEZugZpF4bcTHR/vW GhxqjLhSCSFpAjKRLUr8WCxmHPPNM1uP0iG6zp+a5CTQeZAt3Ro6S9Lcka1NP5iU C0yT27Go8cbW4i2sWUVS0pUYH8OJJ19nqd5G/AYznCrQ3/OXRr38e4/FvYpgwqCu M7NgWdHyKIFBv7WyLeA9K3SuPepfG8fxYdVooWAaUKsT+Ya3VWvqhfrhn3iw/WYY lLPj74xAQrgfrIq+BUK5pXhnwdicWzLg+/HnX0gz49OFgihSp/bjfjVwq41kLpyn 2Retn4ACXa+32g== X-ME-Sender: Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B7A4240B3; Wed, 21 Mar 2018 16:11:51 -0400 (EDT) From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Wed, 21 Mar 2018 16:11:41 -0400 Message-Id: <1521663109-32262-7-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521663109-32262-1-git-send-email-cota@braap.org> References: <1521663109-32262-1-git-send-email-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH v1 06/14] softfloat: add float32_is_denormal and float64_is_denormal 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 , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This paves the way for upcoming work. Signed-off-by: Emilio G. Cota Reviewed-by: Alex Bennée --- include/fpu/softfloat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 7b9d31c..8fb44a8 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -417,6 +417,11 @@ static inline int float32_is_zero_or_denormal(float32 a) return (float32_val(a) & 0x7f800000) == 0; } +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)); @@ -551,6 +556,11 @@ static inline int float64_is_zero_or_denormal(float64 a) return (float64_val(a) & 0x7ff0000000000000LL) == 0; } +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)