From patchwork Sun Feb 4 04:11:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 126801 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp925650ljc; Sat, 3 Feb 2018 20:18:09 -0800 (PST) X-Google-Smtp-Source: AH8x224nyfX1TLOQtNfXRvfJR+6KB2qpq9FKCeUSza85soIqKXemOJ+0wmWfHIvYikYdwPqk4SIw X-Received: by 10.129.37.5 with SMTP id l5mr29337720ywl.161.1517717889404; Sat, 03 Feb 2018 20:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517717889; cv=none; d=google.com; s=arc-20160816; b=PpzGp3mhYJlDUutIHaas5RIXeuX/M2b/XTMC5bvATw1nknocgF4U3zpqtbe0j75Yme W8CbhmqqXOJipyN75fLOrEgUFgisr4Qb04q2qrkAemAMgadjKsqeVZ0pvCedIBeggO8v w5XgDrjxhSWRqwyHeAkPB/tRmi6SpmreQ4L2RCrvIhnUJVuIR90AdZYp9MVP1ttNAlEw 0LQD9MMGDMuf8qFXYV++qBMxCoVNFPZfIZ8On+cnLol9cYMgBn+8ZqtLXopq45XM08dG Mc7MPOGPMPXzNG4BYqmmH1ugYrTc9jBuW/W9ITYBWerTOkutqB47Ya0BvOYM3ZT31N1e 12hQ== 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=vHPnIprtX/tb6NYsozovplAJVcOT+i+E13slBVdPE64=; b=xB+5lu6ODLOfmickppAJ37rpvPpyFSJ8VeMm7ToTnLaAWSBZ8is07Ciz1izOYTWCDf NcWaSIttLt/x8Ri9c4xDxbAYvSTyBLjI+2cDK7ll28MMed3NH0wseizqlzYsvFP3BLxB Vl+ntkxYgiNX/FuMHqChM8mBCcxZPGnQnHLIR1reG3lgAxEPpRJXE9N/tbLmUWvbXq9z XG/eYT2bfWPEvGn5mRtcFTE4Va7GXohAf9bcjFip4eKoUzbH9EeO5MLqdgv1D6G0Zrgx +pKnFcLFmDRuF3fkakQwjv5szIvetswVFqP3k6lygyv0OnMMbc9FDXRzOpMOISbGubrD 1v9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OhOutUFb; 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 202si1015104yws.623.2018.02.03.20.18.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 03 Feb 2018 20:18:09 -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=OhOutUFb; 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]:58276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiBkm-0001PR-P6 for patch@linaro.org; Sat, 03 Feb 2018 23:18:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiBeg-0004Wb-LE for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiBef-0004rI-SZ for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:50 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:34684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiBef-0004qv-NH for qemu-devel@nongnu.org; Sat, 03 Feb 2018 23:11:49 -0500 Received: by mail-pl0-x244.google.com with SMTP id q17so7155990pll.1 for ; Sat, 03 Feb 2018 20:11:49 -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=vHPnIprtX/tb6NYsozovplAJVcOT+i+E13slBVdPE64=; b=OhOutUFbr5nI/h9cF1STq+YGaJSeBpAWwMYvM2RpMrWtvjIxAOM22Q2i1FfdaziGjE mMaAzHz7q5/XVFT4Vawk++qFDvruPnlDgd6tV0leKKy11PzjfCItGCfJLOz4fN0c+cLJ +8CHniwWEjhzrax7CrlL6E3FNj3CakeSc+1SY= 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=vHPnIprtX/tb6NYsozovplAJVcOT+i+E13slBVdPE64=; b=RmnIXzY2SnTPqSvks+IfsnUCREnECjiG2EjublYMfxo9dvowh5STvF5Xczsjhwjzv3 nVzRLysASYdqrZBJMkksEMTRijIYCxl1pQObpkcogDOoVGcYsiMYQDLdFQI5HIrPcW+l Tz2hmyGJ5QPDoKdBdowBtJ81PGJgH5unkBqPk6TiQZr8pJqvZWL6rsSw5hDYuQwDTudO r94Tkok+MjyMeV3cM5yoyLyEidLUskcYlidV4IT06vUIZsWbfxx05uGFEcOzWjqXOnd7 EQ8F/hVjRS5f/O2mC2XwObxMq0FtEFvxogAv9kD/vFIByQctsKQQAGpoSs0ten3ybNPz GzeA== X-Gm-Message-State: AKwxytfrWKzH8ij6DXZTgqVxG2e85T0m3riIbDKSN0qVSRs1myYbtjAK e/EI5b1ZY19Yn1dncrNUUS6bLfNLnhI= X-Received: by 2002:a17:902:28c4:: with SMTP id f62-v6mr37146649plb.31.1517717508616; Sat, 03 Feb 2018 20:11:48 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id k3sm1399425pgr.12.2018.02.03.20.11.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Feb 2018 20:11:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 3 Feb 2018 20:11:18 -0800 Message-Id: <20180204041136.17525-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180204041136.17525-1-richard.henderson@linaro.org> References: <20180204041136.17525-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH 06/24] 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: peter.maydell@linaro.org, cota@braap.org, alex.bennee@linaro.org, hsp.cat7@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée 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.14.3 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. *----------------------------------------------------------------------------*/