From patchwork Thu Nov 7 09:18:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 2007912 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=hJ79Zk2F; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4Xkc8D6FFkz1xxq for ; Thu, 7 Nov 2024 20:23:56 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 128593858417 for ; Thu, 7 Nov 2024 09:23:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 876013858D39 for ; Thu, 7 Nov 2024 09:19:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 876013858D39 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 876013858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730971172; cv=none; b=pkGVPoOFWhcE+odeTS7wfywKa7oQbRhuyHq2mJXst80MQcqMcxz89+d4xDXX28hvAix2fmmLbxuLit5ibwm46PGPxflqqCbob4wBw3x5WQV7ydJtrFl4CJrnUhYX12HWSSIrfTFP8Gf7VeckSu5E9m2cgxYsBNHbeUnyuVISpOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730971172; c=relaxed/simple; bh=62RVZUcHi1yFKvbFrbH2W5fPypsFqRXk6b8G3r92nzk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=DVvF8br+9VsLMflCB8vk+80GPs5CFUdjiYza5sQvLsQH4leiRpNnNtq3TZDeAcGlvqQJTcol5tCKNEyMXEQdakv88QhQQbwVGkr8ZUERXTR2fToj7Zd8yleKu7x86eIV1E5kczVTyiFZyLyBeUtcMue76C3k0W8BrXKN8285Vh0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-718078c7f53so364954a34.1 for ; Thu, 07 Nov 2024 01:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730971154; x=1731575954; 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=qJ1bCm1RskVp6cqmXs2ACc3TY+jvdoorceFYnrFK+YI=; b=hJ79Zk2FGGDgdqRthow+5S3LLvguKKvfGuur1GbnthhTjRZ54p5A0mE5aF97uua6Ii MPxWtU4HN+HCbH+XY4Ml9VBt3p9d+j3xUGMlxIl2JeXCgmJvXkIC0RkcBcoMUDybdIPs Y3S43ueJPc4/V+TcQ2S5p1uysqcDoz2R/xbR/iHtTCS6mhdwoWnwbG4ES57YDCCRT6Hu lEB5ocEH/KtgX4QWbL5hnSBkXKTQ1SRteKiM8KBBbAqAOlR6uclhO8M6cR5XAGOlQIuO ZrXWPGFw+RpF9x/7LEr9YzdXkdksJopGirZqtseOoeBfF7zx8ahVRs9L5amJJE6S6qW/ KQqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730971154; x=1731575954; 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=qJ1bCm1RskVp6cqmXs2ACc3TY+jvdoorceFYnrFK+YI=; b=rCjDGkjYAKkl+gk7BRokveNZVddSSVTX/aATKwAG7e5YRaY/n2gueyZD/UEI+QBWAY 8t0FMgJ3celdAIeG/p8GNcMKvB7wt2Tybm86B3Q+r6zJ7oNtVQFOs5QkyAgN8LYYuZ8f iEd3HBZtUSYc3MHMrnrXjptxlBhCRzRlbTcLf0jAxQHe/ioiDbLjG6LsYC1zMPaaxW9H rOyqa9wJwaCOZcedkdhfrjh4JEV7S9YF67SEOwX7jQ9+V0pH5XTz1h5e9FMTCBLqdxwZ TSsa7+IQ2T4h9v1c9mef9AFwgnE6APpZFvxX+zJm0oPtF6PJ1I/WaSOcJrXo6JL2hpcl Rw/Q== X-Gm-Message-State: AOJu0YwlmC11N0CnUDq/3NlpflEnvKH0eUinG7QIgGQ/dfHuqFfI0VWh GDTprir5XVYNVJ4HWyP68y9PJ6fi37Mo5HExCX0T0Itm1fFpKEB5TEZugQUYL4zeznQx/u6zP6g Iw1a+qA== X-Google-Smtp-Source: AGHT+IHKEFc5WWYXLt47VOpDXdsgM1F49doFhWu0oeo5P6Y8cn5ihuqDFdE9UXQ3JHhm77T2ewYzHg== X-Received: by 2002:a05:6830:6482:b0:718:823:cca8 with SMTP id 46e09a7af769-71a0ee6fc9amr1619129a34.2.1730971154593; Thu, 07 Nov 2024 01:19:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2024 01:19:13 -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 09/15] arm: [MVE intrinsics] add load_ext_gather_offset shape Date: Thu, 7 Nov 2024 09:18:14 +0000 Message-Id: <20241107091820.2010568-10-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 load_ext_gather_offset shape description. gcc/ChangeLog: * config/arm/arm-mve-builtins-shapes.cc (struct load_ext_gather): New. (struct load_ext_gather_offset_def): New. * config/arm/arm-mve-builtins-shapes.h (load_ext_gather_offset): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 58 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 59 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 03714ffb435..28b90454417 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1535,6 +1535,64 @@ struct load_ext_def : public nonoverloaded_base }; SHAPE (load_ext) +/* Base class for load_ext_gather_offset and load_ext_gather_shifted_offset, + which differ only in the units of the displacement. */ +struct load_ext_gather : public overloaded_base<0> +{ + bool + explicit_mode_suffix_p (enum predication_index, enum mode_suffix_index) const override + { + return true; + } + + bool + mode_after_pred () const override + { + return false; + } +}; + +/* _t vfoo[_t0](_t const *, _t) + + where might be tied to (for non-extending loads) or might + depend on the function base name (for extending loads), + has the same width as but is of unsigned type. + + Example: vldrhq_gather_offset + int16x8_t [__arm_]vldrhq_gather_offset[_s16](int16_t const *base, uint16x8_t offset) + int32x4_t [__arm_]vldrhq_gather_offset_z[_s32](int16_t const *base, uint32x4_t offset, mve_pred16_t p) */ +struct load_ext_gather_offset_def : public load_ext_gather +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_offset, preserve_user_namespace); + build_all (b, "v0,al,vu0", group, MODE_offset, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + mode_suffix_index mode = MODE_offset; + type_suffix_index ptr_type; + type_suffix_index offset_type; + if (!r.check_gp_argument (2, i, nargs) + || (ptr_type = r.infer_pointer_type (0)) == NUM_TYPE_SUFFIXES + || (offset_type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* tclass comes from base argument, element bits come from the offset + argument. */ + type_suffix_index type = find_type_suffix (type_suffixes[ptr_type].tclass, + type_suffixes[offset_type].element_bits); + + return r.resolve_to (mode, type); + } +}; +SHAPE (load_ext_gather_offset) + /* _t vfoo[_t0](_t) _t vfoo_n_t0(_t) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 1d361addd76..9113d55dab4 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -63,6 +63,7 @@ namespace arm_mve extern const function_shape *const inherent; extern const function_shape *const load; extern const function_shape *const load_ext; + extern const function_shape *const load_ext_gather_offset; extern const function_shape *const mvn; extern const function_shape *const store; extern const function_shape *const store_scatter_base;