From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D3516383556B for ; Wed, 7 Dec 2022 21:30:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3516383556B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670448644; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=25XwxnK5zT78LanbsPi8+A6g9Bh6F5hJqMMzT8mQyBM=; b=F1YJUleVzytC+nkX9SPx0Ng2kZpk9TYWfULiFVzMcAHQtM0xQL1xUu16xICimVzmT1gdxS IkprTB7nkwAKGeRpeBGOGae3jHFIETiHEYWvvIsnxScltdB/CecjXxs0UCQRYkVfatoRDn 60m8ofldVAoDWLURX5Q4FX7KUvCVpE0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-138-ezD5ILVFNXaMtPOs-DfSow-1; Wed, 07 Dec 2022 16:30:41 -0500 X-MC-Unique: ezD5ILVFNXaMtPOs-DfSow-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1ED1F85A588; Wed, 7 Dec 2022 21:30:41 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF2741415100; Wed, 7 Dec 2022 21:30:40 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2B7LUYq1423889 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 7 Dec 2022 22:30:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2B7LUWgH423888; Wed, 7 Dec 2022 22:30:32 +0100 Date: Wed, 7 Dec 2022 22:30:32 +0100 From: Jakub Jelinek To: Raphael Moreira Zinsly Cc: gcc-patches@gcc.gnu.org, jlaw@ventanamicro.com Subject: Re: [PATCH] RISC-V: Produce better code with complex constants [PR95632] [PR106602] Message-ID: Reply-To: Jakub Jelinek References: <20221207205517.526182-1-rzinsly@ventanamicro.com> MIME-Version: 1.0 In-Reply-To: <20221207205517.526182-1-rzinsly@ventanamicro.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 Wed, Dec 07, 2022 at 05:55:17PM -0300, Raphael Moreira Zinsly wrote: > Due to RISC-V limitations on operations with big constants combine > is failing to match such operations and is not being able to > produce optimal code as it keeps splitting them. By pretending we > can do those operations we can get more opportunities for > simplification of surrounding instructions. > > 2022-12-06 Raphael Moreira Zinsly > Jeff Law Just nits, not a proper review. 2 spaces after date and 2 spaces before <, rather than just 1. > > gcc/Changelog: > PR target/95632 > PR target/106602 > * config/riscv/riscv.md: New pattern to simulate complex > const_int loads. > > gcc/testsuite/ChangeLog: > * gcc.target/riscv/pr95632.c: New test. > * gcc.target/riscv/pr106602.c: Likewise. All lines in the ChangeLog should be tab indented, rather than just some of them and others with 8 spaces. > --- a/gcc/config/riscv/riscv.md > +++ b/gcc/config/riscv/riscv.md > @@ -1667,6 +1667,22 @@ > MAX_MACHINE_MODE, &operands[3], TRUE); > }) > > +;; Pretend to have the ability to load complex const_int in order to get > +;; better code generation around them. > +(define_insn_and_split "" define_insn_and_split patterns better should have some name, even if it starts with *. It makes dumps more readable, and you can refer to it in the ChangeLog when it is added or changed etc. > + [(set (match_operand:GPR 0 "register_operand" "=r") > + (match_operand:GPR 1 "splittable_const_int_operand" "i"))] > + "cse_not_expected" > + "#" > + "&& 1" > + [(const_int 0)] > + Why the empty line? > +{ > + riscv_move_integer (operands[0], operands[0], INTVAL (operands[1]), > + mode, TRUE); You can just use if there is only one iterator in the pattern. Jakub