From nobody Tue Feb 10 22:18:39 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; 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512997165702287.9290936587563; Mon, 11 Dec 2017 04:59:25 -0800 (PST) Received: from localhost ([::1]:52586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONfs-0003Tq-Tw for importer@patchew.org; Mon, 11 Dec 2017 07:59:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONdv-0002JU-Uk for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eONdu-0007ZG-9G for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:12 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:45377) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eONdu-0007YG-32 for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:10 -0500 Received: by mail-wm0-x243.google.com with SMTP id 9so14236012wme.4 for ; Mon, 11 Dec 2017 04:57:09 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o88sm19867994wrc.10.2017.12.11.04.57.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:57:06 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 886953E0620; Mon, 11 Dec 2017 12:57:05 +0000 (GMT) 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=u5wQ9RSdeDG1Nh66eJT3Ak6Ya8mFr9eGwuAxMU+ctEc=; b=D3hLtmfsFjL4E5J5x2LNzfNQv7/V3W6XsH0NfTJwcVzZureJwgFY2kCsK/RIjaMW2v inKqvfvmpqY077tSwwQ3MgCRp+mp+GoeQpJlFhiIGmaOueOgsiuUjGQg9VKVlJZ0Z0JW Vr0P/SXzbyvPm1ENhYPUUb8txADsXVniUdtuI= 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=u5wQ9RSdeDG1Nh66eJT3Ak6Ya8mFr9eGwuAxMU+ctEc=; b=AOVYcCZyjlWt/kT3d0vnYntB/a8xC7f/tosiVjQK4GPzgsXg7eTbbYUn5eijBOwqMH 4S0UxGysKbnlJrxoXBzpGQGRf7KMlup8CUQMGtniqA/4jrvwc0Ez8K8zLjEh2ydMbjck esdCAs3E4tsQyAz6q1gVwXAolq/kgewAsCBEtjvAEj+cu8heq3xBxTdZeJirkNiAgZTr 2NAwiaFyrdoGnE5CfJPMMAd8r+3XuS+Ktq3Oey0eGgOL9YX22X38RrGM3bFSom/apwjx +yRGSn2BuFlynjMfF3g2qeUXrkOQxmrvjqkGIlKycgwiKDOYPmRrFg/EyxlOzsDERKyX nyJw== X-Gm-Message-State: AKGB3mL81FpPaIRjnRmghOn8OLDF0vit0wvqOo+BHZvsH/6LcGcCT2GU S+VIIy0yBSg96owsDni/PYeZwg== X-Google-Smtp-Source: ACJfBov7H4bAeYWdEtwhlh473mxgScAgzQHRpE71giwKUY7TdAgK/GH5D9I05PjUKgb14mWBsJrz9g== X-Received: by 10.28.54.207 with SMTP id y76mr800617wmh.94.1512997028895; Mon, 11 Dec 2017 04:57:08 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: richard.henderson@linaro.org, peter.maydell@linaro.org, laurent@vivier.eu, bharata@linux.vnet.ibm.com, andrew@andrewdutcher.com, aleksandar.markovic@imgtec.com Date: Mon, 11 Dec 2017 12:56:48 +0000 Message-Id: <20171211125705.16120-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171211125705.16120-1-alex.bennee@linaro.org> References: <20171211125705.16120-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::243 Subject: [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno 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 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index d5e99667b6..edf402d422 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -374,6 +374,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.15.1