From patchwork Thu Dec 24 22:45:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 351941 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp7333830jai; Thu, 24 Dec 2020 14:54:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrRS+hIe/xb6vt/dnQRdJgBPjhCsm8J9tIGMk8EJJEFSz1Lp+jCeuGnQmeWRZCRQf+xskA X-Received: by 2002:a05:6902:6b1:: with SMTP id j17mr48547022ybt.438.1608850452895; Thu, 24 Dec 2020 14:54:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608850452; cv=none; d=google.com; s=arc-20160816; b=on7Gdl3KAWK3g/hr+5YuET7zWnPN7TmxISCbS2TAeMuYQySgU3RA1VDssw4LNP/TFK hymUNJRdjUFeyAG1jE6nDoirhSzkSOqnFhtbK9YWV4hzkav9NtXRgVeHdGLMo93DSGxH IyBeqCSnVqozBK6GBiyid3gazbAVn0dhumYMW7v4y4Zs4n7+6w7OiBo1yEP/8vM4vV0J 1TK5rynN8JgR/gxsjvUHZ+DEn+iL+RInM1PxezTS4/0TRwqzibIUrDIBNh5ke1L1vYz2 OCBZ1O3ppaml1ZdKgm5yey8H76HUhNOSDSoCL8rqc7P4YIgQiKaTI893sHx+sCMYNGJW qoiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=IZbCguoR0lCTKpaO3TpyZzkmWXelNo5E8yAqSlIyuXI=; b=h8QqnRsS2UeNPs3RaXGc1ueQd8dvn/m7qE+tV5AlZelz6FZ4TGEuJQDWbP/7pe299E ebcxGGIHrZ1Fduqklbxh/Xnc+vH3a556JkzcN729Bq+5L64NOxSLtx9TIbgqat+EJDWP u6a1TF8iqrSBoGfIjpGEooC1IXYiyiQ6C14VTFKZcPieRQmEv2045jNwLqeABqXT3L5W lVlQjj5xQ8xJbxSPr/K+jumACWQ917zb08nn8v5EMPWaYFLtaIVO7xyeJyYFN0AD2bV3 5YPDx5/4dVCSwPNkavmg62LoAhLP3NdnF8xKWvrEPg5eqPeZVR0necjH/UhFVTAJWeh4 JE6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eBU/3SXL"; 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 j203si25603591ybj.425.2020.12.24.14.54.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Dec 2020 14:54:12 -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=pass header.i=@linaro.org header.s=google header.b="eBU/3SXL"; 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]:50736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksZUq-000372-C3 for patch@linaro.org; Thu, 24 Dec 2020 17:54:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksZMR-00020V-5k for qemu-devel@nongnu.org; Thu, 24 Dec 2020 17:45:32 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]:35614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ksZMP-0008LV-BL for qemu-devel@nongnu.org; Thu, 24 Dec 2020 17:45:30 -0500 Received: by mail-pl1-x635.google.com with SMTP id g3so1829995plp.2 for ; Thu, 24 Dec 2020 14:45:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=IZbCguoR0lCTKpaO3TpyZzkmWXelNo5E8yAqSlIyuXI=; b=eBU/3SXLc30HBuVQ/e/A5masB6AVmsWaMTxLWzSVWHWiEOVqn9c8wQPKVNIy84nS8N t0eSzZbJSH2hnS9N4tYjA3skm7b3JjYAqJf+obzqn4bFGpcs1Bl2+beN+B+iihBXWICD RPlSCGmf67TQf1Xbr+pmoKYIw5rtxLTkJFobBsDtj/OLuiCEOSW3fsMwQNg3IrCgZqH1 jaxQal5hhomMsnTwxGVuFEJFF3FkGDVGTaq1hQiw8/62p4lUM2VKPMnia22W6EusD1xr DhG4Q3ZMKYGgfhu/+/hZLl9c+QyKa456b3uGZaRiuMEHQb92dmmKlMFXKJdpafuZy3+y Dywg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IZbCguoR0lCTKpaO3TpyZzkmWXelNo5E8yAqSlIyuXI=; b=G+lNxNnml/LsPA+01xD0KPVCY20rFCEzlXdhg+D7j/dEHqlzt1XX4iU96xUGaG9Phl Wbd8+pr/rHVe9xDEKB3VAxy6S0RMYUqPwtqYODiKVVJNH7olxw/44PdPSWQi6Ly6nmej HwmDCqx3oHcjRTrTw8wnCh0RnBmkF+DEVjISHOiMUeq8lWBONPNxCbxhGKjwiD6ujJBb ngtegnOkyGcaxB+KObTYp3z4Mjw2z/6jd/KfbSA7iFTEFnYkmyYCUSA9X4b+WdxlJ4w1 LrBuoOU1xD90ElRpV+pPwIV0RRJXjHkKVkK2QyI+pqe0G54+VdtydywzmMPQW5yNelPS iDyQ== X-Gm-Message-State: AOAM533CRSCV/uVAB/JdXNB8/MIQ2slR5vKulmuiKWe+k9Al4KjBezac +uofWljKv5t+PvsPXJebzFbV9e54cPeYsQ== X-Received: by 2002:a17:90b:e0d:: with SMTP id ge13mr5975739pjb.111.1608849927875; Thu, 24 Dec 2020 14:45:27 -0800 (PST) Received: from localhost.localdomain (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id w11sm11844123pge.28.2020.12.24.14.45.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Dec 2020 14:45:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/15] tcg/arm: Implement TCG_TARGET_HAS_minmax_vec Date: Thu, 24 Dec 2020 14:45:10 -0800 Message-Id: <20201224224514.626561-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201224224514.626561-1-richard.henderson@linaro.org> References: <20201224224514.626561-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is minimum and maximu, signed and unsigned. 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 c41dea2b03..e3c533f00f 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -167,7 +167,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 a6d9ee929b..6e17082df2 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -191,6 +191,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, @@ -2377,9 +2381,13 @@ static int 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: @@ -2748,6 +2756,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; @@ -2757,6 +2771,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; @@ -2882,6 +2902,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;