From patchwork Sun May 6 19:57:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 157192 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E0D16B6FB9 for ; Mon, 7 May 2012 05:57:49 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1336939072; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=luOTlP0SIupr2HhGUrQCjFc7F34=; b=HsDW8KjdEwYPMqW UVjNuLGYS1k66Vz3O+rirpP+O8BV/cVjk4G+ylr1NKEXGtCQFXmdaWXn2GEsQkUz LtNwJhDvwpt23ca9phObnhpGH2a5MG8Fobzmg5ysTcqfgUz7NL5UHCbkaXSutXFp /8kv6H3KP9Nd8GasxEZN+f4LrmjQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=weynKCyKHpvdAX0PfmLvtME+afI5XPT9PGLQXIHRPkWyEC9Kj4o0OjebPKVXC4 ztHF+GHHHrqvpis3SY9F6B4u5RkjrSg9W8kStRau43WNODzkSwPoooNcDvoAyHlJ Zw7HG7DxiQIdtPM9BUje4E67jOSN6JAm8ZUMXNUt1u1Io=; Received: (qmail 27041 invoked by alias); 6 May 2012 19:57:41 -0000 Received: (qmail 27029 invoked by uid 22791); 6 May 2012 19:57:40 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout01.t-online.de (HELO mailout01.t-online.de) (194.25.134.80) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 May 2012 19:57:27 +0000 Received: from fwd10.aul.t-online.de (fwd10.aul.t-online.de ) by mailout01.t-online.de with smtp id 1SR7a9-0003ja-03; Sun, 06 May 2012 21:57:25 +0200 Received: from [192.168.0.101] (XKiQywZUQhFUD6yJMEcLhz8pn6uVhW-EoZmUNORxsyqw8ZXRqBHNEhnuhCV34O4g8h@[93.218.166.174]) by fwd10.t-online.de with esmtp id 1SR7a3-11zigS0; Sun, 6 May 2012 21:57:19 +0200 Subject: Re: [committed] Add SET rtx costs for MIPS / [SH] PR 53250 From: Oleg Endo To: Richard Sandiford Cc: gcc-patches@gcc.gnu.org, kkojima In-Reply-To: <87ipg9dswq.fsf@talisman.home> References: <87ipg9dswq.fsf@talisman.home> Date: Sun, 06 May 2012 21:57:16 +0200 Message-ID: <1336334236.1880.186.camel@yam-132-YW-E178-FTW> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Sun, 2012-05-06 at 20:13 +0100, Richard Sandiford wrote: > This patch adds SET rtx costs to MIPS. Since "FPR modes" and "GPR modes" > aren't tieable, the effect is to restore the original lower-subreg behaviour > of splitting all multiword modes. > > Tested by setting LOG_COSTS to 1 and checking that the costs looked sensible. > Also tested by compiling cc1 .ii files for -mabi=n32, -mabi=64, -mabi=32 > and -mabi=32 -mfp64. The output was the same as when FORCE_LOWERING was > set to 1, but different from unmodified trunk. Applied. > The attached patch does pretty much the same for the SH target. Tested also by setting LOG_COSTS to 1 and checking that multi-word modes are marked for splitting (except for DImode zero_extend lowering). Also verified that newlib compiles again. OK? Cheers, Oleg ChangLog: PR target/53250 * config/sh/sh.c (sh_rtx_costs): Handle SET case to restore original behavior of lower-subreg. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 187212) +++ gcc/config/sh/sh.c (working copy) @@ -2999,6 +2999,27 @@ { switch (code) { + /* The lower-subreg pass decides whether to split multi-word regs + into individual regs by looking at the cost for a REG of certain + modes with the following patterns: + (set (reg) (reg)) + (set (reg) (const_int 0)) + On machines that support vector move operations a multi-word move + is the same cost as individual reg move. On SH there is no + vector-move, so we have to provide the correct cost in the number + of move insns to load/store the reg of the mode in question. */ + case SET: + if (register_operand (SET_DEST (x), VOIDmode) + && (register_operand (SET_SRC (x), VOIDmode) + || satisfies_constraint_Z (SET_SRC (x)))) + { + const enum machine_mode mode = GET_MODE (SET_DEST (x)); + *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) + / mov_insn_size (mode, TARGET_SH2A)); + return true; + } + return false; + case CONST_INT: if (TARGET_SHMEDIA) {