From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 7F67E3857039 for ; Wed, 16 Sep 2020 23:30:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7F67E3857039 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 08GNSFpH001625; Wed, 16 Sep 2020 18:28:15 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 08GNSFse001624; Wed, 16 Sep 2020 18:28:15 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 16 Sep 2020 18:28:14 -0500 From: Segher Boessenkool To: Alan Modra Cc: gcc-patches@sourceware.org Subject: Re: [RS6000] rs6000_rtx_costs multi-insn constants Message-ID: <20200916232814.GH28786@gate.crashing.org> References: <20200915011946.3395-1-amodra@gmail.com> <20200915011946.3395-6-amodra@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200915011946.3395-6-amodra@gmail.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 16 Sep 2020 23:30:24 -0000 On Tue, Sep 15, 2020 at 10:49:43AM +0930, Alan Modra wrote: > This small patch to rs6000_rtx_const considerably improves code (_costs) > generated for large constants in 64-bit code, teaching gcc that it is > better to load a constant from memory than to generate a sequence of > up to five dependent instructions. Note that the rs6000 backend does > generate large constants as loads from memory at expand time but > optimisation passes replace them with SETs of the value due to not > having correct costs. > > PR 94393 > * config/rs6000/rs6000.c (rs6000_rtx_costs): Cost multi-insn > constants. Okay for trunk. Note that some p10 insns take a floating point immediate, but those need to be handled specially anyway. Thanks! Segher