From patchwork Mon Aug 14 18:34:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 135594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2930415vqi; Mon, 14 Aug 2023 11:39:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/pkFZG+4JCZt1I3OP1XbOd+gnie/GPVeZIx3ac6XfmZS1MudwqqKlmVZrsFNql4IsqZal X-Received: by 2002:a05:6402:34c3:b0:51d:cf7b:c9f0 with SMTP id w3-20020a05640234c300b0051dcf7bc9f0mr16980262edc.12.1692038362656; Mon, 14 Aug 2023 11:39:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692038362; cv=none; d=google.com; s=arc-20160816; b=iQJzuBIXTeIlvLMcCUJMDxU/KiU9HYTvBm6apwFuM1xsojg3574nQnnUiIzN+skahJ mo3F5sDy9bCpM1raum5QQU7E+ZZ4mrliBTgsqJ/HqS7jfhMRdeTqAHtVFQW2ENTxZzZz FwBNBX1ABfVotpn+DRcIAagBYsOa3626tV0WLYHqaWeR6EPELqTBjxDZVm+eC1TbtBcZ S4xxDRjtN3XfwGeiWmPj7wmiz5hLBdyDHjS6VqJI6h1NBtjhwZxmrhrKrV5agLQ6GuxZ EGtTJjgY/3St8eP+qPWs6l7xromy0k0MpTvHlb+PLPyYcMnGVRelgqyKnmRKGcd9fkPo G7Wg== 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=PJl6BDMKoW6okLZTQIGhoMQj5YF5VbZc6fIclEAmlaY=; fh=XxyM7Ym2GZuIk6CR9Av7X+K6FIjQnvqQn0ljduIMmhY=; b=b6304pGm8CcTzirG5BBuYMuNjQLe1dIh8X0lm9x5mMiJYRNgoYruXeCRA9edESgp8R INWPUW1LMB7agGe2TRAWVzu3JNVdAcw148rqNN1kFkQ04iwkoBh3KDSaWD69KN09nQzP 2mEjxFqJn6Zcc4OjNHY0AbXtsUh0iR5eDltVFak2dJjglB1M8MEYzgy+Mq0cJ0HngMat 6xQDcFZG3f5bTj01UVsb8G2uS+0Lllxn8JCk+wQhZu61XdFIMiaNf/ruxo/2LPZQpCE6 hH7hFUDvaYJBENiRvN5ZVLGQgRHkgIM6gITbQBeGxPHcm8CKlWhaTljceg6jYG0xbkTK OsNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HyP0ACjo; 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 o20-20020a056402039400b00524850e0ebcsi4719288edv.452.2023.08.14.11.39.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:39:22 -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=HyP0ACjo; 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 F0749385E038 for ; Mon, 14 Aug 2023 18:37:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0749385E038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692038243; bh=PJl6BDMKoW6okLZTQIGhoMQj5YF5VbZc6fIclEAmlaY=; 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=HyP0ACjoFBW5pq4Cqpnu9iTXvsuQ2XWahJOhP3SLXyJEftdt0HzHIY9VGgEgYgUDz NKu6yadEODFx64QUHgA9MO2S4Y+bqjS6aUl3bimxja3W0T626ML8duvDmvLsPwFEqy xrg4ODiaHazvhCVYE0YPFtnIWN+TywD2KHxReT3E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by sourceware.org (Postfix) with ESMTPS id D78923857351 for ; Mon, 14 Aug 2023 18:34:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D78923857351 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1c5046642b4so674695fac.1 for ; Mon, 14 Aug 2023 11:34:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038088; x=1692642888; 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=PJl6BDMKoW6okLZTQIGhoMQj5YF5VbZc6fIclEAmlaY=; b=gUQw0AdfT5T5sxsKwuXClsOxUTwuEVsA4gEjW/oC0wYOSSyDVzBl15qFLy1w9AGtL1 +B4RZ19npDyq2G0m9QbfBJInSUO5Py8GCagtRmEkgG/jMOSS3Qr2wQlRh3L7v5DMkLtj dwUqacKYP8SfE+nRtAMNKm3S3YlKxE2kkcThkjg5mAyvWbuIuY4ZxEV0OoEcaeHo3QKr vDrapK3N5g9IegXMTbjPGZ7u0e/gpWAUCgYLjizqada1n7feZ5KNqJZ5/XPCS0lDhDSY PaJDSr5Hx/UxUYkfwWRQnuF7PpCp5+pCarvMcxsnMhzCn3qyC2SsPApnGUPOi0zFT6fV Tw5Q== X-Gm-Message-State: AOJu0YxxkCH3Iz0pGhGw5h4jN+DykkittNrsoEkR7omZk13vu4v7Z+xp YFilV2nYmCdKpkynO5za8f6OX9h2hbeeYNXjk0wN2N54 X-Received: by 2002:a05:6870:55a9:b0:1c0:b4ec:c0fa with SMTP id n41-20020a05687055a900b001c0b4ecc0famr12048528oao.41.1692038087788; Mon, 14 Aug 2023 11:34:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:34:47 -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 8/9] arm: [MVE intrinsics] add unspec_mve_function_exact_insn_vmull_poly Date: Mon, 14 Aug 2023 18:34:21 +0000 Message-Id: <20230814183422.1905511-8-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: 1774230818537042485 X-GMAIL-MSGID: 1774230818537042485 Introduce a function that will be used to build vmull[bt]q_poly intrinsics that use poly types. 2023-08-14 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-functions.h (class unspec_mve_function_exact_insn_vmull_poly): New. --- gcc/config/arm/arm-mve-builtins-functions.h | 56 ++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/gcc/config/arm/arm-mve-builtins-functions.h b/gcc/config/arm/arm-mve-builtins-functions.h index c0fc450f886..eba1f071af0 100644 --- a/gcc/config/arm/arm-mve-builtins-functions.h +++ b/gcc/config/arm/arm-mve-builtins-functions.h @@ -838,7 +838,6 @@ 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 @@ -912,6 +911,61 @@ public: } }; +/* Map the vmull_poly-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 _poly in + their names, and use the special poly type.. */ +class unspec_mve_function_exact_insn_vmull_poly : public function_base +{ +public: + CONSTEXPR unspec_mve_function_exact_insn_vmull_poly (int unspec_for_poly, + int unspec_for_m_poly) + : m_unspec_for_poly (unspec_for_poly), + m_unspec_for_m_poly (unspec_for_m_poly) + {} + + /* The unspec code associated with signed-integer, unsigned-integer + and poly operations respectively. It covers the cases with and + without the _m predicate. */ + int m_unspec_for_poly; + int m_unspec_for_m_poly; + + rtx + expand (function_expander &e) const override + { + insn_code code; + + if (e.mode_suffix_id != MODE_none) + gcc_unreachable (); + + if (! e.type_suffix (0).poly_p) + gcc_unreachable (); + + switch (e.pred) + { + case PRED_none: + /* No predicate, no suffix. */ + code = code_for_mve_q_poly (m_unspec_for_poly, m_unspec_for_poly, e.vector_mode (0)); + return e.use_exact_insn (code); + + case PRED_m: + /* No suffix, "m" predicate. */ + code = code_for_mve_q_poly_m (m_unspec_for_m_poly, m_unspec_for_m_poly, e.vector_mode (0)); + return e.use_cond_insn (code, 0); + + case PRED_x: + /* No suffix, "x" predicate. */ + code = code_for_mve_q_poly_m (m_unspec_for_m_poly, m_unspec_for_m_poly, 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