From patchwork Thu Aug 18 22:03:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 56870 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 77860385701F for ; Thu, 18 Aug 2022 22:04:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77860385701F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1660860295; bh=5N9rB8xC6CNrDR2irZokWAZawnWHvGM2mMNYx/6qX74=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ZZdBC8dwMFho1www9J1sRkhINqfMRsqE2MYF2kMCcFBXjuil8atfwrOaub9sqQ460 B/h2zpJeBES/Ab7oTZ7bLy3tyjZuNapXMCB+X36cNdRCtjQg7Ng9r/wHq1otDO1P09 SOKO8iN4DyaJjbzJ9c+/19Rry6+UYVlGd8LeSEOo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id E29613858292 for ; Thu, 18 Aug 2022 22:04:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E29613858292 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27IHpsQC001638 for ; Thu, 18 Aug 2022 15:04:03 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3j1t6r10wm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 18 Aug 2022 15:04:02 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 18 Aug 2022 15:04:01 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 18 Aug 2022 15:04:01 -0700 Received: from linux.wrightpinski.org.com (unknown [10.69.242.198]) by maili.marvell.com (Postfix) with ESMTP id 956953F707D; Thu, 18 Aug 2022 15:04:01 -0700 (PDT) To: Subject: [PATCH 02/10] [RISCV] Move iterators from bitmanip.md to iterators.md Date: Thu, 18 Aug 2022 15:03:45 -0700 Message-ID: <1660860233-11175-3-git-send-email-apinski@marvell.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1660860233-11175-1-git-send-email-apinski@marvell.com> References: <1660860233-11175-1-git-send-email-apinski@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: k1PiwkSx-lBcsc_ZkyeIm-o18GKXs58O X-Proofpoint-GUID: k1PiwkSx-lBcsc_ZkyeIm-o18GKXs58O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-18_16,2022-08-18_01,2022-06-22_01 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, KAM_SHORT, MEDICAL_SUBJECT, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: apinski--- via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: apinski@marvell.com Cc: Andrew Pinski Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Andrew Pinski Just like the previous patch this move all of the iterators of bitmanip.md to iterators.md. All modern backends put the iterators in iterators.md for easier access. OK? Built and tested for riscv32-linux-gnu with --with-arch=rv32imafdc_zba_zbb_zbc_zbs. Thanks, Andrew Pinski gcc/ChangeLog: * config/riscv/bitmanip.md (bitmanip_bitwise, bitmanip_minmax, clz_ctz_pcna, tbitmanip_optab, bitmanip_insn, shiftm1: Move to ... * config/riscv/iterators.md: Here. --- gcc/config/riscv/bitmanip.md | 25 ------------------------- gcc/config/riscv/iterators.md | 27 ++++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index d1570ce8508..3329dd54eb6 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -17,31 +17,6 @@ ;; along with GCC; see the file COPYING3. If not see ;; . -(define_code_iterator bitmanip_bitwise [and ior]) - -(define_code_iterator bitmanip_minmax [smin umin smax umax]) - -(define_code_iterator clz_ctz_pcnt [clz ctz popcount]) - -(define_code_attr bitmanip_optab [(smin "smin") - (smax "smax") - (umin "umin") - (umax "umax") - (clz "clz") - (ctz "ctz") - (popcount "popcount")]) - - -(define_code_attr bitmanip_insn [(smin "min") - (smax "max") - (umin "minu") - (umax "maxu") - (clz "clz") - (ctz "ctz") - (popcount "cpop")]) - -(define_mode_attr shiftm1 [(SI "const31_operand") (DI "const63_operand")]) - ;; ZBA extension. (define_insn "*zero_extendsidi2_bitmanip" diff --git a/gcc/config/riscv/iterators.md b/gcc/config/riscv/iterators.md index 351aa7f3cea..54590f43193 100644 --- a/gcc/config/riscv/iterators.md +++ b/gcc/config/riscv/iterators.md @@ -113,6 +113,9 @@ (define_mode_attr UNITMODE [(HF "HF") (SF "SF") (DF "DF")]) ;; the controlling mode. (define_mode_attr HALFMODE [(DF "SI") (DI "SI") (TF "DI")]) +; bitmanip mode attribute +(define_mode_attr shiftm1 [(SI "const31_operand") (DI "const63_operand")]) + ;; ------------------------------------------------------------------- ;; Code Iterators ;; ------------------------------------------------------------------- @@ -148,11 +151,17 @@ (define_code_iterator any_ge [ge geu]) (define_code_iterator any_lt [lt ltu]) (define_code_iterator any_le [le leu]) +; bitmanip code iterators +(define_code_iterator bitmanip_bitwise [and ior]) + +(define_code_iterator bitmanip_minmax [smin umin smax umax]) + +(define_code_iterator clz_ctz_pcnt [clz ctz popcount]) + ;; ------------------------------------------------------------------- ;; Code Attributes ;; ------------------------------------------------------------------- - ;; expands to an empty string when doing a signed operation and ;; "u" when doing an unsigned operation. (define_code_attr u [(sign_extend "") (zero_extend "u") @@ -196,6 +205,22 @@ (define_code_attr insn [(ashift "sll") (plus "add") (minus "sub")]) +; bitmanip code attributes +(define_code_attr bitmanip_optab [(smin "smin") + (smax "smax") + (umin "umin") + (umax "umax") + (clz "clz") + (ctz "ctz") + (popcount "popcount")]) +(define_code_attr bitmanip_insn [(smin "min") + (smax "max") + (umin "minu") + (umax "maxu") + (clz "clz") + (ctz "ctz") + (popcount "cpop")]) + ;; ------------------------------------------------------------------- ;; Int Iterators. ;; -------------------------------------------------------------------