From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37477 invoked by alias); 15 Jun 2015 18:37:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 37468 invoked by uid 89); 15 Jun 2015 18:37:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_50,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 15 Jun 2015 18:37:52 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t5FIbn4i022503 for ; Mon, 15 Jun 2015 13:37:49 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t5FIbmCo022502 for gcc-patches@gcc.gnu.org; Mon, 15 Jun 2015 13:37:48 -0500 Date: Mon, 15 Jun 2015 18:40:00 -0000 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] rtx_costs vs. const_int Message-ID: <20150615183748.GB12101@gate.crashing.org> References: <20150615023346.GC1723@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150615023346.GC1723@bubble.grove.modra.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg01037.txt.bz2 Hi Alan, On Mon, Jun 15, 2015 at 12:03:47PM +0930, Alan Modra wrote: > This patch changes the targetm.rtx_costs interface to pass a mode > parameter, and removes a redundant parameter. The reason for the > change is that powerpc and other backends need the mode that a > const_int is used in to properly determine the cost. For instance, > (set (reg) (ior (reg) (const_int))) where const_int is 0xff..ffff0000 > can be implemented in one instruction on powerpc if the regs and > constant are SImode, but not when DImode. Nice :-) > Some backends work around this problem by calculating the cost of the > entire expression under the IOR, which allows the mode of the > const_int to be inferred. Yeah, I do this in my series to improve the PowerPC rotate-and-mask instructions. Some of the time you really have to look at a bigger part of the pattern, but your patch should help here. > sub-rtx's in rtx_cost are > summed in order rather than reverse order so that the mode from an > earlier operand can be used for a later operand lacking a mode. This > is for ZERO_EXTEND and similar codes where the sub-rtx mode is > different to the outer mode. Canonicalization puts const_int operands > after other operands. Not always; only for commutative operations, or operations that can be swapped (like comparisons). As a counterexample, see PowerPC subfic (imm - reg). > The testing showed some pre-existing bugs.. > > arc-elf dies on attempting to assemble first libgcc file, due to gas > not understanding the options being passed by gcc. Apparently no one > cared enough to push gas changes upstream. You need to configure it with --with-cpu. Not that that makes any sense :-) > ia64-linux, m68k-linux, tilegx-linux and tilepro-linux have > dependencies on include files, not solved by -Dinhibit_libc, so die > building libgcc. Can be solved by hand, but annoying. Very annoying yes. Have patches for all; will send. > s390x-linux doesn't build as a cross-compiler. undefined reference to > `s390_host_detect_local_cpu(int, char const**)' This is recent, maybe already fixed? Segher