From patchwork Wed Sep 4 13:26:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1980804 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=t5fggm5z; 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 4WzNgF0Xvrz1yg3 for ; Wed, 4 Sep 2024 23:31:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DEC993864807 for ; Wed, 4 Sep 2024 13:31:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by sourceware.org (Postfix) with ESMTPS id AA4C8386101C for ; Wed, 4 Sep 2024 13:27:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA4C8386101C 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 AA4C8386101C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456454; cv=none; b=A663kda9igcNquRxt7u9RHCgzcx5WTQIOLxdLh1ppvKrX49kI0GHqUOWuojVWdNAk2fKnYcg7RfM9EVwigF2wFrDGXhbE0zHZG9ZhHQe9ibLmZ6KrTuyM0lrkpZp/IRnQeH8+q/iCEu4UM3dgTNOGX0osb7+YmySXyJPJDMmpmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456454; c=relaxed/simple; bh=CZBbxPuC1d15Qr9AO8qMj09b0G+9n/l8+piyAYuz4Mg=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xuvgLFBtfv04hkoqqdN4dl186P47eSsYQijRzNDqNBpm2O2i97/k9K6QGUIb7sTAxhZzPQrXDINMjJOS9gEczjwv5Hs6erhbBCTa8rW/+ateb5h08ltmdfVws34TX0IZuswG5R6u/L1NZOYHb9k0tqiEqjf9rHEFNUmHymcUDFI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5de8a3f1cc6so360336eaf.1 for ; Wed, 04 Sep 2024 06:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725456450; x=1726061250; 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=c83W76PJu0tZZJu1nb8FhRUx8jMb+R5VzFiZiT7C7bU=; b=t5fggm5zxLpzmypZowrYfFwGDMqq+xY1UxdVDiDc1OcQ1euvOVutRNiGLrWzsRb/rK lesuDRuJJ1cGHHUh5hMRBGWfVnoMMeB1SzqakpDBzZTdyMMzGelOah40d3v8DIycbizl PvTg4t8g6KhUbsacV2zlYs8/MZdw2Ffv4mNMBhDH3ob59nLKsBmc7N7tV/5zMtNhLfQp qMSespGswKRJcrWUrKJ0WptS0r8HFiHcppV2SBcyZ4SDlPcs+8bQXtWlQFSrzS4KiYVj 8BaxWdGP/RDjJuq5GwlqL8GwEdev5eassMkmcfLvZh0KNeQqIRaSwg0OIyxNY5Kd573v JWOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725456450; x=1726061250; 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=c83W76PJu0tZZJu1nb8FhRUx8jMb+R5VzFiZiT7C7bU=; b=e2yFLCPV7a1/xQjXZEnHtNZbW4+nmiZehs8kiI9BMrV+M8SGu2WR2DSxRtLnYpV+/f jqVAuoKwg4uxaziZqj/ChwuzCqEYDMp8+EE0pdB3fpXJbeMYZ4xnhXyVS25u7MbR+0sk ewxKDV/5xnuARMgb+L/zV7LNPwuXr6JqOhYnmklOpN1n5oPFjcTX1NdjHY3W1vkCNrow x+uRxBqIBZN557arNazgHvsBOLwCDSQ9/7Md1GkeJGe6gOc8DXQXR3jwfkA3Cze7z6Wg eWI8DxmhzmoAaHf3gCM28AGGfUm2Ge+WTA5vidBJw4NMG1FJ5OKcbbtIxN1OEPkWmW7O lJwg== X-Gm-Message-State: AOJu0Yyi82lmTgC9b9my8n2yEiTWiEx769cF2C/QJwfcA3HhbtR/k//F mktlKmxYVvi33hm6OGRr4ZT89ZtBdYWdj2OXpuDEBlvwV/ip665+SQCwG3jMMDtf8+aI5IfQErs csABZUA== X-Google-Smtp-Source: AGHT+IEJQwDmRr4j0IeTuHLjRscPYFO2esb41oXXHcAGQflHaMSZ+yLUYMuzWQClq4XbamMAYnDQkQ== X-Received: by 2002:a05:6820:70a:b0:5d8:a13:f99d with SMTP id 006d021491bc7-5e18eb5dd09mr754474eaf.1.1725456450365; Wed, 04 Sep 2024 06:27:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 06:27:29 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com Cc: Christophe Lyon Subject: [PATCH v2 11/36] arm: [MVE intrinsics] add vcvtx shape Date: Wed, 4 Sep 2024 13:26:25 +0000 Message-Id: <20240904132650.2720446-12-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~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch adds the vcvtx shape description for vcvtaq, vcvtmq, vcvtnq, vcvtpq. 2024-07-11 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (vcvtx): New. * config/arm/arm-mve-builtins-shapes.h (vcvtx): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 59 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 60 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 5ebf666d954..6632ee49067 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -2116,6 +2116,65 @@ struct vcvt_f32_f16_def : public nonoverloaded_base }; SHAPE (vcvt_f32_f16) +/* _t foo_t0[_t1](_t) + + Example: vcvtaq. + int16x8_t [__arm_]vcvtaq_s16_f16(float16x8_t a) + int16x8_t [__arm_]vcvtaq_m[_s16_f16](int16x8_t inactive, float16x8_t a, mve_pred16_t p) + int16x8_t [__arm_]vcvtaq_x_s16_f16(float16x8_t a, mve_pred16_t p) +*/ +struct vcvtx_def : public overloaded_base<0> +{ + bool + explicit_type_suffix_p (unsigned int, enum predication_index pred, + enum mode_suffix_index, + type_suffix_info) const override + { + return pred != PRED_m; + } + + bool + skip_overload_p (enum predication_index pred, enum mode_suffix_index) + const override + { + return pred != PRED_m; + } + + 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,v1", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index from_type; + tree res; + + if (!r.check_gp_argument (1, i, nargs) + || (from_type + = r.infer_vector_type (i)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + type_suffix_index to_type; + + gcc_assert (r.pred == PRED_m); + + /* Get the return type from the 'inactive' argument. */ + to_type = r.infer_vector_type (0); + + if ((res = r.lookup_form (r.mode_suffix_id, to_type, from_type))) + return res; + + return r.report_no_such_form (from_type); + } +}; +SHAPE (vcvtx) + /* _t vfoo[_t0](_t, _t, mve_pred16_t) i.e. a version of the standard ternary shape in which diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 50157b57571..ef497b6c97a 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -80,6 +80,7 @@ namespace arm_mve extern const function_shape *const vcvt; extern const function_shape *const vcvt_f16_f32; extern const function_shape *const vcvt_f32_f16; + extern const function_shape *const vcvtx; extern const function_shape *const vpsel; } /* end namespace arm_mve::shapes */