Message ID | 20180124131315.30567-6-alex.bennee@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> 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=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hjyqoa+W"; 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 3zRQv752m0z9s4s for <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2018 00:27:15 +1100 (AEDT) Received: from localhost ([::1]:48582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>) id 1eeL57-0005Ky-Ol for incoming@patchwork.ozlabs.org; Wed, 24 Jan 2018 08:27:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1eeKrk-0003G2-UC for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1eeKrj-0003jg-Tw for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:24 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:42081) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1eeKrj-0003i2-Nq for qemu-devel@nongnu.org; Wed, 24 Jan 2018 08:13:23 -0500 Received: by mail-wr0-x241.google.com with SMTP id e41so3975848wre.9 for <qemu-devel@nongnu.org>; Wed, 24 Jan 2018 05:13:23 -0800 (PST) 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=6e42PntWcXp9kup69M+lCg5U5Wv68rh4rND0cf5yMTw=; b=hjyqoa+WGmWubpmR71RJmzw7WGnR8yCNBnF5Y/jXr91pTHzONBQkuvipWBAJbTUGS4 6CKxqrR2IknXhXN9rTws5NPHHip7eVFNgPpDz4BPS3VheihLJ4XZiGIvK9iYZPeulB1L /zZZrf0DN7fJACU4ESRCtzrRgm76vKN8e/w10= 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=6e42PntWcXp9kup69M+lCg5U5Wv68rh4rND0cf5yMTw=; b=G1/hdmft0aK6ID7P+heD+OBelEz87Nkqnny7Mfs+E5+i7koJp+8X4bpEVa4Op5W45l nC8q53sYvqlvS7VoHCWk/FNojouoci8JYKRGhl7JmSH6721O6FXHJ2iGQgwpRKxJn/3y ROwRmK4ArbLCvI85wGVu58Qp4abQfL9n24hyyUHbmSZMl9cg34faA9zdY3LSpiE2Cjce ysQ2wjbFYwXLFs6QWDLph0xTMrDX0KIG/Tw0pEmMcNtK47PywtasUszPS1K9w3s7vPIJ Vd9FrDIBmfCJnD7PDWaHmtBlQxYK6FOBSL0hf77JII69+//sFxGmhK+KEmvccXOkCcMw uAeA== X-Gm-Message-State: AKwxytcGXl495sNuur3IUu1Lf17Guodv9C0zjAD6ZNS6mB7RXrdyPne8 G4/3gRQvRzK5GlAeiVN973drhg== X-Google-Smtp-Source: AH8x227JbE1f9OKiFQisM3MdD9pDOLTwPYZP7KADoyB2dOmqyeuoXRbI8/OmGO4brhJjbmmD33Js3w== X-Received: by 10.223.200.141 with SMTP id k13mr5478250wrh.216.1516799602668; Wed, 24 Jan 2018 05:13:22 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h194sm506375wma.8.2018.01.24.05.13.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 05:13:21 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 0E9173E050E; Wed, 24 Jan 2018 13:13:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: richard.henderson@linaro.org, peter.maydell@linaro.org, laurent@vivier.eu, bharata@linux.vnet.ibm.com, andrew@andrewdutcher.com Date: Wed, 24 Jan 2018 13:12:58 +0000 Message-Id: <20180124131315.30567-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180124131315.30567-1-alex.bennee@linaro.org> References: <20180124131315.30567-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH v3 05/22] include/fpu/softfloat: implement float16_abs helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net> Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org> |
Series |
re-factor softfloat and add fp16 functions
|
expand
|
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index f3b9008f78..1d34f2c3eb 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -265,6 +265,13 @@ static inline int float16_is_zero_or_denormal(float16 a) return (float16_val(a) & 0x7c00) == 0; } +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. *----------------------------------------------------------------------------*/