From nobody Fri Dec 19 19:14:25 2025 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; dkim=fail; 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 1500566317767465.69376881498647; Thu, 20 Jul 2017 08:58:37 -0700 (PDT) Received: from localhost ([::1]:38588 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYDHW-0004Ge-BC for importer@patchew.org; Thu, 20 Jul 2017 11:22:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYD88-0003FV-Dq for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYD87-0004MX-Bx for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:44 -0400 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYD87-0004M5-5l for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:43 -0400 Received: by mail-wm0-x231.google.com with SMTP id g127so29907870wmd.0 for ; Thu, 20 Jul 2017 08:12:43 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m196sm2287730wma.17.2017.07.20.08.12.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 08:12:38 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C97413E0BA0; Thu, 20 Jul 2017 16:04:33 +0100 (BST) 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=MoxUR3jb2AiAmcpq6C4DGSMSBaymoXoECdfJljecjbY=; b=d6RdcFwRipSR11Fn0Zr02qiI+nkOmv1+3l8GDjTLpfxfLRHDCZL4rS3aLBgIJwaOXq n6ClX9xU8z6NEciO/rdabRyRVzop+TT6EWc+rf8L2QgLearG3qDj/rqWzPHcj67S8SXU nZSiqLV6iOruG5CgZHfkDHEauZcedW9unUBJk= 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=MoxUR3jb2AiAmcpq6C4DGSMSBaymoXoECdfJljecjbY=; b=Bgba0q1axy6AgzcmZEXzDjMmb+qVh9Oy/9NIBuFEHv7/SvwR54DwWDrRZ8NH595iJI /JAE4aaqWotMUtLqglCR/LBeXNIujoYveRomEW2iUq5fwSYjjKa+RasGuFeTnbN3jlsB rcIPhUFjrtbiAyE/tRCBTvg7Z7Li9AnTSLp+5D+I0i7lYrhsNo3qNeGmtzS2wGVxxM06 Oa2mW7fydSLaLxbmN9VLPCuGZSiz+0tE+Rvdnmwb3qS2GgcEEbH9qST+DN8T8RLqiWLF bJuyHCEItucsYN6EhNElfpDQG+dO7HMz+tT/0Q9KWIHCl6Aai5gs9sJZ32asU9+L0hpm h4uA== X-Gm-Message-State: AIVw111wLxwJwCjYRndLd+6tk8W/T4LZ9ThgZ895GPhvQLK+kjw8sgg5 LUEcorGW2Og1HkSw X-Received: by 10.28.217.207 with SMTP id q198mr2596270wmg.45.1500563562112; Thu, 20 Jul 2017 08:12:42 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 20 Jul 2017 16:04:22 +0100 Message-Id: <20170720150426.12393-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170720150426.12393-1-alex.bennee@linaro.org> References: <20170720150426.12393-1-alex.bennee@linaro.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: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16_abs helper 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: qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 This will be required when expanding the MINMAX() macro for 16 bit/half-precision operations. Signed-off-by: Alex Benn=C3=A9e --- include/fpu/softfloat2a/softfloat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fpu/softfloat2a/softfloat.h b/include/fpu/softfloat2a/= softfloat.h index a274dc7419..3cb41977d8 100644 --- a/include/fpu/softfloat2a/softfloat.h +++ b/include/fpu/softfloat2a/softfloat.h @@ -379,6 +379,13 @@ static inline int float16_is_zero_or_denormal(float16 = a) return (float16_val(a) & 0x7c00) =3D=3D 0; } =20 +static inline float16 float16_abs(float16 a) +{ + /* Note that abs does *not* handle NaN specially, nor does + * it flush denormal inputs to zero. + */ + return make_float16(float16_val(a) & 0x7fff); +} /*------------------------------------------------------------------------= ---- | The pattern for a default generated half-precision NaN. *-------------------------------------------------------------------------= ---*/ --=20 2.13.0