From nobody Tue Feb 10 12:39: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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515500693714566.135402459969; Tue, 9 Jan 2018 04:24:53 -0800 (PST) Received: from localhost ([::1]:49439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYsxV-0007gg-KI for importer@patchew.org; Tue, 09 Jan 2018 07:24:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYsvj-0006ZF-TK for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:23:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYsvh-0006J7-ME for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:22:59 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:40434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYsvh-0006GN-Fh for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:22:57 -0500 Received: by mail-wr0-x244.google.com with SMTP id p17so13914631wre.7 for ; Tue, 09 Jan 2018 04:22:57 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 67sm17436758wmq.38.2018.01.09.04.22.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 04:22:54 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 60ACA3E2A7A; Tue, 9 Jan 2018 12:22:52 +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=87/TgytgcRnsZ9ORu6HegwY7s5qXzy9GuhJ9dMbtH00=; b=iRaPK+FcwQ3v2rVbM7YX4acnfLIg9EpUuHJwGySsOLq2EAPmQi5OaY11p2e+vHamAh IGdh6nVLaECMPJ5biYrydtqF8QJLb16AZiFTU3/SupXS7vhY1KR76LMQO8W7WynWYQ0B vvmEaOOxhHBB9/4WXdJvRaGj9JNdq6mo7eqHM= 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=87/TgytgcRnsZ9ORu6HegwY7s5qXzy9GuhJ9dMbtH00=; b=k/Y67SXlVbYOrHXkdAfNYwChWqN68CkO3rDscgL9vji8FeJnettfrbXcHgGgaD9AFi cHdRyzon4ogM6+2QXq41OrsjIzFt0LfoiTCxTkuEP1z8eFhASOfhsJhPOWu6Kuz3fa0S 8YmLNIGTqWVwSjvCYyDV+PsIOiyDW0c0NcURu5rAxuZEMCOhvLVmc58VTohXKqaPWiUC HSBdjcrRlmikzyy8kwWuIhuknsMO/6MEWaVFlLv24V0WlIDpIAwFRKL4wy9HHC+ctrK4 KVHLvgc7QKBqHgA3yaI9kHZG4PvnJtTrCsLNhQtB5a+G1aVNcoGkI3Jv84EQF9uykHuN M7mg== X-Gm-Message-State: AKGB3mI38koaR6I//Ch7d0a3J+n91P04Zv6t9as7UWlyyTaIr5uYKK9m ysXMGf85wnJpSXkniBEuFAdlEQ== X-Google-Smtp-Source: ACJfBoteP8lxB2bPqX7OIeacauN0FeZrbj0YC89hGWmT6BF+4rFN8oV4OvxB6hgjJrxiZVvFvXuQYQ== X-Received: by 10.223.134.26 with SMTP id 26mr12417119wrv.218.1515500576407; Tue, 09 Jan 2018 04:22:56 -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 Date: Tue, 9 Jan 2018 12:22:35 +0000 Message-Id: <20180109122252.17670-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180109122252.17670-1-alex.bennee@linaro.org> References: <20180109122252.17670-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:c0c::244 Subject: [Qemu-devel] [PATCH v2 03/20] 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 Reviewed-by: Peter Maydell --- include/fpu/softfloat.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 52af1412de..cfc615008d 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -347,6 +347,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