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: 616 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:38f:b0:2d5:3c95:9e21 with SMTP id 15csp552284pxh; Thu, 18 Aug 2022 15:05:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR47almINnoJ7/d9PcjgvaeZcXPn7lHofbUD79cY2JWNYdiS9yCIBzutOQ6KeEaMyZkhKnTY X-Received: by 2002:a17:907:6295:b0:703:92b8:e113 with SMTP id nd21-20020a170907629500b0070392b8e113mr3124972ejc.594.1660860357375; Thu, 18 Aug 2022 15:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660860357; cv=none; d=google.com; s=arc-20160816; b=d7gd3r6rQ8iBF9eG95TV2ir/mOQphZ9kDTpzeyI1MAvhVaEJ43PO9KJ1BNGbpEBVC8 3a/DFhGggJffc0bcJ94WrF0PTJa76BkJZlWNFavmrDFNohAxvt6cuE0GiPjV1zGiDaxN iRt7NHclGdjdvUgB6M1n0vPnDXHyFwuc7xJOmp5nGvzLb63/1GEwbggrEE8OL8jFsevP 1kOW/E77uXdOjLvI1/UzchRL4CYnMU/A63LgfDeNw+O3L8M2RXi4OdtwmpEX96ElGgya 1foXeA0kXms0NOi1pLVPo20vW4VXyYR+5cSc60i48LEODimVDCbaczkasbDHlc3IdPi+ yV+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:references:in-reply-to:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=5N9rB8xC6CNrDR2irZokWAZawnWHvGM2mMNYx/6qX74=; b=fxRv/46xG+CW9d3QlcDUeAlwV86Cckp/FJZR7nVME2IluCsieeYXdYa1KbsvAeW9E9 inojBI5bhvC/M9l1qY18i0Gv4MvwfcIjW9R8HbiqZE/as8XulqNCfCoKgmMXLlad6aXz a2FoaAVBy3WVG28njrCJJdsJnGwsUADTrMQirUnlootomuptm+ToGjyNkl7DBIzyxrRo HGsV2A0083ucOGUDtew5WM+iiGId5PduiQ7+Z006F1H+coP8PUze8cQKyEr2SFEHK/RP ZuA4I5l4qwphifciUduMkw2CJE1ChvGMVgEQ78BwRA+OrmP/X2U9OkTOMvnd1EgYoFkd J5lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=G4QSv14p; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id hq10-20020a1709073f0a00b007308bf614f7si2257967ejc.512.2022.08.18.15.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 15:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=G4QSv14p; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE33238582B6 for ; Thu, 18 Aug 2022 22:05:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE33238582B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1660860309; 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=G4QSv14pO36JhqPh7w1rm4Ecf5y4iXYcFmstc6SekXkJ15DN+HCJR7KqrhPHpgIEb jMnymI0rmQqLMaeEuZDfAVKZBDNhhG71KZEnQPerh3y1jfn3h4kyJq8gh4731Hbygk LbrdYSS2f+KV+0nwjyELUQV4Ops9tHHhNtHupTLM= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1741538309986058890?= X-GMAIL-MSGID: =?utf-8?q?1741538309986058890?= 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. ;; -------------------------------------------------------------------