From patchwork Thu Nov 16 15:26: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: 165855 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp3287057vqg; Thu, 16 Nov 2023 07:27:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6uT94FQHTlaAOeDM0LgYO+OR03OaTiILZVCXS2JQgDj1UumbpLoj2wD54DXwIi/yydMIG X-Received: by 2002:a05:622a:118f:b0:418:b8c:1a0a with SMTP id m15-20020a05622a118f00b004180b8c1a0amr10656648qtk.25.1700148454923; Thu, 16 Nov 2023 07:27:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700148454; cv=pass; d=google.com; s=arc-20160816; b=xAor35Von10h4Ak3Nyn6s4tEXnQtV29nmwO9cNyEjaaTqb50knEV+UNkFCzR3iPJoL wzHdz48rpYZmufL4wocV0Vg9vifwlTWmixRW+EmP4/NtlmGOKbdSF5Ghr4jg3rJNCFw+ kMLDh3CiAInA5Cvalb2IQ5P64jqrTQZlMnMmW8vvWKk9uR+Y/quRL8c1RWg4VT4+7QpR +UX1Sqq2qfNK8ANpkya/ghSWBXYX0eyf044p+3RYTQEPWC+Hs7oJLtJH9XLDwol88Q1z k81BYb22IeeZLOLu/5XxBFVvRX/TDJpFWKAWGsE1+Wb9QzrwilO6NkfHxckZYlbljiBR nI8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to: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 :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=vNmbB1j0IaR5clhM2aMwLSpUwYKgcbWQIBRC7b8MIU0=; fh=FRNyphhuT2DfOrWLD6nTLzU8xRqveLticgMhz0p6TRc=; b=d/Y2EpwFLswmBdjI60WPawUadhA8vzwpNbtFOrB1MahpFhj3wdqwvO69aacqFrdGXa 2v2FOuCXakxNmYArD6XL4q0x8M1PdADoTyqgQJvqGWqkcqL8DmUVTxUHL7sjExYc9fAm Ffx/RjbfyJRjhGrIK8I2wczT8AZspMXSvvMKWnoc0eWwzwf0h7ixeTFOmp0/bN/s0fu7 UncfHDssfSfvQ2fCryIZeQGecD4TFGBDzFXZZ9Md5hbUCpeAf4HcZ+m5DGE86+wh6M6a 3N4Mk3P3Z8s9Gr3mkepphkQ2r5x9eWKCMzAlkw7yBtwfZCix6/u5Fzzd38lQZKYeYXo+ DXbQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hxZmCFgs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id u12-20020a05622a198c00b0041986d6423fsi11244329qtc.195.2023.11.16.07.27.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:27:34 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hxZmCFgs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAABB3857C50 for ; Thu, 16 Nov 2023 15:27:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id 941093858289 for ; Thu, 16 Nov 2023 15:26:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 941093858289 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 941093858289 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700148414; cv=none; b=ECH9Gf3WzXeloLcQnh8BTJ7ZOLvBOgrMJovKBKKuYt/d0DVq2vjo8U4tzuSzWAedQiS54JnsW6nTu0dDm0EQgu/sqt0GlvbSghwe34LVtsL1G8Mc0PmzvxcD8KqrwiAeAGBZjEpkCxqmsQgRqy6ng7XXaxsOQSdHOJYUYUOk2cM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700148414; c=relaxed/simple; bh=hpIwc0LeWfGmUXzU3vYttcKm6JBOQ6VQG+AH8duWftw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=H96jZw0bqE8PJU6xxW28kcbli9oNP8sNQPtF+9nlftV7dVXsKB0fowlQM680sHSd1wBSH6vaqdaY/OWGTnIW8X3CL9XRq5lTjxvFiAHSYBUWJTEkya5oqe4tnVz2MKVzfoUdO/lGPNet/GAVUvUsVoRT82CYpDTkePi6QT3tfTM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b6d80daae8so567614b6e.2 for ; Thu, 16 Nov 2023 07:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700148411; x=1700753211; 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=vNmbB1j0IaR5clhM2aMwLSpUwYKgcbWQIBRC7b8MIU0=; b=hxZmCFgsbCmafB9tJBUyEe8uWyQoU1ThPkqPK9Zv14UV3Zlb6/zHtRx/X5uwXmUFx5 LsBG/BsCmR00emv4/HZaiE/FOkhVifb1RtYlzS/6YWVmDdOsU23COMGUn55tZjEoSWjt Wzo2sWPM+gLdFtvWrC3efj+tDTGfWTSAtRtIbqP+7pPAqHZthIcQMFN/l6IgRn/pBRLM mM+wN3iRXwxVX+MLD01ljVhCqQacgJYsCX94krq+Ek4d7KwlWvabu+L/CKGsbDy7F0R1 aBky7gClnJCT9HP765PYYSK2A5JUmuFOtaz0ESTVFbc0K1XNcPsiSHGljaLaacnzCcpg B4LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700148411; x=1700753211; 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=vNmbB1j0IaR5clhM2aMwLSpUwYKgcbWQIBRC7b8MIU0=; b=pZfZWsfnBT9REtdNQE1n8fMr1lPlWRWdhEzqJQRBayVen3tTJIlefZIXpG9UB2EjRB 543b1Tyqphaw3z+t1eQhyCWPKTKrIxXUEgsOzTrYaa6Qb4w2o4ZI4HKP5wT39iR/CQco drGfF72MpbB2owU8/uZ4wJVE6VaH2zHEfxWojqnea7XVtZ7oSJm2oD096RjKHgOVxa9W D9HXXGMXAdZI7FE/fRAsle5LtbOgWReCsvZt6sHEe5ztmYpZTHDVjzaZVLLPY/cn5ozo JzOF243QudazlGsD4EmaOhUA60IJua1GT/j2fO1EDe1QkhYA3T/BVnVOlS2NM5XHmdAD udgg== X-Gm-Message-State: AOJu0YwAzINwmkXNqef+8X2uhxJ8Da11BFXjZQqfifjpVqKF32Ild3a7 Z+b+V3hjnFEQnuyI7wqHWKd8wzBJb/UUkrnk3pnSZ1li X-Received: by 2002:a05:6808:2a04:b0:3b2:e61f:f0a8 with SMTP id ez4-20020a0568082a0400b003b2e61ff0a8mr18074181oib.45.1700148411109; Thu, 16 Nov 2023 07:26:51 -0800 (PST) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id a26-20020a056808099a00b003af5f6e40d7sm1817426oic.15.2023.11.16.07.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 07:26:50 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com, richard.earnshaw@arm.com, kyrylo.tkachov@arm.com Cc: Christophe Lyon Subject: [PATCH 4/6] arm: [MVE intrinsics] add load and store shapes Date: Thu, 16 Nov 2023 15:26:15 +0000 Message-Id: <20231116152617.2193377-4-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231116152617.2193377-1-christophe.lyon@linaro.org> References: <20231116152617.2193377-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, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782734866164868002 X-GMAIL-MSGID: 1782734866164868002 This patch adds the load and store shapes descriptions. 2023-11-16 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (load, store): New. * config/arm/arm-mve-builtins-shapes.h (load, store): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 67 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 2 + 2 files changed, 69 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index ce87ebcef30..fe983e7c736 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1428,6 +1428,38 @@ struct inherent_def : public nonoverloaded_base }; SHAPE (inherent) +/* sv_t svfoo[_t0](const _t *) + + Example: vld1q. + int8x16_t [__arm_]vld1q[_s8](int8_t const *base) + int8x16_t [__arm_]vld1q_z[_s8](int8_t const *base, mve_pred16_t p) */ +struct load_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, "t0,al", group, MODE_none, preserve_user_namespace); + } + + /* Resolve a call based purely on a pointer argument. */ + tree + resolve (function_resolver &r) const override + { + gcc_assert (r.mode_suffix_id == MODE_none); + + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (1, i, nargs) + || (type = r.infer_pointer_type (i)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (load) + /* _t vfoo[_t0](_t) _t vfoo_n_t0(_t) @@ -1477,6 +1509,41 @@ struct mvn_def : public overloaded_base<0> }; SHAPE (mvn) +/* void vfoo[_t0](_t *, v[xN]_t) + + where might be tied to (for non-truncating stores) or might + depend on the function base name (for truncating stores). + + Example: vst1q. + void [__arm_]vst1q[_s8](int8_t *base, int8x16_t value) + void [__arm_]vst1q_p[_s8](int8_t *base, int8x16_t value, mve_pred16_t p) */ +struct store_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, "_,as,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + gcc_assert (r.mode_suffix_id == MODE_none); + + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || !r.require_pointer_type (0) + || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (store) + /* _t vfoo[_t0](_t, _t, _t) i.e. the standard shape for ternary operations that operate on diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index a93245321c9..aa9309dec7e 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -61,7 +61,9 @@ namespace arm_mve extern const function_shape *const cmp; extern const function_shape *const create; extern const function_shape *const inherent; + extern const function_shape *const load; extern const function_shape *const mvn; + extern const function_shape *const store; extern const function_shape *const ternary; extern const function_shape *const ternary_lshift; extern const function_shape *const ternary_n;