From patchwork Tue Feb 6 16:47:59 2018 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: 127026 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3087158ljc; Tue, 6 Feb 2018 08:48:58 -0800 (PST) X-Google-Smtp-Source: AH8x225PF9rCEC+V1NdQFnDk+e4NIGnt57fLkU3r2jw2owWrhvxvj9XoCoKBm3FJZYRYEhMpt5A/ X-Received: by 10.37.244.71 with SMTP id p7mr1818824ybe.264.1517935738305; Tue, 06 Feb 2018 08:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517935738; cv=none; d=google.com; s=arc-20160816; b=nbF0zEL7TMt1wqafZ420mSEmWmE6+tgpbG7MZR88JjY1AISWBcbrHd1T1pBMogycgU 9VXjzY+x08WzkFlcp0AwxFGUzO+j2FZgcWle41GAvILO3aR52BSKAUS/x/e/N6Xecnxi KpVNdvzMoJuMXupdMVAnJ92G97dKCpvXwmqWFnuy3FqGy99/GKFDmgFqOrobthTrfSFW U6zKuvPGGB4svGaeo7M5vzx/yub49En03IaOwEiBfYc+0JEhWwkRJaA0Rmxfsg1HdQ7t vp0MdppulZ/Q2lNzAExFVhT4pk5cAuvmRrz/aQOGoFuyUF9c4kVEbF7X1z+m6azgEepj cbrQ== 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=bPH2w3PfFpdRcohbDu83KT6KDKSPHYODix9ErvUA+Fg=; b=qHta3om8fcMAiRi/8wu5nG/XQ5tqyC5y03lUgSjZYZ9SwduD5UWDXp+ZDo9BtzHN7v AZerYZEx6l5DSySi0SNBnK4ulVnf9/Ys8iYpihKX1lnm828LaLgEj2b0Dt3ANTFf8Uwv 8NpGtTZNh22f1qVMT8SeLUFVPB7kFKTGQ06NLCewZbAprr8Koxx6QNkHBkjXsc5udQCI GAPt5GJtIzJxqZarpMAuZR+KubktyWQ0ijDRcduJgongXqmBgE5WIRKkDNkdKRQh3BHR xl9fWCyk8vrj/D+irpwkjHS2q24FFIDnxOrk0xgB/SQMczA1HV788oLl22mHd5TKix7y ZpUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Zdnz3y/a; 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 u15si782416ybj.430.2018.02.06.08.48.58 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Feb 2018 08:48:58 -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=Zdnz3y/a; 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]:37440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej6QT-0000XI-MQ for patch@linaro.org; Tue, 06 Feb 2018 11:48:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej6Px-0000VM-8q for qemu-devel@nongnu.org; Tue, 06 Feb 2018 11:48:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej6Pw-0004pq-Gr for qemu-devel@nongnu.org; Tue, 06 Feb 2018 11:48:25 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:39879) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ej6Pw-0004o2-A7 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 11:48:24 -0500 Received: by mail-wm0-x244.google.com with SMTP id b21so5127961wme.4 for ; Tue, 06 Feb 2018 08:48:24 -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=bPH2w3PfFpdRcohbDu83KT6KDKSPHYODix9ErvUA+Fg=; b=Zdnz3y/a0bEZz3T6ywMOO5g0Dhi1EHPXLH3f07z1XSr6hkcNn+56LDZ/hJAZzSR+Ml 408TRUQTbri/QYZIJ+EABFLV2iTiyY4jPcnYD6i8F1GemagWeccmVaXn9DXgVbTJm6cF 6K2S9Zsin2qLsva6q2AY9yT/Pnhni6mdB8ekU= 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=bPH2w3PfFpdRcohbDu83KT6KDKSPHYODix9ErvUA+Fg=; b=FbaLevVZawAMWPClX1yTFpLtyx6+WYi2xtcKWI6Uc0PJgAHk9H4wrf+AM4+GOgfbzS TJ0nqp2YkJvFp/mJ2U+wC913bxts246S/mPKglEHkCn5fgWcEkcOePQ0umVsE/KvtUnq waRA9krYz+DB3p0/QQaEiE5rePmm6H5637/mFjcrDxUYDrM6OJigyNkUcOik3G78dLh9 s4On4usimLDpHNtPu5CPdYzDj9NAe3sBwfFghiugmjH9Kq6yREDUellEDDYUr+eVm/a1 57OiMp0Xe83Hcerhwv3OmFbYF+ZRppe3o8D+VjJX43hSBdVpts8bwJuOywCgQr9jZ6K/ HPbQ== X-Gm-Message-State: APf1xPBKW1xGzy+hSLTT1GnbMFfqPqArQSOR+uhN/XrdbzIerYYLEFg9 tfFQ02wR83wFA7O0ozYY/uL7vw== X-Received: by 10.28.177.7 with SMTP id a7mr2305755wmf.143.1517935703182; Tue, 06 Feb 2018 08:48:23 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g8sm23408356wra.18.2018.02.06.08.48.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 08:48:21 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B8BA73E0633; Tue, 6 Feb 2018 16:48:15 +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 Date: Tue, 6 Feb 2018 16:47:59 +0000 Message-Id: <20180206164815.10084-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180206164815.10084-1-alex.bennee@linaro.org> References: <20180206164815.10084-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:c09::244 Subject: [Qemu-devel] [PATCH v4 06/22] 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 Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- include/fpu/softfloat.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.15.1 diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 1d34f2c3eb..f75aa59100 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -272,6 +272,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. *----------------------------------------------------------------------------*/