From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from arjuna.pair.com (arjuna.pair.com [209.68.5.131]) by sourceware.org (Postfix) with ESMTPS id 6E4053858C60 for ; Sat, 25 Feb 2023 23:42:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E4053858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bitrange.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bitrange.com Received: by arjuna.pair.com (Postfix, from userid 3006) id E8AAE8A658; Sat, 25 Feb 2023 18:42:25 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id E546B8A56E; Sat, 25 Feb 2023 18:42:25 -0500 (EST) Date: Sat, 25 Feb 2023 18:42:25 -0500 (EST) From: Hans-Peter Nilsson X-X-Sender: hp@arjuna.pair.com To: Christoph Muellner cc: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Cooper Qu , Lifang Xia , Yunhai Shang , Zhiwei Liu Subject: Re: [PATCH v3 04/11] riscv: thead: Add support for the XTheadBs ISA extension In-Reply-To: <20230224055127.2500953-5-christoph.muellner@vrull.eu> Message-ID: References: <20230224055127.2500953-1-christoph.muellner@vrull.eu> <20230224055127.2500953-5-christoph.muellner@vrull.eu> User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: mailmunge 3.10 on 209.68.5.131 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,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 List-Id: On Fri, 24 Feb 2023, Christoph Muellner wrote: > diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md > index 158e9124c3a..2c684885850 100644 > --- a/gcc/config/riscv/thead.md > +++ b/gcc/config/riscv/thead.md > @@ -29,3 +29,14 @@ (define_insn "*th_addsl" > "th.addsl\t%0,%3,%1,%2" > [(set_attr "type" "bitmanip") > (set_attr "mode" "")]) > + > +;; XTheadBs > + > +(define_insn "*th_tst" > + [(set (match_operand:X 0 "register_operand" "=r") > + (zero_extract:X (match_operand:X 1 "register_operand" "r") > + (const_int 1) > + (match_operand 2 "immediate_operand" "i")))] (Here and same elsewhere.) You're unlikely to get other constant operands in that pattern, but FWIW, the actual matching pair for just CONST_INT is "const_int_operand" for the predicate and "n" for the constraint. Using the right predicate and constraint will also help the generated part of recog be a few nanoseconds faster. ;) brgds, H-P