From patchwork Wed Sep 4 13:26:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 97049 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47730385DDD4 for ; Wed, 4 Sep 2024 13:28:57 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oo1-xc35.google.com (mail-oo1-xc35.google.com [IPv6:2607:f8b0:4864:20::c35]) by sourceware.org (Postfix) with ESMTPS id ED1BD385B508 for ; Wed, 4 Sep 2024 13:27:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED1BD385B508 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 ED1BD385B508 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456452; cv=none; b=rrDM8ztM7Q7tsvfTgiWv3/UJkFtvnaVkKldfJRz1+JctEp2PQvdk09Sah7eLPl8urhHQvfq9r5PfeFZnwF7aFYQE3ZNWIXWmh/URVJ9LRNLz3k421varvK+y+ScPFAUTIpluZ8fD2F4h2vAjEUyOSZkOa1RVdcmHG28ILgLYeZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725456452; c=relaxed/simple; bh=0yJIxR0gHgOLt3ensXeXVIiT8FQst1yCf+KfEf/mZho=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=cM4nQ5+iD9WlS1dTuyC3TZXsUyGwhv2wB6BqMjonIayGVKXNtKZ/qfQgrTJYiYeKNAwQzU/7CZNFQ/SVJNhyBrIyzVsivLkWFnShK+PdIjsbPJUkGTLyjUhYsOFxhvOzBo/JibYA0nuhJfZH4KY9Gn+5Q4JT5El+fylRL470bks= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-5d5eec95a74so3789456eaf.1 for ; Wed, 04 Sep 2024 06:27:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725456447; x=1726061247; 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=FV0SAHIQHKh35oUaJrcRLLTJOo00vvijmVRuFov1eBs=; b=mLvDSRjio6tGuGb5dJgpbV+FiMRtBLMzU9IdGpP2ibfLDnK/Mjj+wh9ovQGAOUZs4a Lj5vaz9dsn6UzMtJ/Wo3GoqaZpRS1TWT04uN3AZ0ZEp6lI7eBSWO1g9AF9tvaJGaL0Rh oxUj4ZGB+NHP5j8FX2v3hDBHaNdg2uvzkhBZ5zJ5LBqW92L6T4QvoFddRAu4DeSsJ+or 9fPqLK/Kpp5CqDOYF1bRjpQgsn+29omxa9RiBZoH3hd7hXI0kwU3KDj8x+/6DZiXRj18 h+5bcyKUiW9Q4KZFGhnIvz51IEf6tpVhO406buB84SarZpCOq5UZ4Gnrn6f7kReXH9SH 0zpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725456447; x=1726061247; 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=FV0SAHIQHKh35oUaJrcRLLTJOo00vvijmVRuFov1eBs=; b=mjhFdNThMzLZq6C4Pyzq1H2LFswrmOzHowqL+/2u7YXOop6WbToKddF+M6KpXtvRYZ YWTF2+QzsYDCLQDwg4qb8eZUYhrXO3zSDOqLL+4vhsshQ6Ot7uPaKSDIb6Gu5XOCm2PC xa+rC57EbSs1RKpgBye/mlMiLrR/LUMvyfbSSzrio2rVnNhOR+q/BLX9t36O9MhoOl4B MDIKfXwb4C3lgGqjJ1C7YHQcawew0bwn+pvoJJi0tXqqGzz6OimBCo9HU9oAYhpSYPYh 74TF+EfhrkHUXNSHmhOlHdD/8mWygbe9QUKkkTmthqeXiWIT1JWvPWmf0m8AyYaRmGA2 el1w== X-Gm-Message-State: AOJu0Yw6MsRjaGJfDAHvjLTIGPhayfmqbOMtI0hUK/3aXBKTHBnsvKXb IkagPU4nwuyBiMzTM5w6J2KSPBGLCQqEdaIgnOOSm2xTVo7L2RG0eEXlM4n5HW8UX0uoyWR48Ab aFwtv6w== X-Google-Smtp-Source: AGHT+IHG+cG8BmCuvzXywyxyZDMk2slqVN7ljKHoSwDcNB0Zf/y9tYW/OvSvFk6NrMYg6IQybfAs8w== X-Received: by 2002:a05:6820:2297:b0:5df:8577:e7b with SMTP id 006d021491bc7-5dfacc20388mr19431026eaf.0.1725456446711; Wed, 04 Sep 2024 06:27:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 06:27:26 -0700 (PDT) From: Christophe Lyon To: gcc-patches@gcc.gnu.org, richard.earnshaw@arm.com, ramanara@nvidia.com Cc: Christophe Lyon Subject: [PATCH v2 07/36] arm: [MVE intrinsics] factorize vcvtbq vcvttq Date: Wed, 4 Sep 2024 13:26:21 +0000 Message-Id: <20240904132650.2720446-8-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.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, 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~patchwork=sourceware.org@gcc.gnu.org Factorize vcvtbq, vcvttq so that they use the same parameterized names. 2024-07-11 Christophe Lyon gcc/ * config/arm/iterators.md (mve_insn): Add VCVTBQ_F16_F32, VCVTTQ_F16_F32, VCVTBQ_F32_F16, VCVTTQ_F32_F16, VCVTBQ_M_F16_F32, VCVTTQ_M_F16_F32, VCVTBQ_M_F32_F16, VCVTTQ_M_F32_F16. (VCVTxQ_F16_F32): New iterator. (VCVTxQ_F32_F16): Likewise. (VCVTxQ_M_F16_F32): Likewise. (VCVTxQ_M_F32_F16): Likewise. * config/arm/mve.md (mve_vcvttq_f32_f16v4sf) (mve_vcvtbq_f32_f16v4sf): Merge into ... (@mve_q_f32_f16v4sf): ... this. (mve_vcvtbq_f16_f32v8hf, mve_vcvttq_f16_f32v8hf): Merge into ... (@mve_q_f16_f32v8hf): ... this. (mve_vcvtbq_m_f16_f32v8hf, mve_vcvttq_m_f16_f32v8hf): Merge into ... (@mve_q_m_f16_f32v8hf): ... this. (mve_vcvtbq_m_f32_f16v4sf, mve_vcvttq_m_f32_f16v4sf): Merge into ... (@mve_q_m_f32_f16v4sf): ... this. --- gcc/config/arm/iterators.md | 8 +++ gcc/config/arm/mve.md | 112 +++++++++--------------------------- 2 files changed, 34 insertions(+), 86 deletions(-) diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index bf800625fac..b9c39a98ca2 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -964,6 +964,10 @@ (define_int_attr mve_insn [ (VCMLAQ_M_F "vcmla") (VCMLAQ_ROT90_M_F "vcmla") (VCMLAQ_ROT180_M_F "vcmla") (VCMLAQ_ROT270_M_F "vcmla") (VCMULQ_M_F "vcmul") (VCMULQ_ROT90_M_F "vcmul") (VCMULQ_ROT180_M_F "vcmul") (VCMULQ_ROT270_M_F "vcmul") (VCREATEQ_S "vcreate") (VCREATEQ_U "vcreate") (VCREATEQ_F "vcreate") + (VCVTBQ_F16_F32 "vcvtb") (VCVTTQ_F16_F32 "vcvtt") + (VCVTBQ_F32_F16 "vcvtb") (VCVTTQ_F32_F16 "vcvtt") + (VCVTBQ_M_F16_F32 "vcvtb") (VCVTTQ_M_F16_F32 "vcvtt") + (VCVTBQ_M_F32_F16 "vcvtb") (VCVTTQ_M_F32_F16 "vcvtt") (VCVTQ_FROM_F_S "vcvt") (VCVTQ_FROM_F_U "vcvt") (VCVTQ_M_FROM_F_S "vcvt") (VCVTQ_M_FROM_F_U "vcvt") (VCVTQ_M_N_FROM_F_S "vcvt") (VCVTQ_M_N_FROM_F_U "vcvt") @@ -2948,6 +2952,10 @@ (define_int_iterator SQRSHRLQ [SQRSHRL_64 SQRSHRL_48]) (define_int_iterator VSHLCQ_M [VSHLCQ_M_S VSHLCQ_M_U]) (define_int_iterator VQSHLUQ_M_N [VQSHLUQ_M_N_S]) (define_int_iterator VQSHLUQ_N [VQSHLUQ_N_S]) +(define_int_iterator VCVTxQ_F16_F32 [VCVTBQ_F16_F32 VCVTTQ_F16_F32]) +(define_int_iterator VCVTxQ_F32_F16 [VCVTBQ_F32_F16 VCVTTQ_F32_F16]) +(define_int_iterator VCVTxQ_M_F16_F32 [VCVTBQ_M_F16_F32 VCVTTQ_M_F16_F32]) +(define_int_iterator VCVTxQ_M_F32_F16 [VCVTBQ_M_F32_F16 VCVTTQ_M_F32_F16]) (define_int_iterator DLSTP [DLSTP8 DLSTP16 DLSTP32 DLSTP64]) (define_int_iterator LETP [LETP8 LETP16 LETP32 diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index 95c615c1534..6e2f542cdae 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -217,33 +217,20 @@ (define_insn "@mve_q_f" [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_f")) (set_attr "type" "mve_move") ]) -;; -;; [vcvttq_f32_f16]) -;; -(define_insn "mve_vcvttq_f32_f16v4sf" - [ - (set (match_operand:V4SF 0 "s_register_operand" "=w") - (unspec:V4SF [(match_operand:V8HF 1 "s_register_operand" "w")] - VCVTTQ_F32_F16)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vcvtt.f32.f16\t%q0, %q1" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvttq_f32_f16v4sf")) - (set_attr "type" "mve_move") -]) ;; -;; [vcvtbq_f32_f16]) +;; [vcvtbq_f32_f16] +;; [vcvttq_f32_f16] ;; -(define_insn "mve_vcvtbq_f32_f16v4sf" +(define_insn "@mve_q_f32_f16v4sf" [ (set (match_operand:V4SF 0 "s_register_operand" "=w") (unspec:V4SF [(match_operand:V8HF 1 "s_register_operand" "w")] - VCVTBQ_F32_F16)) + VCVTxQ_F32_F16)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vcvtb.f32.f16\t%q0, %q1" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvtbq_f32_f16v4sf")) + ".f32.f16\t%q0, %q1" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_f32_f16v4sf")) (set_attr "type" "mve_move") ]) @@ -1342,34 +1329,19 @@ (define_insn "mve_vctpq_m" ]) ;; -;; [vcvtbq_f16_f32]) -;; -(define_insn "mve_vcvtbq_f16_f32v8hf" - [ - (set (match_operand:V8HF 0 "s_register_operand" "=w") - (unspec:V8HF [(match_operand:V8HF 1 "s_register_operand" "0") - (match_operand:V4SF 2 "s_register_operand" "w")] - VCVTBQ_F16_F32)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vcvtb.f16.f32\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvtbq_f16_f32v8hf")) - (set_attr "type" "mve_move") -]) - -;; -;; [vcvttq_f16_f32]) +;; [vcvtbq_f16_f32] +;; [vcvttq_f16_f32] ;; -(define_insn "mve_vcvttq_f16_f32v8hf" +(define_insn "@mve_q_f16_f32v8hf" [ (set (match_operand:V8HF 0 "s_register_operand" "=w") (unspec:V8HF [(match_operand:V8HF 1 "s_register_operand" "0") (match_operand:V4SF 2 "s_register_operand" "w")] - VCVTTQ_F16_F32)) + VCVTxQ_F16_F32)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vcvtt.f16.f32\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvttq_f16_f32v8hf")) + ".f16.f32\t%q0, %q2" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_f16_f32v8hf")) (set_attr "type" "mve_move") ]) @@ -2237,73 +2209,41 @@ (define_insn "@mve_vcmpq_m_n_f" (set_attr "length""8")]) ;; -;; [vcvtbq_m_f16_f32]) +;; [vcvtbq_m_f16_f32] +;; [vcvttq_m_f16_f32] ;; -(define_insn "mve_vcvtbq_m_f16_f32v8hf" +(define_insn "@mve_q_m_f16_f32v8hf" [ (set (match_operand:V8HF 0 "s_register_operand" "=w") (unspec:V8HF [(match_operand:V8HF 1 "s_register_operand" "0") (match_operand:V4SF 2 "s_register_operand" "w") - (match_operand: 3 "vpr_register_operand" "Up")] - VCVTBQ_M_F16_F32)) + (match_operand:V4BI 3 "vpr_register_operand" "Up")] + VCVTxQ_M_F16_F32)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vcvtbt.f16.f32\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvtbq_f16_f32v8hf")) + "vpst\;t.f16.f32\t%q0, %q2" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_f16_f32v8hf")) (set_attr "type" "mve_move") (set_attr "length""8")]) ;; -;; [vcvtbq_m_f32_f16]) +;; [vcvtbq_m_f32_f16] +;; [vcvttq_m_f32_f16] ;; -(define_insn "mve_vcvtbq_m_f32_f16v4sf" +(define_insn "@mve_q_m_f32_f16v4sf" [ (set (match_operand:V4SF 0 "s_register_operand" "=w") (unspec:V4SF [(match_operand:V4SF 1 "s_register_operand" "0") (match_operand:V8HF 2 "s_register_operand" "w") - (match_operand: 3 "vpr_register_operand" "Up")] - VCVTBQ_M_F32_F16)) + (match_operand:V8BI 3 "vpr_register_operand" "Up")] + VCVTxQ_M_F32_F16)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vcvtbt.f32.f16\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvtbq_f32_f16v4sf")) + "vpst\;t.f32.f16\t%q0, %q2" + [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_q_f32_f16v4sf")) (set_attr "type" "mve_move") (set_attr "length""8")]) -;; -;; [vcvttq_m_f16_f32]) -;; -(define_insn "mve_vcvttq_m_f16_f32v8hf" - [ - (set (match_operand:V8HF 0 "s_register_operand" "=w") - (unspec:V8HF [(match_operand:V8HF 1 "s_register_operand" "0") - (match_operand:V4SF 2 "s_register_operand" "w") - (match_operand: 3 "vpr_register_operand" "Up")] - VCVTTQ_M_F16_F32)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vcvttt.f16.f32\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvttq_f16_f32v8hf")) - (set_attr "type" "mve_move") - (set_attr "length""8")]) - -;; -;; [vcvttq_m_f32_f16]) -;; -(define_insn "mve_vcvttq_m_f32_f16v4sf" - [ - (set (match_operand:V4SF 0 "s_register_operand" "=w") - (unspec:V4SF [(match_operand:V4SF 1 "s_register_operand" "0") - (match_operand:V8HF 2 "s_register_operand" "w") - (match_operand: 3 "vpr_register_operand" "Up")] - VCVTTQ_M_F32_F16)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vcvttt.f32.f16\t%q0, %q2" - [(set (attr "mve_unpredicated_insn") (symbol_ref "CODE_FOR_mve_vcvttq_f32_f16v4sf")) - (set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vdupq_m_n_f]) ;;