From patchwork Fri Jun 4 20:12:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454167 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp729224jae; Fri, 4 Jun 2021 13:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqU/9PHQzB8FihYbNYyiaCQQyRhES5cU2YcHh4wOhDR1YR57bIUMtxTmf5zycfBLEwWGJ0 X-Received: by 2002:a05:6e02:216b:: with SMTP id s11mr5472875ilv.267.1622837961385; Fri, 04 Jun 2021 13:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837961; cv=none; d=google.com; s=arc-20160816; b=qMp6JAh1+ejB+e0OAXqHur6XMdnMBulPxS9xyc3yjQtye90NUMJdaNiZvwZxsBh0ly oPcSumi3uffKG71qG/8EQtA92TLrGYeu1EGCNSr3GocOkZxXDHOEbFZDt64wo8nT3LNI 5wDL+nJTtZyExbV8T1QmQHuS4BBZE2ytGqQ1ZSpycTXdkfHGgZcu/07ivEKfT7UIz+wq 43xBe5oandy7mbRdMgNUy5YTi0tKX8u4m2pbKmhduolHPyHpi4luWKu9nBJy/C52hyDU vCWYeoqmPv8e04kgkSWx15fFPWcCS9W64EHlzNddEVIcJw8g8RBvwgT6ZHODbC82AMu1 uuvA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=oE9WPeWzJzp1roD0xrVris7cr5AWOROn9KzKLGw6R8jQ9DL3jwCrZq08QmCxMI1tNJ 0WLAmUeC1kXsC9mmONSzvmwfCxf/ny9n8TVBwepGdmhxTdajpB5j2FSvpPlxc5JwLmce WCzGEKq3loGlU0dkORZyr58RmDPHbnhxhBS2FnjD1HW32JfNhuw7dayHtq7bhiO6rz5E ZE6kzQu3xX1mzplqvCkKS0qHjzDeDQm9rfa2Zax/rRtEbB6YFapNM2pZSwtYJGPOn1ge PCmfrHODW9X/TQCA18L/MtXxOv7x0+eIqzjPM1houpfUQJo2RFkTKpyku5AFYJP9CLc0 J6DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WHBuM6Y3; 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=pass (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 i19si7456566ilj.131.2021.06.04.13.19.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:19:21 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=WHBuM6Y3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGHo-00061W-RA for patch@linaro.org; Fri, 04 Jun 2021 16:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB5-0005rK-Ng for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:24 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:40684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB0-0005LT-MW for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:23 -0400 Received: by mail-pl1-x629.google.com with SMTP id e7so5222221plj.7 for ; Fri, 04 Jun 2021 13:12:18 -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=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=WHBuM6Y3pHT9kL5PVWkcFXqXpLgQaz8zHM0EHE1rNoMT/oiH2YDuQM8eeNjPlP1Jhd 2KN3RLIiNinC+Y4qj/nxi8A2n8xYHRmswy4dqJB2gfw3UfNqh5KngmFN5cWNjncFyw/S FCQOmZB2B+TUqILs+Y962hpFdWsAZpaj51zXI//BT7ArFjBaDt+pYE8ZH6IgVvd2zDlt jdPgKICL5J7LE/ksmN9CKx+jLGf6iDUiYIPHdeAY7Zd9tjccq7L4D6Po63BZYX1QY4AM isGWecP/RNPSyhUwqguHSvLziVGBkkWSbNkrDCp/ipv6Hz2l/uhVxS34lEPYfP2g1YML bQTw== 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=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=j1qypnEnMSGTtW3nAk6kYTB+Z9Rrt7tmRS+11QVOb/+52Q2QCmEebom+DD+0RWQGMi BmCUQyuLdslpUQE+JNrkk/DXwX7jfkSczfKHPmzqNDrPxOIvYbiNn/lZxF28pa0uF/WL 7VNgalTJfr/7p+c4tjuZp+DGBKOL8ZKvI4bES3kjA6fSkqeHl0pVJkT6/JDcUS2EgldO eWLaDeajFsFwoHrGBMbPUk0xH2NcT5GJCbIQne5loGvTwTq7LqVv088NaSl5fKVD4Azf FnmmC5ZyQjODw3fY5juP67XDjwIogtqmA4yfxQ5l82+Cml1Lap9hO1V/AaDiNkQAsuh7 E+2g== X-Gm-Message-State: AOAM533eGQbTtTXiXMLKrs2YQR+xQVnCTNYVe+TFZo5pHmwkc/GdQNU0 9sGToOXcPDC2jwojGk4lXLG+AGhHrxZWFQ== X-Received: by 2002:a17:90a:549:: with SMTP id h9mr19440686pjf.158.1622837537496; Fri, 04 Jun 2021 13:12:17 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/15] tcg/arm: Implement TCG_TARGET_HAS_minmax_vec Date: Fri, 4 Jun 2021 13:12:06 -0700 Message-Id: <20210604201210.920136-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is minimum and maximum, signed and unsigned. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 71621f28e9..4815a34e75 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -168,7 +168,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_shv_vec 0 #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_HAS_bitsel_vec 0 #define TCG_TARGET_HAS_cmpsel_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index f0cfed7700..8193d768d6 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -188,6 +188,10 @@ typedef enum { INSN_VQADD_U = 0xf3000010, INSN_VQSUB = 0xf2000210, INSN_VQSUB_U = 0xf3000210, + INSN_VMAX = 0xf2000600, + INSN_VMAX_U = 0xf3000600, + INSN_VMIN = 0xf2000610, + INSN_VMIN_U = 0xf3000610, INSN_VABS = 0xf3b10300, INSN_VMVN = 0xf3b00580, @@ -2400,9 +2404,13 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_dup2_vec: case INDEX_op_add_vec: case INDEX_op_mul_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: case INDEX_op_ssadd_vec: case INDEX_op_sssub_vec: case INDEX_op_sub_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: case INDEX_op_xor_vec: @@ -2768,6 +2776,12 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_mul_vec: tcg_out_vreg3(s, INSN_VMUL, q, vece, a0, a1, a2); return; + case INDEX_op_smax_vec: + tcg_out_vreg3(s, INSN_VMAX, q, vece, a0, a1, a2); + return; + case INDEX_op_smin_vec: + tcg_out_vreg3(s, INSN_VMIN, q, vece, a0, a1, a2); + return; case INDEX_op_sub_vec: tcg_out_vreg3(s, INSN_VSUB, q, vece, a0, a1, a2); return; @@ -2777,6 +2791,12 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_sssub_vec: tcg_out_vreg3(s, INSN_VQSUB, q, vece, a0, a1, a2); return; + case INDEX_op_umax_vec: + tcg_out_vreg3(s, INSN_VMAX_U, q, vece, a0, a1, a2); + return; + case INDEX_op_umin_vec: + tcg_out_vreg3(s, INSN_VMIN_U, q, vece, a0, a1, a2); + return; case INDEX_op_usadd_vec: tcg_out_vreg3(s, INSN_VQADD_U, q, vece, a0, a1, a2); return; @@ -2902,6 +2922,10 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_cmp_vec: case INDEX_op_mul_vec: case INDEX_op_neg_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: return vece < MO_64; default: return 0;