From patchwork Mon Dec 11 12:56:50 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: 121402 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2762412qgn; Mon, 11 Dec 2017 05:03:38 -0800 (PST) X-Google-Smtp-Source: ACJfBouJx7+1uO7Rw+NdubxnnUlhTfo3sX5RsuLxUl/FcYZU8Hs0JEDsCxrTZe17GAPedF8iQYhw X-Received: by 10.13.207.4 with SMTP id r4mr191801ywd.493.1512997418626; Mon, 11 Dec 2017 05:03:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512997418; cv=none; d=google.com; s=arc-20160816; b=ydMSzXkvxhbffqTv+6+N3G1P2PJub7GqZ6GUa1kJ1cWfzigWzRfBYaUF/GMVAqWZdx EX4j3fvVpUS/wiwqnk6LS/GzdrPtbtGr79q45TExAoaNPSeO4DDr1DG/FFPJrQ9eQTCc JmoQphux4rDUij5dTWi80hnm43Jldq9Nso/rTNVnsEl9cvSVmYySZM4HEuCfUD9cliOS bafAI14QUSfnkMVXK6SoyuvppG43t19gW+SmPW0hUwDKlnn/UkuheOEXjco3E48jFitq 8l0y2Hsz0JXfJ27XQbZpTbwbvIQF25K8zGNapBEG82rWuMxuFPzGjzt+MBgouLdNIzAe D6mQ== 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=X3hgaRG54kX7m+io7AI45XFgBi4t8Rc9hxlfJtpvpb0=; b=atPLEjaY4I7/aU8gIsRHgQKUANGacpErZhi2+QwAVaIepc3j525Byr0iLJBmQzfddq lHO/wzlVe6j9PE2tBexiM4401WhHFTDWbeXGvk6jH5VZMoQkgaRHSqCvK2Pioun/uHw/ 0/pn51mqMhXhXcrlKnJ/DcCHlLy5Roexn3mt1VTewMXqXTRvZYuxYPTKQ6kLrqrz7zhg J1NURlJGRUDU9OA5bKqTNeZRpiQf9tZ8+X1+KDD+JmnRw1MwYJ6b7cJXWtvw4avEO0ki euElcYOk5Na5qRVLO89SxWPOnUBPpjofD1ZFDn/+LQDYZoxEmZOppWIlTYHliyslWLND tuGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=V7RGqFiw; 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 h21si2953998ywc.684.2017.12.11.05.03.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Dec 2017 05:03:38 -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=V7RGqFiw; 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]:52616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONkA-0000GX-55 for patch@linaro.org; Mon, 11 Dec 2017 08:03:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eONe0-0002Mv-N4 for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eONdw-0007bL-9Y for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:16 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:43925) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eONdw-0007aN-3N for qemu-devel@nongnu.org; Mon, 11 Dec 2017 07:57:12 -0500 Received: by mail-wr0-x242.google.com with SMTP id z34so17439355wrz.10 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=X3hgaRG54kX7m+io7AI45XFgBi4t8Rc9hxlfJtpvpb0=; b=V7RGqFiwNxg1ML9ZWDyTsDRkJBL/+2fI/VbVn7nOMUuAryS5alXWyN3bPTD1s9BJZd VdixBodAYYXOl9x7CmvSjpXIYEM9VmE9jT7zC5wEItVp3nAb/KqCQiW8/2Vj8DhUnuyS PJmuOVhFKPj710Iy/OUZ4Od3F+dgVvFHDAZjI= 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=X3hgaRG54kX7m+io7AI45XFgBi4t8Rc9hxlfJtpvpb0=; b=cMOTo6ccYZjcQCgditXt7VWyuNcdWVkpABOBIErZVQL3zTMO12T77kd/Pz6TdZK+fz KmcoXSPy8yn9+zyCapKQF3FCyYpfMPsjjRo8wQstRouxzOL4xGsahp8suC6JufpRHBCG DYyxKw1AF2sY9Foqa5Xnlo/dTjiLeBQ6mp1KEmP3Fi3AR/B76qhRAhFvlCgktqlpL6as Dmde2piRZmq8YJ7fgRO/AplbZIFZ8BMpY+OBRY+4JH31AWsPf9QfR0vSXel/LpIuu9gZ pF1D+jJSjLcJ5IiXNLcb4tyTz8rxm4JjKC7sXIuoR2womvdVc6V19m8FFod05KdvbDs8 gV5A== X-Gm-Message-State: AKGB3mK21fjjV6UdtfnujyIPNh+SdEdlEdrPpEySWPHUPZeILoGWulIb WlYkfkSxlBAlI3tboGjmpYdgCA== X-Received: by 10.223.171.177 with SMTP id s46mr315433wrc.194.1512997030937; 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 r14sm15427220wra.71.2017.12.11.04.57.06 (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 AB6103E098D; 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:50 +0000 Message-Id: <20171211125705.16120-5-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::242 Subject: [Qemu-devel] [PATCH v1 04/19] include/fpu/softfloat: implement float16_set_sign 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 | 5 +++++ 1 file changed, 5 insertions(+) -- 2.15.1 Reviewed-by: Richard Henderson diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 32036382c6..17dfe60dbd 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -390,6 +390,11 @@ static inline float16 float16_chs(float16 a) return make_float16(float16_val(a) ^ 0x8000); } +static inline float16 float16_set_sign(float16 a, int sign) +{ + return make_float16((float16_val(a) & 0x7fff) | (sign << 15)); +} + /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/