From patchwork Tue Jan 9 12:22:36 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: 123910 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3963184qgn; Tue, 9 Jan 2018 04:31:02 -0800 (PST) X-Google-Smtp-Source: ACJfBos2EJ/FNr+oW/5qwZTMUktPAXM76FGFHNMVqDatdqNa5AJiSuFlB7xbPdOeGf+ZmvXSVv5B X-Received: by 10.129.51.150 with SMTP id z144mr3730777ywz.417.1515501062108; Tue, 09 Jan 2018 04:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515501062; cv=none; d=google.com; s=arc-20160816; b=Df2RT5Ba6hxQvrTKBFL7HDICD/PoKiHk2rHjKk73phgscg7+KVEYr93AvFkUicYjKQ 2w64P8cK2a33TDTjhrd7MQZSd6oPzAl784R1XHIL7opiMWkQj0b9XBDGVyYx633lH8mA WHEm60efMV2C0/1XyX41uta1NmgeBZ2gRg4ZLATfbyPpERrQP44JL0ApRbn8yiOzVswJ uoKR33wpV+O8YrMV9tXG9D7T7PrIlMRhkP7JJfMA8jteCbeamcT4Dzdvr16UQWZZtcZd 4I+dqdFo/ZLssCwS5EOIGZRMMq6/6syqd9T3DyJhE9EqMcjVcnK1axHtbjmiQZEEr2sd GIqQ== 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=KtfrcwYYHDPEWFKEmcYMWUVtcVxZcGJDHkDjYRTzgt8=; b=0RzByhC7Un1406l0dfiSkeLqQocr4NAv6hTpC0O68/qJw9+csR36j2hQ7gkhfUQQWm AteQJMKJX+/dYqbHuE5R2rmM/lBQqQN3CX+k4kYEyK6wE4lD4Uy39K/GsmekIcRylV1n CH9M7FyIbrPPb4GD7A3yZvLNsiDSFz/StS+wy7lfbhxloRFpXShU3pzhiyULIUCenvsM j+GLd159gWB4dw2CKMIAtZGyJecBsyFx4f/uprMy7oB0n8G13VYJYewJmUfU04QZjMEb pNHlcjZV2EaF/dLLdBUlxviTVJ10xfztv2nXBzfNtTbpjl/JK34ohwaulWijMcMEDtUL rXpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A4/erq9/; 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 x199si3001933ybe.780.2018.01.09.04.31.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 09 Jan 2018 04:31:02 -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=A4/erq9/; 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]:49525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYt3V-0003SS-FQ for patch@linaro.org; Tue, 09 Jan 2018 07:31:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYsvm-0006bI-0y for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:23:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYsvl-0006Uo-5L for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:23:02 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33397) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eYsvk-0006ST-Um for qemu-devel@nongnu.org; Tue, 09 Jan 2018 07:23:01 -0500 Received: by mail-wr0-x242.google.com with SMTP id p6so13914189wrd.0 for ; Tue, 09 Jan 2018 04:23:00 -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=KtfrcwYYHDPEWFKEmcYMWUVtcVxZcGJDHkDjYRTzgt8=; b=A4/erq9/7IcAm9xqIWXXoIMvolHeZ4dBWDxD++1kIC9Cq9uut94dJrc6ZUF40N3pCZ aQjQ11gjzjoHDlrH/DMmSxPlWOpS5HkJORGU001ltcMjt1pXRTzhi6ikOB/RZn/GIoc4 fkxNTMqAOewwZiNWTlvdUA5Q0nS5xq3xjDIk8= 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=KtfrcwYYHDPEWFKEmcYMWUVtcVxZcGJDHkDjYRTzgt8=; b=nQ0DWXdI0nhmzvO7Gv3p5Kj4imQhXmIJjjmL6skwi6thrUT/lM7LnWFxms59reFsz+ Zzop7UdRhNRL4LH3eRiX18lox1ZjI2GD5v2cpz/XIsQvx4iiCDTLz+kXHqF5J/oXAnAZ ZdUdDS69SkpIhDofMPCIaZAHICg4h4x6myt9yk959vmLfuc6VkObEjWRcLAzdDA6/emK fpu6Y+T8U3O+GXXkF5QsZ/UUiUT3avEmtGPvIBp9qSvZRDOMpSmlpqmMiFPxSWzgrvp1 D+PgiN8eGrsT7qrKsuLRCbSoLm7NsKI1G57kl9LCg3j2zFvpstdwyGGadjAALQ4FNDMl Opsw== X-Gm-Message-State: AKGB3mI1PG7UoCZuVZLm8n5ER4TZI/lsJUdZG2j48wtGpM4OmGSqQAjI 2IdocFw654VSbVRxck8LZ5Jd6Q== X-Received: by 10.223.187.8 with SMTP id r8mr6025777wrg.269.1515500579912; Tue, 09 Jan 2018 04:22:59 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m6sm15767623wmd.37.2018.01.09.04.22.53 (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 718E53E2A83; Tue, 9 Jan 2018 12:22:52 +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, 9 Jan 2018 12:22:36 +0000 Message-Id: <20180109122252.17670-5-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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 04/20] 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 --- include/fpu/softfloat.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.15.1 Reviewed-by: Peter Maydell diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index cfc615008d..dc71b01dba 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -354,6 +354,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. *----------------------------------------------------------------------------*/