From patchwork Mon Aug 14 18:34:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 135590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2929090vqi; Mon, 14 Aug 2023 11:36:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpAzc5EUC5KL7oFxxGuT4qCx0z1YgXwZhONkQHlJXCvxtqWIsw7QIAxSUO5Tir/EbF7p1W X-Received: by 2002:a05:6512:3992:b0:4fe:279b:7609 with SMTP id j18-20020a056512399200b004fe279b7609mr7974434lfu.17.1692038197280; Mon, 14 Aug 2023 11:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692038197; cv=none; d=google.com; s=arc-20160816; b=M/fGKVwiveAdxcTzUfGRwbJQfDg/HqWBQUbPT8bN1cQ4aTh/6CSi10Ki8pCLY+lej8 O/XMCAjY2f9aqfBczg6D2NoVgAXYSa6tBY+x0TZ9iggjlap4Ylm2xuqaWf4dztg7fZa6 bbUQyRrrHqTd/dSyQwrGPA3DgyRVcjNT5wo8c5nxP7tbvs2pbiuaXwCTW2ySWwO3120t 3L5bV6CMsYEiSjD6uE3uJJQqyHVRj1eykXvohkjcUo4ozV83Ybw/QxbArvXsqklBoNiN uoerw21LdfpkWFknherbc4HHH0t3UvfJnNVD1DDPwpZv0lilr0mGM84I7gTvNmJGf5bh FgNg== 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=zRkerbm3htdEml7Pcanw5hQjeKx24JL/gcnZeCDmgf8=; fh=XxyM7Ym2GZuIk6CR9Av7X+K6FIjQnvqQn0ljduIMmhY=; b=0XKKhJ/1AEoKRJTrpH81HvxNXc1dGigehYv7n8+GH35HLXhgKOgz0aKT9/tBIDYKcA p/0QUwiPar20Rhh56NCxrKeovPqLKfkAvztktescWbCX+QUirflez+kXR9eS6n9cGWBL AaCU7rsvUiokG5oSO778V8eEK387oh1wz/hIEqHfEWM+ALFjJHllORryUmq+dC/EZm9T uM/HnQJ+AMb5te1KYLTx42gXUVsMuS87T0zkiYM0kArI6K8SkND9wO5qxxEkeZ8SAcxD kjsLRTRUlpT6kYLJ1xfRNt0FYPidPyKH1tqtx83xGpsbjaZDLVGXoZ6hWLjWkjlCCZDF vOBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="TVkTobC/"; 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 ay2-20020a056402202200b005254561b160si4035273edb.483.2023.08.14.11.36.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:36:37 -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="TVkTobC/"; 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 D3C1B3836E96 for ; Mon, 14 Aug 2023 18:35:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3C1B3836E96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692038132; bh=zRkerbm3htdEml7Pcanw5hQjeKx24JL/gcnZeCDmgf8=; 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=TVkTobC/yEhzr0e6nDR/R/dHnLebJFZ1vRJr+hHXxcl1F5SWXwRwJHGmpUi5mN7el syntBMzWFPzUI4uyG1vjy5iJKD64mCqo6zgpR7+F2Q2g+UKymOO8K1NCtcKBxUuhxT YuyijoHxrQ/ceDOZyHTdXmDCthnqrvRbMMglXIm0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 236323858421 for ; Mon, 14 Aug 2023 18:34:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 236323858421 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1bfc2b68090so3523138fac.3 for ; Mon, 14 Aug 2023 11:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038085; x=1692642885; 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=zRkerbm3htdEml7Pcanw5hQjeKx24JL/gcnZeCDmgf8=; b=XIyufQyKf1tKUu4Xd84IC8NPXWyxHSJLnSeqzi6wh48DckGj+ANdvf9sHju7DSLF9f NNGQ+/QnapBnEglryPz3oITwgwGzgi3NgsSDBbI5ln3kiYEUXYpzUzY1ewA5Bqycx5WJ kEpZFLwPkWaW/jwvFzqlbjb28dc7DB0pGkk2VXe8F6Ltn+V5xwOASAZFWiJ/1cBNj2hF YY8MMrDdqvOhJp2neibLTyX4wihTJk0rlpTfsaZ7yeFMoENhO7jNHxpb0/Nesbh9+POv 7g18Q3ktNMAsRpmc9aDlbr/HKaLPKLIwB1VPjuxbKjkIvDU0xN1bliq/PNzmQLh8hP+Q z37A== X-Gm-Message-State: AOJu0YzXHvN3nCVoRWJ7L/w5hmX6Tz+HlI+10VqBxDE49gMl693lnbMU n6NyYTlfi9+zl8fFXEq1WM20C+w/jHcRF5G5ypAEtciW X-Received: by 2002:a05:6870:ac2b:b0:1ba:bb13:d007 with SMTP id kw43-20020a056870ac2b00b001babb13d007mr9307241oab.5.1692038084933; Mon, 14 Aug 2023 11:34:44 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:34:44 -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 5/9] arm: [MVE intrinsics] add support for p8 and p16 polynomial types Date: Mon, 14 Aug 2023 18:34:18 +0000 Message-Id: <20230814183422.1905511-5-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: 1774230644706461440 X-GMAIL-MSGID: 1774230644706461440 Although they look like aliases for u8 and u16, we need to define them so that we can handle p8 and p16 suffixes with the general framework. They will be used by vmull[bt]q_poly intrinsics. 2023-08-14 Christophe Lyon gcc/ * config/arm/arm-mve-builtins.cc (type_suffixes): Handle poly_p field.. (TYPES_poly_8_16): New. (poly_8_16): New. * config/arm/arm-mve-builtins.def (p8): New type suffix. (p16): Likewise. * config/arm/arm-mve-builtins.h (enum type_class_index): Add TYPE_poly. (struct type_suffix_info): Add poly_p field. --- gcc/config/arm/arm-mve-builtins.cc | 6 ++++++ gcc/config/arm/arm-mve-builtins.def | 2 ++ gcc/config/arm/arm-mve-builtins.h | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc index 7eec9d2861c..fa8b0ad36b3 100644 --- a/gcc/config/arm/arm-mve-builtins.cc +++ b/gcc/config/arm/arm-mve-builtins.cc @@ -128,6 +128,7 @@ CONSTEXPR const type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = { TYPE_##CLASS == TYPE_signed || TYPE_##CLASS == TYPE_unsigned, \ TYPE_##CLASS == TYPE_unsigned, \ TYPE_##CLASS == TYPE_float, \ + TYPE_##CLASS == TYPE_poly, \ 0, \ MODE }, #include "arm-mve-builtins.def" @@ -177,6 +178,10 @@ CONSTEXPR const type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = { #define TYPES_all_signed(S, D) \ S (s8), S (s16), S (s32) +/* _p8 _p16. */ +#define TYPES_poly_8_16(S, D) \ + S (p8), S (p16) + /* _u8 _u16 _u32. */ #define TYPES_all_unsigned(S, D) \ S (u8), S (u16), S (u32) @@ -275,6 +280,7 @@ DEF_MVE_TYPES_ARRAY (integer_8); DEF_MVE_TYPES_ARRAY (integer_8_16); DEF_MVE_TYPES_ARRAY (integer_16_32); DEF_MVE_TYPES_ARRAY (integer_32); +DEF_MVE_TYPES_ARRAY (poly_8_16); DEF_MVE_TYPES_ARRAY (signed_16_32); DEF_MVE_TYPES_ARRAY (signed_32); DEF_MVE_TYPES_ARRAY (reinterpret_integer); diff --git a/gcc/config/arm/arm-mve-builtins.def b/gcc/config/arm/arm-mve-builtins.def index e3f37876210..e2cf1baf370 100644 --- a/gcc/config/arm/arm-mve-builtins.def +++ b/gcc/config/arm/arm-mve-builtins.def @@ -63,6 +63,8 @@ DEF_MVE_TYPE_SUFFIX (u8, uint8x16_t, unsigned, 8, V16QImode) DEF_MVE_TYPE_SUFFIX (u16, uint16x8_t, unsigned, 16, V8HImode) DEF_MVE_TYPE_SUFFIX (u32, uint32x4_t, unsigned, 32, V4SImode) DEF_MVE_TYPE_SUFFIX (u64, uint64x2_t, unsigned, 64, V2DImode) +DEF_MVE_TYPE_SUFFIX (p8, uint8x16_t, poly, 8, V16QImode) +DEF_MVE_TYPE_SUFFIX (p16, uint16x8_t, poly, 16, V8HImode) #undef REQUIRES_FLOAT #define REQUIRES_FLOAT true diff --git a/gcc/config/arm/arm-mve-builtins.h b/gcc/config/arm/arm-mve-builtins.h index c9b51a0c77b..37b8223dfb2 100644 --- a/gcc/config/arm/arm-mve-builtins.h +++ b/gcc/config/arm/arm-mve-builtins.h @@ -146,6 +146,7 @@ enum type_class_index TYPE_float, TYPE_signed, TYPE_unsigned, + TYPE_poly, NUM_TYPE_CLASSES }; @@ -221,7 +222,9 @@ struct type_suffix_info unsigned int unsigned_p : 1; /* True if the suffix is for a floating-point type. */ unsigned int float_p : 1; - unsigned int spare : 13; + /* True if the suffix is for a polynomial type. */ + unsigned int poly_p : 1; + unsigned int spare : 12; /* The associated vector or predicate mode. */ machine_mode vector_mode : 16;