From patchwork Tue May 8 07:28:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 157580 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 CB8B4B6FAB for ; Tue, 8 May 2012 17:29:47 +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=1337066988; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Subject:From:To:Content-Type:Date:Message-ID:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=+8X30xJZAbMuxCKcthzl q2vOZgA=; b=G2ROJ5LM5qKrl9PvkebXgL/SrOfo8sJwgBlERyOycAAYKmrPMcuS NXFKD2bDNKsf1AMSeyVVkPVSB8nwm7nBnr0c2z3ug530BmnDFkZq/jyi1tNWw/zN rJH5DVgqRFloW42SihP7Mc06V9FQ//pSUgqBFLsSH1cDAGPuX+gvhQw= 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: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=V92aEID4M+XiCClilCemjafNLE6iuGrnqBxqDKbOcpNvrLIQ5lxD5jDKi5BFJO Wu/Patxdc6xQf/ZNuJ4Yb2hWJPp3lp2Pk/IBnF1VEjC4ZjPWcqldCHJJL55Mr8Gb c5Y8S1gXgpkhzZ96YP1zu82qRoSdSbzmEHOvDkV5q4Ae8=; Received: (qmail 13680 invoked by alias); 8 May 2012 07:29:39 -0000 Received: (qmail 13668 invoked by uid 22791); 8 May 2012 07:29:36 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout09.t-online.de (HELO mailout09.t-online.de) (194.25.134.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 May 2012 07:29:23 +0000 Received: from fwd12.aul.t-online.de (fwd12.aul.t-online.de ) by mailout09.t-online.de with smtp id 1SRerJ-0006ZY-FU; Tue, 08 May 2012 09:29:21 +0200 Received: from [192.168.0.101] (Ek5bgEZd8hDQf-2Q0LFWcSUVHOmjAOB7eUdRtGn4m0GopzT7kfgZ+dwC64jnwssQS7@[93.218.178.191]) by fwd12.t-online.de with esmtp id 1SRer5-05U9Uu0; Tue, 8 May 2012 09:29:07 +0200 Subject: [SH] PR 51244 - Supplementary patch From: Oleg Endo To: gcc-patches Date: Tue, 08 May 2012 09:28:57 +0200 Message-ID: <1336462137.1880.192.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 Hello, The attached patch is the same as in the PR comment #37. Tested with make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m2a-single/-mb,-m4/-ml,-m4/-mb, -m4-single/-ml,-m4-single/-mb,-m4a-single/-ml,-m4a-single/-mb}" and no new failures. OK? Cheers, Oleg ChangeLog: PR target/51244 * config/sh/sh.md (*branch_true, *branch_false): New insns. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 187217) +++ gcc/config/sh/sh.md (working copy) @@ -7097,6 +7097,29 @@ } [(set_attr "type" "cbranch")]) +;; The *branch_true patterns help combine when trying to invert conditions. +(define_insn "*branch_true" + [(set (pc) (if_then_else (ne (zero_extend:SI (subreg:QI (reg:SI T_REG) 0)) + (const_int 0)) + (label_ref (match_operand 0 "" "")) + (pc)))] + "TARGET_SH1 && TARGET_LITTLE_ENDIAN" +{ + return output_branch (1, insn, operands); +} + [(set_attr "type" "cbranch")]) + +(define_insn "*branch_true" + [(set (pc) (if_then_else (ne (zero_extend:SI (subreg:QI (reg:SI T_REG) 3)) + (const_int 0)) + (label_ref (match_operand 0 "" "")) + (pc)))] + "TARGET_SH1 && ! TARGET_LITTLE_ENDIAN" +{ + return output_branch (1, insn, operands); +} + [(set_attr "type" "cbranch")]) + (define_insn "branch_false" [(set (pc) (if_then_else (eq (reg:SI T_REG) (const_int 0)) (label_ref (match_operand 0 "" "")) @@ -7107,6 +7130,29 @@ } [(set_attr "type" "cbranch")]) +;; The *branch_false patterns help combine when trying to invert conditions. +(define_insn "*branch_false" + [(set (pc) (if_then_else (eq (zero_extend:SI (subreg:QI (reg:SI T_REG) 0)) + (const_int 0)) + (label_ref (match_operand 0 "" "")) + (pc)))] + "TARGET_SH1 && TARGET_LITTLE_ENDIAN" +{ + return output_branch (0, insn, operands); +} + [(set_attr "type" "cbranch")]) + +(define_insn "*branch_false" + [(set (pc) (if_then_else (eq (zero_extend:SI (subreg:QI (reg:SI T_REG) 3)) + (const_int 0)) + (label_ref (match_operand 0 "" "")) + (pc)))] + "TARGET_SH1 && ! TARGET_LITTLE_ENDIAN" +{ + return output_branch (0, insn, operands); +} + [(set_attr "type" "cbranch")]) + ;; Patterns to prevent reorg from re-combining a condbranch with a branch ;; which destination is too far away. ;; The const_int_operand is distinct for each branch target; it avoids @@ -9721,7 +9767,7 @@ "" [(const_int 0)]) -;; The *movtt patterns improve code at -O1. +;; The *movtt patterns eliminate redundant T bit to T bit moves / tests. (define_insn_and_split "*movtt" [(set (reg:SI T_REG) (eq:SI (zero_extend:SI (subreg:QI (reg:SI T_REG) 3))