From patchwork Mon Aug 14 18:34:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 135589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2929038vqi; Mon, 14 Aug 2023 11:36:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfdCkvL8/IelAHa9F/jEYs+rpOaE5baYkT5Di5ssW26ZsiYd4O6TVQZwtoF8Trd2SRjFg/ X-Received: by 2002:a19:6714:0:b0:4fb:772a:af12 with SMTP id b20-20020a196714000000b004fb772aaf12mr6074769lfc.21.1692038190151; Mon, 14 Aug 2023 11:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692038190; cv=none; d=google.com; s=arc-20160816; b=tYcBr7v6ClP1W3J0GdOk4ITeVgC/EkccKaa21+l+T5PovvGBys8fMF22QhgW1W/smm +cCZs+gpbkA0eWa1iBrlqJUNaU6114Dn8s6XpGIinXngPQkNqQcsTbHGzRDDWPDyWNZI LcGCUzATTRx/SpZ1Hf9tlkQ75Gp3E0Vr/GEonEfZ42Nb7NNMuXa1N9E1HRnuNCbKFLy/ 6+OH49AXHjWxoI7Nslu098/1+DSadT75z6oqeoywBepKN47gAm2r3H3Mye4a0jTv5LDv pPJIvfavh6Af5am4kg8gSMXMa9GXgxzN/5QgssSFtOzSfW+gICDjX1MLSunqX7VKMPcX Dc1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from: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:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=dsiOSnz/fMwChNNC5oeJVArFfF8kyDoYwNBQBOmv/E0=; fh=XxyM7Ym2GZuIk6CR9Av7X+K6FIjQnvqQn0ljduIMmhY=; b=NMUYVKCh6c6X9BOIFZfnolODBNveVao3ikqIKF8L/kc77OaCDvD1w0mrSr0Yh7S0uN WGw8STWgbC1oIeJQxK6216txopE+h/2cVeN+59ePnBZcuWpGQszgtNuR7xkAY611KEAx MeGpCB5i4rzLvwMukRmFE0LJfAB+JFmOsGWaeOxs4S+6LFz9uMaxzZuZlQtLylX0w8L+ eGGHeT8j8eOI30+htthgQ5AtI+ff3qXxJUgznyI5PkdyaqgHj+AiyK4/6MPFvPyGBwq2 ouyVzXGyRF2W+LR2PAGAcXJrNuKfHDuWuwuQjSMJcVgikrHPLKm8/dYMAv69wNwgBh2c 3cwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DaUk2Mgo; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m18-20020aa7d352000000b00523371c3d96si8076941edr.661.2023.08.14.11.36.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:36:30 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DaUk2Mgo; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CD9823876891 for ; Mon, 14 Aug 2023 18:35:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD9823876891 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692038129; bh=dsiOSnz/fMwChNNC5oeJVArFfF8kyDoYwNBQBOmv/E0=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=DaUk2MgouLinlklrVy7EPOiWH54uVoyrBd38zXIiMUPD3+z09c2sv3BF3+ALhMDOm N4YKdLxTpcXF/0mck08SJb1fq6bX6oHPgj+3NuytkNBmeoLIlBIYdwNwoP4YFm0J6z r+TbiZCqygWOSIVyiXhI544V1U4z6xDmzPyjfRLU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com [IPv6:2001:4860:4864:20::36]) by sourceware.org (Postfix) with ESMTPS id 65BB23857C45 for ; Mon, 14 Aug 2023 18:34:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65BB23857C45 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1c4f4d67f5bso860468fac.0 for ; Mon, 14 Aug 2023 11:34:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038082; x=1692642882; 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=dsiOSnz/fMwChNNC5oeJVArFfF8kyDoYwNBQBOmv/E0=; b=RzKHA1csteSpQFnwfl8TPPpAD1340U6xXAbHqg6S8R27hBQDXgKdW98jE2s39B4YXx SaaSg8btInHuNXNk63AWmjz4gyxCa83OD+/k0akn/qx92JvTGimocZ6wmlTW8yppRb8o jK0hAPxS4SL2bAszo/o8M1ZdhY3pfgVzMM+NciAsH54saIM/C8pI+j2A8ZXHKtkTxr12 T2FEPQs9Aq2nT6J60iC0yYbx9qmW1BooxEdv2b030SSA0Mcl93wC0eRBhGv6W/8ZLc53 o/5ygjHGf0Y7HoldXCrRavOv07f3Yj4pwI4VsoaNbDEmFEduJ2G5Uv3EW6Jzs+D6EM/m udbQ== X-Gm-Message-State: AOJu0YyoreMsGaCekNBK0lduFhvPKya5AJ/03UbaIsL7z+4U5rwZsKk5 WdpseOKzLOXuHPTPDAQq3yqi7G7wf25hOWmN2bEUR5Xk X-Received: by 2002:a05:6870:b493:b0:1bb:8483:a805 with SMTP id y19-20020a056870b49300b001bb8483a805mr11215337oap.32.1692038082216; Mon, 14 Aug 2023 11:34:42 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id l22-20020a056870e91600b001bec2a8f4e3sm5451968oan.14.2023.08.14.11.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:34:41 -0700 (PDT) To: gcc-patches@gcc.gnu.org, Kyrylo.Tkachov@arm.com, richard.earnshaw@arm.com, richard.sandiford@arm.com Cc: Christophe Lyon Subject: [PATCH 2/9] arm: [MVE intrinsics] add unspec_mve_function_exact_insn_vmull Date: Mon, 14 Aug 2023 18:34:15 +0000 Message-Id: <20230814183422.1905511-2-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230814183422.1905511-1-christophe.lyon@linaro.org> References: <20230814183422.1905511-1-christophe.lyon@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 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 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christophe Lyon via Gcc-patches From: Christophe Lyon Reply-To: Christophe Lyon Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774230637669110615 X-GMAIL-MSGID: 1774230637669110615 Introduce a function that will be used to build vmull intrinsics with the _int variant. 2023-08-14 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-functions.h (class unspec_mve_function_exact_insn_vmull): New. --- gcc/config/arm/arm-mve-builtins-functions.h | 74 +++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-functions.h b/gcc/config/arm/arm-mve-builtins-functions.h index a6573844319..c0fc450f886 100644 --- a/gcc/config/arm/arm-mve-builtins-functions.h +++ b/gcc/config/arm/arm-mve-builtins-functions.h @@ -838,6 +838,80 @@ public: } }; + +/* Map the vmull-related function directly to CODE (UNSPEC, UNSPEC, M) + where M is the vector mode associated with type suffix 0. We need + this special case because the builtins have _int in their + names. */ +class unspec_mve_function_exact_insn_vmull : public function_base +{ +public: + CONSTEXPR unspec_mve_function_exact_insn_vmull (int unspec_for_sint, + int unspec_for_uint, + int unspec_for_m_sint, + int unspec_for_m_uint) + : m_unspec_for_sint (unspec_for_sint), + m_unspec_for_uint (unspec_for_uint), + m_unspec_for_m_sint (unspec_for_m_sint), + m_unspec_for_m_uint (unspec_for_m_uint) + {} + + /* The unspec code associated with signed-integer and + unsigned-integer operations respectively. It covers the cases + with and without the _m predicate. */ + int m_unspec_for_sint; + int m_unspec_for_uint; + int m_unspec_for_m_sint; + int m_unspec_for_m_uint; + + rtx + expand (function_expander &e) const override + { + insn_code code; + + if (! e.type_suffix (0).integer_p) + gcc_unreachable (); + + if (e.mode_suffix_id != MODE_none) + gcc_unreachable (); + + switch (e.pred) + { + case PRED_none: + /* No predicate, no suffix. */ + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_int (m_unspec_for_uint, m_unspec_for_uint, e.vector_mode (0)); + else + code = code_for_mve_q_int (m_unspec_for_sint, m_unspec_for_sint, e.vector_mode (0)); + + return e.use_exact_insn (code); + + case PRED_m: + /* No suffix, "m" predicate. */ + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_int_m (m_unspec_for_m_uint, m_unspec_for_m_uint, e.vector_mode (0)); + else + code = code_for_mve_q_int_m (m_unspec_for_m_sint, m_unspec_for_m_sint, e.vector_mode (0)); + + return e.use_cond_insn (code, 0); + + case PRED_x: + /* No suffix, "x" predicate. */ + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_int_m (m_unspec_for_m_uint, m_unspec_for_m_uint, e.vector_mode (0)); + else + code = code_for_mve_q_int_m (m_unspec_for_m_sint, m_unspec_for_m_sint, e.vector_mode (0)); + + return e.use_pred_x_insn (code); + + default: + gcc_unreachable (); + } + + gcc_unreachable (); + } +}; + } /* end namespace arm_mve */ /* Declare the global function base NAME, creating it from an instance