From patchwork Mon Dec 11 12:56:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 121393 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2756738qgn; Mon, 11 Dec 2017 05:00:01 -0800 (PST) X-Google-Smtp-Source: ACJfBosTSyoqB3bdZllQ7Mj1glziiPU5VhECpWJIuD2E3fdRY7t3iN/+m1X+I1Fu+4kjhOyj7DWM X-Received: by 10.129.50.66 with SMTP id y63mr196138ywy.490.1512997201504; Mon, 11 Dec 2017 05:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512997201; cv=none; d=google.com; s=arc-20160816; b=sAFqyWamDQaTaxDielmLsIx0zhxndy6vxP04UpPJ3SMskR5CqfrtOConYddzEBXPSs HChw2fXTT3mEX0iaZ36TUmwprOG4QdZ/kQdfujyJhW2tLNseyUCW+BURnul6IaA1rF0v 41OVvvjOPJosV9Bj/qG9WvJ1vk4iUzyzT2o9WTlY9eIY6Pk7DN0IKmQuf3vZfIO6WqY9 8JilgWHDPrCO5N4pthCclueCFUn57y8ntALs7CnKc5bj1fWSEr9Guwj7ahdAvpo2O+xm NrHbqwfD4pHv474Bat7ZVmIpErl2OfJTa3IZpik/U48JRZku4b3LwmEUzElCM9puH0O2 oTbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=WZvri1dDkG2IakN/Qfkr3MWLAtg0qnWiEiEX++bbsGw=; b=AkBHXihCJiv+YgjVlIRsSXlNgf6kYprzPUkiIA+DI0DXMsyjTVtgcclm29DEahttqL 4ennyYMwksiKR9QB7F9guz0blTkzvMsurRzKqTwkJ+0OL2QNXEZwgB7QiYFz8zGAKXFD nzCuDUCrVWbFUK5p6qR0Qx3f1TjTlvvjExD4EhEHTU3wB8vByuIwRUhwOFKV3HOyF1Oy 2tkgSSzZOCV72NPkHTwSBE5eN9XzwE1JarljSm1WEVBvE2ASJYy67LyCcv5qwdeafgdN xV4UYF6ihCKoEWq6EDLsnfoLNIJ61ktpGNFwfgWC1kXK7ocJZmr5jd78UdH4cz2ceTKL P0cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GMegaiGg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i4si2856161ywm.559.2017.12.11.05.00.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Dec 2017 05:00:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GMegaiGg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONge-0003UO-VJ for patch@linaro.org; Mon, 11 Dec 2017 08:00:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONdw-0002JY-6y 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 1eONdv-0007aZ-Hr for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:12 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eONdv-0007Zs-BF for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:11 -0500 Received: by mail-wr0-x244.google.com with SMTP id v22so17487449wrb.0 for ; Mon, 11 Dec 2017 04:57:11 -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=WZvri1dDkG2IakN/Qfkr3MWLAtg0qnWiEiEX++bbsGw=; b=GMegaiGgES4glguOVJzA/BGbdrfptNykTYAvcm8uG1EGll0x+AreKxISvHgVxLB/UL kA/sDho1Axe3oWvJiEkkdT/Hz/ABJiSG79HrwX7CcSCy2qD4KNuA8Ig/hdoo5lSpkfty Y7N35+kTxWIty29V/9jGxwZ26iGX7OGit7m9Y= 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=WZvri1dDkG2IakN/Qfkr3MWLAtg0qnWiEiEX++bbsGw=; b=U4gFfyxMTvOZbN9ezJZ8yXowPi0R878963TtXFHOI6zSotP3igrUdwRS7byCgXMnZp lhpYz9jMwDY2wBaDk9Uj2orpMsXHPA7WPHci8smsWMciOlfItnmRjSpYPafGz1ocsGXY /usOaLgEcvqK4wNNP8X1Y8IRuu5pb2YrQoFwbBXvdEJwF8SqmkXWerYZcjxu+NQ1cgyM bQ9ucBCslX5U8W/BqfurIcoRcqUIKN3EQdYQ7B1IzidXkXKQKt2TS6wqQK9MqSDwlyIR M4+IpxLSfAycB9AYgnRT6QpPr85qiWRfAJgk3U2sPlbBTAIQIry7L5RXb2FfN3r5NP31 Riqw== X-Gm-Message-State: AKGB3mKmW33YSClLGYyA6ZIEjuZY6FV/aXZNIg6eqJ+0n3zCoZNm4bkt +9bmOsNcvOR7ctfM/58KW0Si3g== X-Received: by 10.223.148.199 with SMTP id 65mr332551wrr.14.1512997030192; Mon, 11 Dec 2017 04:57:10 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o10sm16392287wrg.5.2017.12.11.04.57.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 04:57:07 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 99D753E0980; Mon, 11 Dec 2017 12:57:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=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:49 +0000 Message-Id: <20171211125705.16120-4-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 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 v1 03/19] include/fpu/softfloat: implement float16_chs 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_Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- include/fpu/softfloat.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.15.1 Reviewed-by: Richard Henderson diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index edf402d422..32036382c6 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -381,6 +381,15 @@ static inline float16 float16_abs(float16 a) */ return make_float16(float16_val(a) & 0x7fff); } + +static inline float16 float16_chs(float16 a) +{ + /* Note that chs does *not* handle NaN specially, nor does + * it flush denormal inputs to zero. + */ + return make_float16(float16_val(a) ^ 0x8000); +} + /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/