From patchwork Fri Oct 13 16:24:16 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: 115789 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp922065qgn; Fri, 13 Oct 2017 09:29:48 -0700 (PDT) X-Received: by 10.200.38.194 with SMTP id 2mr2760533qtp.196.1507912188025; Fri, 13 Oct 2017 09:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507912188; cv=none; d=google.com; s=arc-20160816; b=l2cjcCs6X/WNEJF3Jj+sGtvw0lfB2YbfHrQyIZ71d6rOo4sMeiUSW1tcSbWwTHZNp8 xqKx11MKlc412u45VBdwaAV+OgK4+OTK5SGJKilM1tPIL2j6NHsuqVBB+uyL1/nPwEAH 9DV7pNvhy6tjBC15RKtdWjNlm8RubEplb+SATxHszzMFZNT+OPRvuAFI8Sk3SzEyJSMu YoIqjeV9yhoAI4fOXyBW0v6q7zSiwhTXaCsTqDPmaICY92AVtFETVssAifUTvjIBWg+y 6u0EjAoRD/ULf4NdFKMKTkruDAWREj1RVtWJhGyHSD5eMIMXB1JksBL0BkYbhycvmWDH nTag== 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=YNYltpURvYkc94gBhiDKkKFxSym98VonnTpWX1QJW2o=; b=RalJS5wGh3ryBOhqbYhLJxKuaiXBIarJfzXSx88WsHVgVyviw3KtA+W1jay5Zxv/lJ K2//KZ5IaGY20S5UiJkaEMmrltEnBIHBbdUqyQuol7jGdTs7e8ahcWcj7pmb9r+YS2aZ hd8nYk+R21m3DqlYJRQs6REEnoErMwLarj0mO9AeDq8RWFcp1LrXMAU6ToBAdmrecHZ4 60NVS/vuK0Hxa3/3vj/yMqAyBRDusk8bHfpQNgcWLELX1PS6oeSJZ4whY3VNeO2hoQhz N2XVhizDcx/bSv02rNmOFdUnzQ4TCnZgj3EV74/G/G5PbMyOy57G5rVqtlenHkBGaN7s +YhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AVq/h3pn; 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 s188si1063176qkb.145.2017.10.13.09.29.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 13 Oct 2017 09:29:48 -0700 (PDT) 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=AVq/h3pn; 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]:51041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e32qH-0006Je-Gn for patch@linaro.org; Fri, 13 Oct 2017 12:29:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e32lV-0002Sv-Mo for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e32lU-0006YT-Ql for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:49 -0400 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:52247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e32lU-0006Xb-LO for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:24:48 -0400 Received: by mail-wr0-x22a.google.com with SMTP id k62so1426464wrc.9 for ; Fri, 13 Oct 2017 09:24:48 -0700 (PDT) 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=YNYltpURvYkc94gBhiDKkKFxSym98VonnTpWX1QJW2o=; b=AVq/h3pnIAWqqAj64gitNQJkWPgxW3lemKeLMpJGIehwXrOkR4KoT/pVP6WVGFo7Ph nEZDOLjyjROZg9dmtYy5CJ2m4LaWcMD0KKxWyfnow+ABzCmVHAdeZWy/LUsTuY1NNSH/ SYVXqDsHM8lCYoCYfPBo60S/Ue0sWlZfeau10= 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=YNYltpURvYkc94gBhiDKkKFxSym98VonnTpWX1QJW2o=; b=VRwjpLPrdTlxbB3wkxI+9RMSWDBPOWwMQ2klw1swXRAPI3Een7LXn8XbKuk500RAkA aktmfFF9lHQ1WoZJzr3qXHs2c5wjf02ckgXMzPB+5TMDq0ED/7GYeUDOlDDqmOOuRWNv b8r7QqwjxSZ129VF46m9QHDRSKee/xHloj+0EhjVYqdJd5yj5Va4E+A/jWnisOXp+LXM ci0Q/lgnWmzJw/fxlKvDxeyvUBkKuDQKnkIpiXhyS74nQKmrZ5e2iPwm85Ae32NzJqKM 8sEc/SFrPDhrR2+qRTc1uTsuTyAx1lzSZxsjXml80RPD3/zOCu0UC/ZP4VRj7jQhwrnR E60g== X-Gm-Message-State: AMCzsaWdYrE5KGujotK9jV2I/WxVBSAQKV1MeHfElVK7qDM+cp1E5gXd WxP8tWabSh1cj6ymxBAy9Ysn9A== X-Google-Smtp-Source: AOwi7QC2eieJN7k/GTmj2xRrD0weoeOOI4ShnG7wfcQIrBtYVtFDv11bU946BPTTLhdlWXxJNGQjcQ== X-Received: by 10.223.150.25 with SMTP id b25mr1888659wra.147.1507911887594; Fri, 13 Oct 2017 09:24:47 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b190sm1885439wma.22.2017.10.13.09.24.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 09:24:42 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 019123E07E1; Fri, 13 Oct 2017 17:24:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: richard.henderson@linaro.org Date: Fri, 13 Oct 2017 17:24:16 +0100 Message-Id: <20171013162438.32458-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013162438.32458-1-alex.bennee@linaro.org> References: <20171013162438.32458-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::22a Subject: [Qemu-devel] [RFC PATCH 08/30] softfloat: add half-precision expansions for MINMAX fns 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, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Expand the current helpers to include half-precision functions. The includes having f16 version of the compare functions. Signed-off-by: Alex Bennée --- fpu/softfloat.c | 2 ++ include/fpu/softfloat.h | 11 +++++++++++ 2 files changed, 13 insertions(+) -- 2.14.1 Reviewed-by: Richard Henderson diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 3a4ab1355f..013b223947 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7579,6 +7579,7 @@ int float ## s ## _compare_quiet(float ## s a, float ## s b, \ return float ## s ## _compare_internal(a, b, 1, status); \ } +COMPARE(16, 0x1f) COMPARE(32, 0xff) COMPARE(64, 0x7ff) @@ -7779,6 +7780,7 @@ float ## s float ## s ## _maxnummag(float ## s a, float ## s b, \ return float ## s ## _minmax(a, b, 0, 1, 1, status); \ } +MINMAX(16) MINMAX(32) MINMAX(64) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index edf402d422..d89fdf7675 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -381,6 +381,17 @@ static inline float16 float16_abs(float16 a) */ return make_float16(float16_val(a) & 0x7fff); } + +/* Expanded by the MINMAX macro in softfloat.c */ +int float16_compare(float16, float16, float_status *status); +int float16_compare_quiet(float16, float16, float_status *status); +float16 float16_min(float16, float16, float_status *status); +float16 float16_max(float16, float16, float_status *status); +float16 float16_minnum(float16, float16, float_status *status); +float16 float16_maxnum(float16, float16, float_status *status); +float16 float16_minnummag(float16, float16, float_status *status); +float16 float16_maxnummag(float16, float16, float_status *status); + /*---------------------------------------------------------------------------- | The pattern for a default generated half-precision NaN. *----------------------------------------------------------------------------*/