From patchwork Wed Sep 4 13:26:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 97076 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 AF8CC3886C43 for ; Wed, 4 Sep 2024 13:36:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 6291F3861024 for ; Wed, 4 Sep 2024 13:27:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6291F3861024 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 6291F3861024 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456469; cv=none; b=YTdykc+JGHHlcghaIFeptbFcybly77ubMZD8X1mMQcb+4F36WUA00lIStf7hZIEzjnOavCIFMF5J2cw3R5OHATZeoz6Sfi1T+c8xiVfUG90ng7/OOmZGNJlnY7VD1jI0j3yodDYzoakecub/0xjgBggHyFbobRrYh43qrcAq214= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456469; c=relaxed/simple; bh=gF2PJWXDmQIltTIUSOwB7VI4aN3ItMlga59dNkqgUcM=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Aw19HevSsSIgToureVHCM7SjjtNi2zLrgYImgCoyBjHXWushv/PlNWKnf7We2BxJGbPjMfwGzyVkdjmnVrpC1BPGO1kZIX/7YwZFeumE3ocgtfugl2tUGudIxTzhMj/Yg0okbhKy4re78vir3C2/7SxfC1fU9htk2MUWj4475cE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7092dd03223so2182194a34.1 for ; Wed, 04 Sep 2024 06:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725456466; x=1726061266; 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=z9S0brR7p6pDp9epxeJSE8bo0puluAhN5hCweS/Qx28=; b=SJf9wH7dwhZe0ddjyiNVQCGpnXM8L4ctppqqxvVojZpMZD2vbyfq1fmIqUzYgx5A0H t2vPOMPeRzbJ1zK+kesRnaHLIAuHiKXiVmwJGdgKgZiYFHkVaX9aRbXmZLSTWY/OOCaF z42eHRulqZDa0SaWJoR84XRSzRccbmlwuNd42JlQ3zMW0qve4q+ZBDqKPp5i6jrcYdSE ljkxSG7FBV6PRpVyrVHrIU9WNGsDiN5H1DZCKqY361Xwc9gNRUGerauGsYp4/xO5q2dY yd/f4QIEGFx+4FfeU5mnBemq9DokfWeeKvbMA6/oamWCmWqylTijqdT5TD4y5pQa5/KU UL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725456466; x=1726061266; 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=z9S0brR7p6pDp9epxeJSE8bo0puluAhN5hCweS/Qx28=; b=xPm1EY5C2JkOUjZaWWLKsM8fYeG/JbMBohY8rMLPM5L8gPj2rFugKkOgPpVLeYkdkG BssbJ/CTFdEUQqjVBDMzKI2XyVgY3+b89UnYFKuw422cmSnkNV+OR2l84a0ORaI/dA47 nZy8UIxbIaq/3Ju/56/vdTLBAecV0lQmjPapb7AhXIWwBSlkKp3GP6Urri5AhywYTZci rlcx8KvkJRwtd2kH60Qkug5/vvcZglmO8oCyABVtVQ/SKXFfz0K871VR6/OoFuJNngQf gR3NU96GCLuDnArRFApPx/9D5vealK5w2q4Qtcx2gee3CEhuXC5PelOfELoRXuiz15el B+UQ== X-Gm-Message-State: AOJu0YztTcw5XB/USjbtT+8C/B46//7K7+qgGPhlZvlEDmG6km5JkhZm WvlBMZj049RwGlm2KbGmljPwa/T6UKXXc+btK7bWfaU93yiw9yR97Av00PtZ+fLimpBK+yzL2N4 4Sg5MrA== X-Google-Smtp-Source: AGHT+IH48C/nO5UZmYVTMCUUN4lSjJB3iunOvhtFb2oUy5FvoEYMnNN/UXnuODs++TBYpNLfHdKb5A== X-Received: by 2002:a05:6830:44a8:b0:709:5890:691d with SMTP id 46e09a7af769-70f706e36b4mr14886810a34.4.1725456466329; Wed, 04 Sep 2024 06:27:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 06:27:45 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com Cc: Christophe Lyon Subject: [PATCH v2 28/36] arm: [MVE intrinsics] add vshlc shape Date: Wed, 4 Sep 2024 13:26:42 +0000 Message-Id: <20240904132650.2720446-29-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 This patch adds the vshlc shape description. 2024-08-28 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (vshlc): New. * config/arm/arm-mve-builtins-shapes.h (vshlc): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 44 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 45 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 510f15ae73a..ee6b5b0a7b1 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -2418,6 +2418,50 @@ struct vpsel_def : public overloaded_base<0> }; SHAPE (vpsel) +/* _t vfoo[_t0](T0, uint32_t* , const int) + + Check that 'imm' is in [1..32]. + + Example: vshlcq. + uint8x16_t [__arm_]vshlcq[_u8](uint8x16_t a, uint32_t *b, const int imm) + uint8x16_t [__arm_]vshlcq_m[_u8](uint8x16_t a, uint32_t *b, const int imm, mve_pred16_t p) */ +struct vshlc_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, "v0,v0,as,su64", 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 (3, i, nargs) + || (type = r.infer_vector_type (0)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* Check that arg #2 is a pointer. */ + if (!POINTER_TYPE_P (r.get_argument_type (i - 1))) + return error_mark_node; + + if (!r.require_integer_immediate (i)) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool + check (function_checker &c) const override + { + return c.require_immediate_range (2, 1, 32); + } +}; +SHAPE (vshlc) + } /* end namespace arm_mve */ #undef SHAPE diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index b3d08ab3866..d73c74c8ad7 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -85,6 +85,7 @@ namespace arm_mve extern const function_shape *const viddup; extern const function_shape *const vidwdup; extern const function_shape *const vpsel; + extern const function_shape *const vshlc; } /* end namespace arm_mve::shapes */ } /* end namespace arm_mve */