From patchwork Thu Jul 20 15:04:23 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: 108374 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2274096qge; Thu, 20 Jul 2017 08:23:27 -0700 (PDT) X-Received: by 10.200.54.50 with SMTP id m47mr5139174qtb.220.1500564207045; Thu, 20 Jul 2017 08:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500564207; cv=none; d=google.com; s=arc-20160816; b=iQVVgh5PYcBHWv57HI/rsRLKTbcOFKkUvui1wP31P8F8yNkBhKSJW9/4Wemy/C4WRg mT9endSQKeSPXkLjg/AlddCFJVoGSc07ayoiveeaY7LXYAm1Nzg4+H6V1pPI96vWvV2s 6yECm21dxGUqGTXvjCeTVDAl0kj7pNf4GobwY8mjbsw7w5h30MQdtiD8EWdmj2RCxsBJ 6cJdpwllb8xnDl4rhP73pT5AxgJzJNdIJ97/Ds1JjAXFzt9pUWKj3rjg45C1sZh75VS/ dlQp9hGypnasT8GP1OH+7bDxJy49xDxlwWtR9hT2MTpTIqz3y2wKELE9EoP1x7P0A81t bBSQ== 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=IgY73EfM6qj6NB+q2eA1kPs+Df0JZy44AOwUdv2DguI=; b=J5hA8S4tmfd8jDaKAjHyyCAX1CY6wBxgZIfZxZ7phhWy7/60jh+wRugjUhzqy2Z4xh mRVWEtN5JZ22iJfIidhI5MwEcJCpq85Bn3KYKpGe9p6pcx8uVKQ9vbylfY/rjOQxBgX9 TwtJrPS61aQmtVYKr+StDZthmfXlUq6yNfo826g96/VBEWXNHLt0UuRJDn+0L+Ve58w6 ZmXFtKodF1zSISUuQdTXKAI2E5i9iAtpPdKTpD/SkIEi2ermS7yUz+DsUzsIeh5/0Ow4 Xh3iXtmPiu5+8s57vyOB0CPrgjTw6Uc+jqup+yKOsu8bh+ND7/uR7/9HPMD96QMb+Jbt rv9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=F7D6R9Vh; 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 12si2085157qtc.402.2017.07.20.08.23.26 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 20 Jul 2017 08:23:27 -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.b=F7D6R9Vh; 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]:38595 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYDIS-00050l-Kt for patch@linaro.org; Thu, 20 Jul 2017 11:23:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYD88-0003FH-Ao for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYD83-0004Kn-IV for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:44 -0400 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:33237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dYD83-0004KE-64 for qemu-devel@nongnu.org; Thu, 20 Jul 2017 11:12:39 -0400 Received: by mail-wr0-x22f.google.com with SMTP id v105so41927509wrb.0 for ; Thu, 20 Jul 2017 08:12:39 -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=IgY73EfM6qj6NB+q2eA1kPs+Df0JZy44AOwUdv2DguI=; b=F7D6R9VhUpnZn2tVJgbvybWJpAiHaAEwVlgMEkQv8fNhTBbgTcmE010+2qKOxnOXub zSYhYfszeSRuDMseZI2D/LXq2baByKRQlhxNlMtEX+ubXRAcpCCMnV7ES2BZTHLjDi4F 5QPzxa6yQq2Bg9KwNIiLE6xto6vby4PBR+Y4s= 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=IgY73EfM6qj6NB+q2eA1kPs+Df0JZy44AOwUdv2DguI=; b=ZYGb+XjDao6Lvo/hT18wHyvz2m0t0uXAaQGGUHwanD8sIx1FYZbVGPRD975AJeCNlP /vlepD+NLtzSiKBImqUddNh8hnNgV2Hn+SuGVxVQeN4AxWTYbdjTebsrqe1ykUiKRae+ +OTkFMiWUjo+plLtcEcs3KlDkPWfuiIOW+sKmdKuTFG9EKUfMc5yTkDMJ2YFBdxTGUrw LancDj9IcC/92xK1iK47ykRQF3i0KgkxAhmdNoubhdZ6sU/NkZPTVH03FbeQp4JtB2IV VeaETihuEVKvhhq1n5eKFLNKTIQpjD1VHg2tg1YY97wMqZhsBe2yds2aU5N9i7LGKSUj Vq5Q== X-Gm-Message-State: AIVw110t7oiRA0AU12kVbkzhRPIO9Gvh4cgtNKFrRH9ZyTFqr65T5bNJ 83wEM4w0lMn7VGZB X-Received: by 10.223.179.67 with SMTP id k3mr7539707wrd.198.1500563558119; Thu, 20 Jul 2017 08:12:38 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r30sm3361234wrc.95.2017.07.20.08.12.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 08:12:32 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id DBA4F3E0BB3; Thu, 20 Jul 2017 16:04:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 20 Jul 2017 16:04:23 +0100 Message-Id: <20170720150426.12393-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170720150426.12393-1-alex.bennee@linaro.org> References: <20170720150426.12393-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::22f Subject: [Qemu-devel] [RFC PATCH for 2.11 20/23] fpu/softfloat2a: 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: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Aurelien Jarno , rth@twiddle.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As SoftFloat3c doesn't have helpers for min/max and we already implemented it in 2a lets just 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/softfloat2a/softfloat.c | 2 ++ include/fpu/softfloat2a/softfloat.h | 11 +++++++++++ 2 files changed, 13 insertions(+) -- 2.13.0 diff --git a/fpu/softfloat2a/softfloat.c b/fpu/softfloat2a/softfloat.c index 4f1abbe08f..67115298bd 100644 --- a/fpu/softfloat2a/softfloat.c +++ b/fpu/softfloat2a/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/softfloat2a/softfloat.h b/include/fpu/softfloat2a/softfloat.h index 3cb41977d8..dd1293d802 100644 --- a/include/fpu/softfloat2a/softfloat.h +++ b/include/fpu/softfloat2a/softfloat.h @@ -386,6 +386,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. *----------------------------------------------------------------------------*/