From patchwork Mon Jan 28 15:58:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156783 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3613080jaa; Mon, 28 Jan 2019 08:21:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6dmOGHh2Putkq084YVHFVuL6SLhlFbavDLHg9cbOmT9ZlybBh9Sx4D8G/aVZiSvGXYkt+H X-Received: by 2002:adf:e284:: with SMTP id v4mr21669303wri.26.1548692463940; Mon, 28 Jan 2019 08:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548692463; cv=none; d=google.com; s=arc-20160816; b=jGjjJ+6rEy+K1YEuckN+AUO/UkYNzu1sQ75DhbQ4PzcIZrZ/JeVaSBhExtLHNu8ce/ z+dE0dQBlmV5NUeDtbRV9kOtvDi56o5IXdelskTopfnm0Z5/60xnFtKbH0M45HLadjRz TSHxzPpULdTeoZhHAwOjUKjlG6ZQVfdgIxhtpUi01J4CznrfkZsoqcA5QmvNlz9VV5ET uopInkUc8hoA8ShEaS62L3Ptc3+6py4aKr7rpXBz/i3oDmDVswHx/oBY2Jwc7fRp35Yh HpQTdUz0EzFKJGSZFRed6CaDBDTjXf8gFpCZopVGX7DWh6pm4M5YSbsl8tWNT9EUiL8c AJsw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=1RVpvwteSuePPKo6wNsZRQ/0lJBH3U2L6QXC6WM1wUc=; b=NRf6aQNWnEoDS8J5j+K+hxFeD38v+RaRbL5/AWzazFFfIPFS87d7ubK57rqZIhHdel Vzjbr4CH98UebshGQaN7I7NMV4FjPUZsjfAqp4JtGSmP9bU+T2RDftbujdS0sEjqEy8s udcJjCC73vMfZ99mqqbEu3LSqpyfZkxth7TsVJfZDlu4q6rlTMBwuBYhluvw7VQun3Xw ArTqggjKEBSki2ANLpclUrLkDG0zYfjvEhfWVZ8tPeyVf6qfC4+Cp6VxJgO//0Z+4/f6 grreiJA7R/wnFS5socyb2xz1ZbomsrGnSwdr0MYhDRntLmA8zea38cQt1pcQFCHW35jI LiPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=b8ph8Mkv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id v1si77014323wrq.443.2019.01.28.08.21.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:21:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=b8ph8Mkv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:34430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9eg-0003ql-Kl for patch@linaro.org; Mon, 28 Jan 2019 11:21:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9K1-000583-20 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go9Jw-0007qC-F9 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:39 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:40214) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1go9Jp-0007mw-VV for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:31 -0500 Received: by mail-pl1-x635.google.com with SMTP id u18so7917175plq.7 for ; Mon, 28 Jan 2019 07:59:25 -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; bh=1RVpvwteSuePPKo6wNsZRQ/0lJBH3U2L6QXC6WM1wUc=; b=b8ph8MkvD61zEpPq732b6uuUxIbtM9zeg7aZidBt3qAvXlKBhfK3FgJlQDof5jYGAP PoGOpA9msWA9jUEMFfOW1AWqXY+hVT0aY4WV44+9SjEyYRQqjyOeCMwlZZkCTBVQQHUy PK/gBtF+2R4A7/TOCQ6S8USwNVBXEOvCHED9Q= 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; bh=1RVpvwteSuePPKo6wNsZRQ/0lJBH3U2L6QXC6WM1wUc=; b=TrrbYDqVMYPJ3grtp+5TWtEhb3qC11x1QMjnSN+j6STw+jNgaBymwRMZE7Z1qtKtjT U0JLElVPEnQZEtY+WjVlK12yNA6rMHKW0i+IJUQZXwGs0SiCD6fx9ibqlMOxulv9JiJy rSsr7Q8oNR911DsMkoj2vqDc/oBga9HEhUzBNax9YHa11QvPXI7nAyBaboZvsa2n55SC YqqIVVQRxlQt0pcFVno+2+ad3gSLpECmFZ3t/Mj5knWKTMs4OzUN+fTp6icWfq7KqAXk Q/2yoD/cl72Im4N4uomrxkCJ/fY6SKr3LyyMfoLiA87XZSOG2vJmq0yEjHr69xmlsmnz r6Qw== X-Gm-Message-State: AJcUukclFRgpe9hjxNLZybkiL10zcRTd/0FzrGyRHKpD/LKx1N6n07iC BmdeAYAkvxRwH01uXFWkKTcKflXh7z4= X-Received: by 2002:a17:902:690c:: with SMTP id j12mr22120166plk.206.1548691164649; Mon, 28 Jan 2019 07:59:24 -0800 (PST) Received: from cloudburst.twiddle.net (50-233-235-3-static.hfc.comcastbusiness.net. [50.233.235.3]) by smtp.gmail.com with ESMTPSA id p2sm45518687pfp.125.2019.01.28.07.59.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 07:59:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 07:58:54 -0800 Message-Id: <20190128155907.20607-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190128155907.20607-1-richard.henderson@linaro.org> References: <20190128155907.20607-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 Subject: [Qemu-devel] [PULL 10/23] tcg/aarch64: Implement vector minmax arithmetic 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 2 +- tcg/aarch64/tcg-target.inc.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index a1884543d0..2d93cf404e 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -136,7 +136,7 @@ typedef enum { #define TCG_TARGET_HAS_cmp_vec 1 #define TCG_TARGET_HAS_mul_vec 1 #define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 0 +#define TCG_TARGET_HAS_minmax_vec 1 #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index b2b011f130..ee0d5819af 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -528,8 +528,12 @@ typedef enum { I3616_CMHI = 0x2e203400, I3616_CMHS = 0x2e203c00, I3616_CMEQ = 0x2e208c00, + I3616_SMAX = 0x0e206400, + I3616_SMIN = 0x0e206c00, I3616_SQADD = 0x0e200c00, I3616_SQSUB = 0x0e202c00, + I3616_UMAX = 0x2e206400, + I3616_UMIN = 0x2e206c00, I3616_UQADD = 0x2e200c00, I3616_UQSUB = 0x2e202c00, @@ -2153,6 +2157,18 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_ussub_vec: tcg_out_insn(s, 3616, UQSUB, is_q, vece, a0, a1, a2); break; + case INDEX_op_smax_vec: + tcg_out_insn(s, 3616, SMAX, is_q, vece, a0, a1, a2); + break; + case INDEX_op_smin_vec: + tcg_out_insn(s, 3616, SMIN, is_q, vece, a0, a1, a2); + break; + case INDEX_op_umax_vec: + tcg_out_insn(s, 3616, UMAX, is_q, vece, a0, a1, a2); + break; + case INDEX_op_umin_vec: + tcg_out_insn(s, 3616, UMIN, is_q, vece, a0, a1, a2); + break; case INDEX_op_not_vec: tcg_out_insn(s, 3617, NOT, is_q, 0, a0, a1); break; @@ -2227,6 +2243,10 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_sssub_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: return 1; case INDEX_op_mul_vec: return vece < MO_64; @@ -2410,6 +2430,10 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) case INDEX_op_sssub_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: return &w_w_w; case INDEX_op_not_vec: case INDEX_op_neg_vec: