From patchwork Sun Aug 26 19:19:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 180080 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 156FB2C00E7 for ; Mon, 27 Aug 2012 05:19:54 +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=1346613595; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Mail-Followup-To:Subject:Date:Message-ID: User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=9sLnnf2KPb2dmExFVUi1FuxEn9Q=; b=xFqcsaywERgjnkI erZtf5jte1tXgRa9zFH6xs2j8AOj2aQBgQNGYb7rNUWTZWP8QyVqZSWhUfzt/2xy 6FQ31bnR1ZU6j7hsnHHrKB5IjvAFmB8J6IWRABG+KPb238vno8vvtvMKuLi6aVOP 7OtlAyE1RstlFt5V5iZ9UbGL0HiU= 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:Received:From:To:Mail-Followup-To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=RPHrgHkcF4Aa9/qDPCZBWhpy9twVHay0qJl+1Wsmo4a5XvNnw9949lZx3I+o0s h2zKQWmpgc9vosnrM7tXsRwthJgIllMk4WwwgGOMwZAmOVD4V9OblID3PSNgEiFY SaZVSQQrE4YT2U6RNXjMtE2MlbrgVbEWxzKoWZTJrRQGo=; Received: (qmail 24106 invoked by alias); 26 Aug 2012 19:19:51 -0000 Received: (qmail 24096 invoked by uid 22791); 26 Aug 2012 19:19:50 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f47.google.com (HELO mail-wg0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 26 Aug 2012 19:19:38 +0000 Received: by wgbfa7 with SMTP id fa7so2147606wgb.16 for ; Sun, 26 Aug 2012 12:19:37 -0700 (PDT) Received: by 10.180.86.3 with SMTP id l3mr19930899wiz.16.1346008777249; Sun, 26 Aug 2012 12:19:37 -0700 (PDT) Received: from localhost ([2.26.188.227]) by mx.google.com with ESMTPS id ef5sm16335472wib.3.2012.08.26.12.19.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 26 Aug 2012 12:19:36 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [MIPS, committed] Fix cost of CINS Date: Sun, 26 Aug 2012 20:19:37 +0100 Message-ID: <87ipc531h2.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 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 CINS wasn't being used in -Os code because the combination didn't seem profitable enough. Tested on mipsisa64-elf, mips64-elf and mips64-linux-gnu. Applied. Will be tested once gcc.target/mips uses gcc-dg. Richard gcc/ * config/mips/mips.c (mips_rtx_costs): Add costs for CINS. Index: gcc/config/mips/mips.c =================================================================== --- gcc/config/mips/mips.c 2012-08-26 11:32:09.000000000 +0100 +++ gcc/config/mips/mips.c 2012-08-26 11:34:07.346812457 +0100 @@ -3681,6 +3681,18 @@ mips_rtx_costs (rtx x, int code, int out + set_src_cost (XEXP (x, 0), speed)); return true; } + if (ISA_HAS_CINS && CONST_INT_P (XEXP (x, 1))) + { + rtx op = XEXP (x, 0); + if (GET_CODE (op) == ASHIFT + && CONST_INT_P (XEXP (op, 1)) + && mask_low_and_shift_p (mode, XEXP (x, 1), XEXP (op, 1), 32)) + { + *total = COSTS_N_INSNS (1) + set_src_cost (XEXP (op, 0), speed); + return true; + } + } + /* Fall through. */ case IOR: