From patchwork Thu Nov 7 09:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 2007901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=M+owRQM1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xkc4L1sSMz1xyd for ; Thu, 7 Nov 2024 20:20:34 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6F0103858D33 for ; Thu, 7 Nov 2024 09:20:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 9208F3858C51 for ; Thu, 7 Nov 2024 09:19:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9208F3858C51 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 9208F3858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730971161; cv=none; b=bi9GlRY3ZwiibAfolEgkf5W/7pWSSKX8x1sQxFz+Z5RiACYstCHsrQvyZlHCNC8PsrJETv11o2yDZFZuh/sy9NbL/xz35BdTNAEteS+DrEhx0XbTv8QHxPgo+aWvnTCIWelieqwv5Uoi/yBcKzpB9zX2JnCNTfkBdHzaLTgU9M0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730971161; c=relaxed/simple; bh=+UuK3IF20Q0Sbiee8dDJxDizT+VKEEEPofS0Mv6sDTw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=H2HA955/0TzsR3rLjz09/O18+89OyuJwu/gMX8dPQg1Op1RYPhdz36KLRxgoJhpEkKHt5U0boQttRrskpO7paquli5uNztQPE7f7GZFsU2n/JvuJGq6fJjbuF/LIDE8rRvgb80026M2rxQU4+IfvjkMafpvbAhXKjOWA4/O5FJQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7183a3f3beaso467283a34.1 for ; Thu, 07 Nov 2024 01:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730971150; x=1731575950; 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=wiqdAevxcC5H1iyP2VVVsZJbbgFmgmLb+3Bp2UzW5Mw=; b=M+owRQM1Ct1RV8nMnppNHA9UMKXqbc14Y4MflBrAVTVjDxVfWq4OUjvHdEYx5L5NyQ OKa4fSaW2edZUKklTEJvHoXkZo9BC9+m4kGlqBA8wbfk3QE4yYafUgLSDh6G8uVelq5h 36tZbntyIOohM3+kRDnPan0RM948GNPjXLsRdyH2WIMX65WXOJjomx9zlybYuzUgxgDi Su/9EOIWP07gSDUWvNb6he/tnNNvZjzPIkKudwHubeqeHxqC10guLGxynD7OQHRn+mfc caBvWqpq5hskj/ZqKoK+IQSO5aTosm2Nr7mNB6CO2eVgiEmNHvR3zNZ2yM1YbDOXEHiH aXDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730971150; x=1731575950; 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=wiqdAevxcC5H1iyP2VVVsZJbbgFmgmLb+3Bp2UzW5Mw=; b=ck79r9QKf9uJ6rkXA7uyNUPn46o85BZiCtCH3wum6G44LIe9W5A9M+Q1zVRhiBEg/F ltYG3CIoboD3UDgrPIaOV58EOcUN+A+jCUb+I853gHpUjOhMiNRxFxn7pmscr2f4lrcO wv4OJILMhCuAmgi+HukDlLuTdPA5Zh37tQ/if089rSv9WPJJVilwXDh5hzK7aO7JpixI y+hMFUwjaBPJiB/0nd32DzDVCCZ5mgCyboj7uZG4IY27g3tN2qG+NJlaUictRDKLEzMT wxbIp2dz7vEBsEil212keL/0apWQp218CLA7suklJzspqFh3/KXchMGRc/Ct3SG5q4yY hfAQ== X-Gm-Message-State: AOJu0YxKhUDtoEQGCeB2822U/ChrLJLVPL9xzXMwlY4SRWZKuD45YXtt /MvWaj561ucWvlqjWb5Mc65/6de2jm5R27B9HfSCA3MNk495tGQn/mxtVYYjCuTwDouShvvhbUL h654Qpw== X-Google-Smtp-Source: AGHT+IHXm8fWcQejUGxb+gOWK2ON4vkj/mxaNvCoq5X3hwvSWWkbDT2s7wJ59IYfDJ/8woCj56D+uA== X-Received: by 2002:a05:6830:6c82:b0:718:ad8a:e2ce with SMTP id 46e09a7af769-718ad8ae570mr18826738a34.17.1730971150534; Thu, 07 Nov 2024 01:19:10 -0800 (PST) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71a108e344asm189755a34.48.2024.11.07.01.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 01:19:09 -0800 (PST) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com, andre.simoesdiasvieira@arm.com Cc: Christophe Lyon Subject: [PATCH 06/15] arm: [MVE intrinsics] Add store_scatter_base shape Date: Thu, 7 Nov 2024 09:18:11 +0000 Message-Id: <20241107091820.2010568-7-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241107091820.2010568-1-christophe.lyon@linaro.org> References: <20241107091820.2010568-1-christophe.lyon@linaro.org> MIME-Version: 1.0 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~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch adds the store_scatter_base shape description. gcc/ChangeLog: * config/arm/arm-mve-builtins-shapes.cc (store_scatter_base): New. * config/arm/arm-mve-builtins-shapes.h (store_scatter_base): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 49 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 50 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 9350805c2a2..64d4ba5d74e 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1677,6 +1677,55 @@ struct store_scatter_offset_def : public store_scatter }; SHAPE (store_scatter_offset) +/* void vfoo[_t0](_t, const int, _t) + + where is tied to . + has the same width as but is of unsigned type. + + Example: vstrbq_scatter_base + void [__arm_]vstrwq_scatter_base[_s32](uint32x4_t addr, const int offset, int32x4_t value) + void [__arm_]vstrwq_scatter_base_p[_s32](uint32x4_t addr, const int offset, int32x4_t value, mve_pred16_t p) */ +struct store_scatter_base_def : public store_scatter +{ + 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, "_,vu0,ss64,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 (3, i, nargs) + || !r.require_integer_immediate (1) + || (type = r.infer_vector_type (2)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + type_suffix_index base_type + = find_type_suffix (TYPE_unsigned, type_suffixes[type].element_bits); + + /* Base (arg 0) should be a vector of unsigned with same width as value + (arg 2). */ + if (!r.require_matching_vector_type (0, base_type)) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool + check (function_checker &c) const override + { + int multiple = c.type_suffix (0).element_bits / 8; + int bound = 127 * multiple; + return c.require_immediate_range_multiple (1, -bound, bound, multiple); + } +}; +SHAPE (store_scatter_base) + /* _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 be0e09755cc..1d361addd76 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -65,6 +65,7 @@ namespace arm_mve extern const function_shape *const load_ext; extern const function_shape *const mvn; extern const function_shape *const store; + extern const function_shape *const store_scatter_base; extern const function_shape *const store_scatter_offset; extern const function_shape *const ternary; extern const function_shape *const ternary_lshift;