From patchwork Thu Jul 11 21:43:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 1959551 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=IuBENRiQ; 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 4WKpFT6fQJz1xqx for ; Fri, 12 Jul 2024 07:46:05 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 27E8A387703A for ; Thu, 11 Jul 2024 21:46:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by sourceware.org (Postfix) with ESMTPS id 793CE3858D34 for ; Thu, 11 Jul 2024 21:43:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 793CE3858D34 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 793CE3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720734212; cv=none; b=l7UFlCku91E2z4lDd1AdLj0Q/p2JxvzRv1qXi6fJhxKt/fw4G0CtXuVvA00ltzOj3oXx0xlKr438wKKrKjoRnpBGChkuYQMT2LW2R/3XwERzOvLjEHgJutYYo8yeNwLQ3nfmtCVPyebBlxB94kZtSg+s/u+p+81mM7RVSzZhzNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720734212; c=relaxed/simple; bh=AYNneQG0oYoAIlTjitruZCGAejnNT/+oT7zoJn6wG60=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=D0rk1shTGB1PyUV/IG8IPHzHXtpIbB57SO0NtLmPGWS67qpo1jazEwCPNnqTJfY2mLY7ZQORsWgriPv/jK8jMum9wI94T39pGTmHnFK/WHb62b04GKMXs0GS/w8Kh+11l3E8G7WeRsYD3HAGKxiVAsITUTXl9/wklMuPqyH+ys0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-5c667b28c82so623701eaf.1 for ; Thu, 11 Jul 2024 14:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720734209; x=1721339009; 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=tXSbSUudcyP+6k1NC5aMvJhQIl/GzD0L6BksgsrmwbI=; b=IuBENRiQNRAJkPBfDCXvzthVmDd7hdMnng3+cpQxmjcpw8MH/qyVLMY19XRPyByhP3 8MIIPBFUvb5RbApmApyJBh104BNzY8A8ybTzkRIG3sDJVR3JdaCrPAcHcjk4PtO/jdau qohTTyPBI0N5rZvcUq1esq53ekvORHmKISu4T9Gj31DFy4lEuueVqK0HeHiY8AxLKBx8 cshUfwkKGnSM61PkeoDlVkP1zgXCgQ8RB97ki1UJ1BhfM+RoCqz4C4Qm74Gxh13RorD9 rCqFE2/uP5oWjMdgl52P+guZ24D0hrOwEukVUUxeDxJJ0nDftp0BMw4fTtlpYa6ZNtD1 MoGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720734209; x=1721339009; 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=tXSbSUudcyP+6k1NC5aMvJhQIl/GzD0L6BksgsrmwbI=; b=i9sW7YJcmRaC9/1gthDaBI5u0A1EgDcIHTnDh+43bGvBSzpI5vwnTiHlVS7UPXLtdU OsxXMZ1OzH7caA+pp0GMMWo4M2oCneZtZdfxiyEN/YXtwqePgYaGhJFBwBcMWFYVxTLs llJMdCyDVz6eXWlu8bJ/6csceZOxCg/GGn1Co2A9CBea1+dCfqDS2OBV4aPMaAGlUUGv XzsM1n0QJc551eNK8qcwlGZy6HMBljHyux2jxc4M4W6jcvcy5GyU07q5slpYCB7jUZKN WCaWrjKUMTMTj0Si997F4bJpqhI2A1JSZ2rKZvK5otk2C/anXyUb2ey/ZkCHA2Vexn/x PU1w== X-Gm-Message-State: AOJu0YxP3A0WwRzlEl3D7p3rHc7PSav49WmMDRxB+h5plR9YN2/BKqkI gWWRdMHlCBrS8CZxOgFBBVJvxCy4SxAomtlRuhC7q90JOQK0erPsG1HXXkokKnD9LP+9elYJSv9 83SpulQ== X-Google-Smtp-Source: AGHT+IH1rhL4VkqZk/XzLvHtZgR39f0VxhUVqSTaFcIXouRTK0PgpnNOEA3LIB3LHbM2TaYywAgdQw== X-Received: by 2002:a05:6820:c89:b0:5c6:931f:6950 with SMTP id 006d021491bc7-5cc9a4ec8b0mr422135eaf.0.1720734209391; Thu, 11 Jul 2024 14:43:29 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5c7b606db30sm540950eaf.8.2024.07.11.14.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 14:43:28 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com Cc: Christophe Lyon Subject: [PATCH 11/15] arm: [MVE intrinsics] add vcvtx shape Date: Thu, 11 Jul 2024 21:43:01 +0000 Message-Id: <20240711214305.3193022-11-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240711214305.3193022-1-christophe.lyon@linaro.org> References: <20240711214305.3193022-1-christophe.lyon@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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 c311f255e1b..7937d401696 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 i, enum predication_index pred, + enum mode_suffix_index, + type_suffix_info type_info) const override + { + return pred != PRED_m; + } + + bool + skip_overload_p (enum predication_index pred, enum mode_suffix_index mode) + 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 */