From patchwork Mon Aug 14 18:34:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 135592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2929841vqi; Mon, 14 Aug 2023 11:38:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWecnACdc49wPUJt4KzL7ZVE1tlLRJSgYAGDeq984+L0HryZfcOVM/SYzUA2Q90SVkB9/N X-Received: by 2002:a17:906:73c7:b0:991:bf04:204f with SMTP id n7-20020a17090673c700b00991bf04204fmr9079373ejl.60.1692038289787; Mon, 14 Aug 2023 11:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692038289; cv=none; d=google.com; s=arc-20160816; b=uR0XDv2jOl4vzVsWRgqohs8DGJVXPgP2QI6OFZRZnCWyOiwJBCN9ErFKKs4Qp+IOnT rLu8LtK0DLNQlyw/yiOMuNHCmUbxRTmR2BJGknckSP2qP2ixb9mC+oVX1Z9LMoS8Q+zH Z8TtbOtxE18wqefm0fI35UEMQRzpvkp+KMMirthXp51/am84aml007d7wsPg8l1V6CyV w2o50Mg/lTePbAsncWE8/elrhn38kKT4tSDuerVtrZ2Ozur+vzdesFR2peiydOiNM6QK r+boTPhwbJmJb3Amuh6Bir5YFTuIrIDSQJB6IYlsAeKEUzhhTVHlN3V5Sj3nk5yLmK5X 6qMA== 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=7Tspv4eu7hZDDni7vmjMHRGznsVZXX8SHrpviRN+1MA=; fh=XxyM7Ym2GZuIk6CR9Av7X+K6FIjQnvqQn0ljduIMmhY=; b=lOnjFKEcEEDGy81UchbrxesbwP7sAGiXBqQY0j+vKl7dMN601KVpQDDfdxPpoiNr39 zma4GDatBYNuT1mZ03HW3GyQUQdz+ErwiXIZkluEGEesfEyvpqvv2vO3W1HuuqNrhGMi EwTezNzmIC5G+Tgyeru/tHfkb+5k2MwhwKSpU+LaiwSQqt379mimIznBmWG1eD6Er2qg 5OuLV69n8+J3PJwDR8ecggZa2DQzDu6msy3C7pU6hv/qkTsaDP9i+tOH6b6HY5wSgzJB NUw8+PNvCfu3quN7OM0gqWwSfW7HngP7FXmrph7PgnMPehC+8cPkPxFa9Y1jrCLdwDkf Wn0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="NqRYk/5P"; 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 qw20-20020a170906fcb400b0097650856f55si8205151ejb.695.2023.08.14.11.38.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:38:09 -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="NqRYk/5P"; 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 545E2385558A for ; Mon, 14 Aug 2023 18:36:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 545E2385558A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692038186; bh=7Tspv4eu7hZDDni7vmjMHRGznsVZXX8SHrpviRN+1MA=; 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=NqRYk/5PmT+JtPl7haIP08JHlVZ5V0I0n8krdFmqHF1wWUnjDhk1g6ElQfJwD44xV pqI2Ss02BAkdyaue+iofA36EuOEnNObqubiGU08N2tbVyV8o49RhTHsgcgA/CxVf8L ykdWjqup8l0YjeReppc/3lRArwKYDjKKKmCdYdqA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by sourceware.org (Postfix) with ESMTPS id 63FFD3857838 for ; Mon, 14 Aug 2023 18:34:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63FFD3857838 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-56d62a80727so3378892eaf.0 for ; Mon, 14 Aug 2023 11:34:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692038083; x=1692642883; 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=7Tspv4eu7hZDDni7vmjMHRGznsVZXX8SHrpviRN+1MA=; b=YBcmQYcPKAI7rMt/qh15xbJaQLKIqcYiQzcvohpPxh4ctw4BMHeYzmQf1Lh6cvpVJG HldqlgShw0M/zrbrbCoZztH3B1oTe2oLNbVjVkq8bd0hs6hWC+YafXF0HENIqckALLUt 9SSfXNlALJEsRaPlXgDSb/vy+wf0ZFBAr/kW6+qfU8/Bo39pJpz3RfJ4wTpEbFYzq65V nZWFVxymLaSA2nRGBEfnT7YqYAKi4Nzely+NbXJYS9N1DJZjD+xEEa+uF73ch5+uz892 yTtSenIHCe3W4BKH3JG+13B+mvpHQBUS5YXd3mLk24/8Ca2dP1eEU+VE3dKQPDlGZJbz Wm3Q== X-Gm-Message-State: AOJu0YyA2J/7pDis72UHLl0zFNiMB2Ixq2mAaQWNw5p8MLUwWtIwpTuo yjZ1FIrqVeSsMeXtDcFJmhv3JH9rQGU0nWTeMB3pTvW6 X-Received: by 2002:a05:6870:b40b:b0:1b4:3cc6:c2b6 with SMTP id x11-20020a056870b40b00b001b43cc6c2b6mr8672029oap.23.1692038083216; Mon, 14 Aug 2023 11:34:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 11:34:42 -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 3/9] arm: [MVE intrinsics] add binary_widen shape Date: Mon, 14 Aug 2023 18:34:16 +0000 Message-Id: <20230814183422.1905511-3-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: 1774230741698781118 X-GMAIL-MSGID: 1774230741698781118 This patch adds the binary_widen shape description. 2023-08-14 Christophe Lyon gcc/: * config/arm/arm-mve-builtins-shapes.cc (binary_widen): New. * config/arm/arm-mve-builtins-shapes.h (binary_widen): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 42 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 5 +-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 1f22201ac95..c8eb3351ef2 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1129,6 +1129,48 @@ struct binary_rshift_narrow_unsigned_def : public overloaded_base<0> }; SHAPE (binary_rshift_narrow_unsigned) +/* _t vfoo[_t0](_t, _t) + + Example: vmullbq. + int32x4_t [__arm_]vmullbq_int[_s16](int16x8_t a, int16x8_t b) + int32x4_t [__arm_]vmullbq_int_m[_s16](int32x4_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p) + int32x4_t [__arm_]vmullbq_int_x[_s16](int16x8_t a, int16x8_t b, mve_pred16_t p) */ +struct binary_widen_def : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_none, preserve_user_namespace); + build_all (b, "vw0,v0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (i - 1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + type_suffix_index wide_suffix + = find_type_suffix (type_suffixes[type].tclass, + type_suffixes[type].element_bits * 2); + + if (!r.require_matching_vector_type (i, type)) + return error_mark_node; + + /* Check the inactive argument has the wide type. */ + if ((r.pred == PRED_m) + && (r.infer_vector_type (0) != wide_suffix)) + return r.report_no_such_form (type); + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (binary_widen) + /* _t vfoo[_n_t0](_t, const int) Check that 'imm' is in the [1..#bits] range. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index a1842f5845c..fa6ec4fc002 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -35,13 +35,13 @@ namespace arm_mve { extern const function_shape *const binary; - extern const function_shape *const binary_lshift; - extern const function_shape *const binary_lshift_r; extern const function_shape *const binary_acc_int32; extern const function_shape *const binary_acc_int64; extern const function_shape *const binary_acca_int32; extern const function_shape *const binary_acca_int64; extern const function_shape *const binary_imm32; + extern const function_shape *const binary_lshift; + extern const function_shape *const binary_lshift_r; extern const function_shape *const binary_lshift_unsigned; extern const function_shape *const binary_maxamina; extern const function_shape *const binary_maxavminav; @@ -54,6 +54,7 @@ namespace arm_mve extern const function_shape *const binary_rshift; extern const function_shape *const binary_rshift_narrow; extern const function_shape *const binary_rshift_narrow_unsigned; + extern const function_shape *const binary_widen; extern const function_shape *const binary_widen_n; extern const function_shape *const binary_widen_opt_n; extern const function_shape *const cmp;