From patchwork Wed Sep 4 13:26:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 97074 X-Patchwork-Delegate: rearnsha@gcc.gnu.org Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC3D3387543B for ; Wed, 4 Sep 2024 13:35:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by sourceware.org (Postfix) with ESMTPS id E8233386103C for ; Wed, 4 Sep 2024 13:27:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8233386103C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E8233386103C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456465; cv=none; b=JnOUw5h55bFNCvTAl/CE3F3X7dFGCB1i1o+eyU/aJlAXsSehgAesktGWemPS46Fms9QMU1ZjbrmK6GcJvTghnIPpipeVGQK3ycciXxoes3lAzbpQdRHa8NoqTOk59C6oUeyuRdi54qiE0fwh4+bl5dlgmYbmZ1Z/TeyL7v6zoX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456465; c=relaxed/simple; bh=2Dy1KkJGN0XJxPHnM6qxqyfSZIGzX4VL5g67z2G6GgU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=I+HJwQtgqAnUd4Hz56FvtWR+n41XAGW5w/i+TWxE4JusKWg5pKyu2uhUQZLzyEhvNv1x0xG+XLlFr7gswMvivjKC1kRVo+t6X3iTR1Hoqxu962Z/5HkppuTL43FwwzpC5IKn6dJEhvFRajLftoK5yn/p4ubii9q+xDmcpcebhiA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-5dc93fa5639so3917351eaf.1 for ; Wed, 04 Sep 2024 06:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725456461; x=1726061261; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GO0d/XZWT++5hx14Wf+pZHwRAYhoZxE/Xo8DA8GLKsc=; b=y6jfVv3EvD7So2glFFdtzAxEFJLNaBD2cvshQYoU8IRdUYOhl/NBm6Sm/elNI8MiRx vjjBK9yJQ6/E9JrEMyefV8VEMyu40S56JZmiRdWQnCMAElUEcDGq9qKKT0r/pRooTu6P fMePuX7vhxPI4Ro7xtxraxptFkUmlILVuklDvqhNkZnSmIWiZrmT5s26UsvdE77Ad1V+ 6zmcAzJgyZv7A//r4Ig3yPgJHL/d44K+U6YJL7b1uzweU9HeAgD/9SF7u8cYprOcbXcd MoanXUwyMFumcK0ergZvAB/LCqk/YWFKg1oVtKl80g95hIVANOuuqhL65SsFkfs6r3l+ mtxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725456461; x=1726061261; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GO0d/XZWT++5hx14Wf+pZHwRAYhoZxE/Xo8DA8GLKsc=; b=bNPaOmngdRTBvA3CoHcMVMmqL8+FniUv/kiiEGVZ1vbylOQ7vvu94NdZRRxKc9hh5i kIBtkvIZwywW3aMs7dUi/oaLHia0KNd04p/ZXYAztL8Wg1Sd0W8zEzyAXx+Nb5OcUFaN k5MreY9GKqUEDHa9+p2CoSyQL4+CJmKK9Ago7P/TzIaRNd7FKO9HT/48Npy5RGrsKQ3b OljhSe/gjzYqCWg16zKWgMY+yiKf0p55FA8QRBQP7vO5ipcGRhbv6XYBmORFOT7nYwyq LFn7kaNJTADoVUC70evRNh5nH1c5Ee0gccKMu4qcMbVT4C6bNgSvyA83PgyQgcBD+pSp h7Jg== X-Gm-Message-State: AOJu0Yznj4wIiJvceud2vPQLXYgSf1cC/Nnx+hZuns2XtHsLp7JXG4KY v+36nvfUGbLn60ypSeBRka8e313G2+X1g76JOVI09/z6AHRaYSxPjSN6UEGh/rtZWZk+BSxmAUk unC3kbg== X-Google-Smtp-Source: AGHT+IFCJNPxA0ymgc0crc+lDlCY1QOB8Hp3b0+kuUENYA4vQyrKLs5KqDKUcIFiHDf1YaUt3DXpXw== X-Received: by 2002:a05:6820:168d:b0:5da:9bde:1c0b with SMTP id 006d021491bc7-5dfacc16c7cmr19746949eaf.0.1725456460886; Wed, 04 Sep 2024 06:27:40 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5dfa0580692sm2308062eaf.46.2024.09.04.06.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 06:27:40 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com Cc: Christophe Lyon Subject: [PATCH v2 23/36] arm: [MVE intrinsics] factorize vdwdup viwdup Date: Wed, 4 Sep 2024 13:26:37 +0000 Message-Id: <20240904132650.2720446-24-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240904132650.2720446-1-christophe.lyon@linaro.org> References: <20240711214305.3193022-1-christophe.lyon@linaro.org> <20240904132650.2720446-1-christophe.lyon@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Factorize vdwdup and viwdup so that they use the same parameterized names. Like with vddup and vidup, we do not bother with the corresponding expanders, as we stop using them in a subsequent patch. The patch also adds the missing attributes to vdwdupq_wb_u_insn and viwdupq_wb_u_insn patterns. 2024-08-21 Christophe Lyon gcc/ * config/arm/iterators.md (mve_insn): Add VIWDUPQ, VDWDUPQ, VIWDUPQ_M, VDWDUPQ_M. (VIDWDUPQ): New iterator. (VIDWDUPQ_M): New iterator. * config/arm/mve.md (mve_vdwdupq_wb_u_insn) (mve_viwdupq_wb_u_insn): Merge into ... (@mve_q_wb_u_insn): ... this. Add missing mve_unpredicated_insn and mve_move attributes. (mve_vdwdupq_m_wb_u_insn, mve_viwdupq_m_wb_u_insn): Merge into ... (@mve_q_m_wb_u_insn): ... this. --- gcc/config/arm/iterators.md | 4 +++ gcc/config/arm/mve.md | 68 +++++++------------------------------ 2 files changed, 17 insertions(+), 55 deletions(-) diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index c0299117f26..2fb3b25040f 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -1009,6 +1009,8 @@ (define_int_attr mve_insn [ (VHSUBQ_S "vhsub") (VHSUBQ_U "vhsub") (VIDUPQ "vidup") (VDDUPQ "vddup") (VIDUPQ_M "vidup") (VDDUPQ_M "vddup") + (VIWDUPQ "viwdup") (VDWDUPQ "vdwdup") + (VIWDUPQ_M "viwdup") (VDWDUPQ_M "vdwdup") (VMAXAQ_M_S "vmaxa") (VMAXAQ_S "vmaxa") (VMAXAVQ_P_S "vmaxav") @@ -2968,6 +2970,8 @@ (define_int_iterator VCVTxQ [VCVTAQ_S VCVTAQ_U VCVTMQ_S VCVTMQ_U VCVTNQ_S VCVTNQ (define_int_iterator VCVTxQ_M [VCVTAQ_M_S VCVTAQ_M_U VCVTMQ_M_S VCVTMQ_M_U VCVTNQ_M_S VCVTNQ_M_U VCVTPQ_M_S VCVTPQ_M_U]) (define_int_iterator VIDDUPQ [VIDUPQ VDDUPQ]) (define_int_iterator VIDDUPQ_M [VIDUPQ_M VDDUPQ_M]) +(define_int_iterator VIDWDUPQ [VIWDUPQ VDWDUPQ]) +(define_int_iterator VIDWDUPQ_M [VIWDUPQ_M VDWDUPQ_M]) (define_int_iterator DLSTP [DLSTP8 DLSTP16 DLSTP32 DLSTP64]) (define_int_iterator LETP [LETP8 LETP16 LETP32 diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 3477bbdda7b..be3be67a144 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -5156,22 +5156,23 @@ (define_expand "mve_vdwdupq_wb_u" }) ;; -;; [vdwdupq_wb_u_insn]) +;; [vdwdupq_wb_u_insn, viwdupq_wb_u_insn] ;; -(define_insn "mve_vdwdupq_wb_u_insn" +(define_insn "@mve_q_wb_u_insn" [(set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:SI 2 "s_register_operand" "1") (subreg:SI (match_operand:DI 3 "s_register_operand" "r") 4) (match_operand:SI 4 "mve_imm_selective_upto_8" "Rg")] - VDWDUPQ)) + VIDWDUPQ)) (set (match_operand:SI 1 "s_register_operand" "=Te") (unspec:SI [(match_dup 2) (subreg:SI (match_dup 3) 4) (match_dup 4)] - VDWDUPQ))] + VIDWDUPQ))] "TARGET_HAVE_MVE" - "vdwdup.u%#\t%q0, %2, %R3, %4" -) + ".u%#\t%q0, %2, %R3, %4" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_wb_u_insn")) + (set_attr "type" "mve_move")]) ;; ;; [vdwdupq_m_n_u]) @@ -5214,27 +5215,27 @@ (define_expand "mve_vdwdupq_m_wb_u" }) ;; -;; [vdwdupq_m_wb_u_insn]) +;; [vdwdupq_m_wb_u_insn, viwdupq_m_wb_u_insn] ;; -(define_insn "mve_vdwdupq_m_wb_u_insn" +(define_insn "@mve_q_m_wb_u_insn" [(set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:MVE_2 2 "s_register_operand" "0") (match_operand:SI 3 "s_register_operand" "1") (subreg:SI (match_operand:DI 4 "s_register_operand" "r") 4) (match_operand:SI 5 "mve_imm_selective_upto_8" "Rg") (match_operand: 6 "vpr_register_operand" "Up")] - VDWDUPQ_M)) + VIDWDUPQ_M)) (set (match_operand:SI 1 "s_register_operand" "=Te") (unspec:SI [(match_dup 2) (match_dup 3) (subreg:SI (match_dup 4) 4) (match_dup 5) (match_dup 6)] - VDWDUPQ_M)) + VIDWDUPQ_M)) ] "TARGET_HAVE_MVE" - "vpst\;vdwdupt.u%#\t%q2, %3, %R4, %5" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vdwdupq_wb_u_insn")) + "vpst\;t.u%#\t%q2, %3, %R4, %5" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_wb_u_insn")) (set_attr "type" "mve_move") (set_attr "length""8")]) @@ -5273,24 +5274,6 @@ (define_expand "mve_viwdupq_wb_u" DONE; }) -;; -;; [viwdupq_wb_u_insn]) -;; -(define_insn "mve_viwdupq_wb_u_insn" - [(set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:SI 2 "s_register_operand" "1") - (subreg:SI (match_operand:DI 3 "s_register_operand" "r") 4) - (match_operand:SI 4 "mve_imm_selective_upto_8" "Rg")] - VIWDUPQ)) - (set (match_operand:SI 1 "s_register_operand" "=Te") - (unspec:SI [(match_dup 2) - (subreg:SI (match_dup 3) 4) - (match_dup 4)] - VIWDUPQ))] - "TARGET_HAVE_MVE" - "viwdup.u%#\t%q0, %2, %R3, %4" -) - ;; ;; [viwdupq_m_n_u]) ;; @@ -5331,31 +5314,6 @@ (define_expand "mve_viwdupq_m_wb_u" DONE; }) -;; -;; [viwdupq_m_wb_u_insn]) -;; -(define_insn "mve_viwdupq_m_wb_u_insn" - [(set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 2 "s_register_operand" "0") - (match_operand:SI 3 "s_register_operand" "1") - (subreg:SI (match_operand:DI 4 "s_register_operand" "r") 4) - (match_operand:SI 5 "mve_imm_selective_upto_8" "Rg") - (match_operand: 6 "vpr_register_operand" "Up")] - VIWDUPQ_M)) - (set (match_operand:SI 1 "s_register_operand" "=Te") - (unspec:SI [(match_dup 2) - (match_dup 3) - (subreg:SI (match_dup 4) 4) - (match_dup 5) - (match_dup 6)] - VIWDUPQ_M)) - ] - "TARGET_HAVE_MVE" - "vpst\;\tviwdupt.u%#\t%q2, %3, %R4, %5" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_viwdupq_wb_u_insn")) - (set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vstrwq_scatter_base_wb_s vstrwq_scatter_base_wb_u] ;;