From patchwork Wed Dec 24 21:58:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 424003 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D23A6140081 for ; Thu, 25 Dec 2014 08:59:10 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=Aqp5xbaw7Ujgpw+/wQKEjKpkI6mqZZI1QE0ujjFlOge/fy GZKXdSCBdWAYl0PjaLKdTuG/FptvcI3bBW0ChxelU0cM0pQigZ409oKtbW3Rw57d HKBbeE60PtIMxByzHpU309KoAyA1Xgl4xIeyfoFh9tWboqBzln3oIFgRZ5Z9Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=HARuBe/KTnBwxTPsf8CGNEdLmO8=; b=VQ/PkM5r+6iGxVRkw7Ws PvrQCn/dlazLrajd/5HsF8GxQKu3j72zo2kXJYoiwYB3ch86LFsOd9IX0akuMIw7 D+zKARNOf//AmgUnFZ/KyNySTcMdbxJ61p6rmlYBVzA7fbVbFQlZCRhKBm+Msbib dZtqWQDtgd1Tdhxay7FKFGk= Received: (qmail 1042 invoked by alias); 24 Dec 2014 21:59:03 -0000 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 Received: (qmail 1031 invoked by uid 89); 24 Dec 2014 21:59:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mailout04.t-online.de Received: from mailout04.t-online.de (HELO mailout04.t-online.de) (194.25.134.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 24 Dec 2014 21:59:01 +0000 Received: from fwd33.aul.t-online.de (fwd33.aul.t-online.de [172.20.27.144]) by mailout04.t-online.de (Postfix) with SMTP id 450E356F57C for ; Wed, 24 Dec 2014 22:58:57 +0100 (CET) Received: from [192.168.0.104] (ESEzkgZawhAsCR4sqMYle0Rmrr3Ch7ob61zDIn0FAUMHTZVWCm9odvuMbSjKKtYZt9@[84.180.116.254]) by fwd33.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1Y3tx8-07AN280; Wed, 24 Dec 2014 22:58:46 +0100 Message-ID: <1419458324.8915.95.camel@yam-132-YW-E178-FTW> Subject: [SH][committed] Fix pr51244-12.c failures on SH2A From: Oleg Endo To: gcc-patches Date: Wed, 24 Dec 2014 22:58:44 +0100 Mime-Version: 1.0 X-IsSubscribed: yes Hi, Attached patch fixes the failures on SH2A that started to show recently in the gcc.target/sh/pr51244-12.c test case. Tested with make -k check-gcc RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" Committed as r219062. Cheers, Oleg gcc/ChangeLog: PR target/51244 * config/sh/sh.md (*mov_t_msb_neg): Convert split into insn_and_split. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 219029) +++ gcc/config/sh/sh.md (working copy) @@ -11601,8 +11601,8 @@ (set (match_dup 0) (xor:SI (match_dup 0) (const_int 1)))]) ;; Use negc to store the T bit in a MSB of a reg in the following way: -;; T = 1: 0x80000000 -> reg -;; T = 0: 0x7FFFFFFF -> reg +;; T = 0: 0x80000000 -> reg +;; T = 1: 0x7FFFFFFF -> reg ;; This works because 0 - 0x80000000 = 0x80000000. ;; ;; This insn must not match again after it has been split into the constant @@ -11635,27 +11635,27 @@ "negc %1,%0" [(set_attr "type" "arith")]) -;; These are essentially the same as above, but with the inverted T bit. -;; Combine recognizes the split patterns, but does not take them sometimes -;; if the T_REG clobber is specified. Instead it tries to split out the -;; T bit negation. Since these splits are supposed to be taken only by -;; combine, it will see the T_REG clobber of the *mov_t_msb_neg insn, so this -;; should be fine. -(define_split +(define_insn_and_split "*mov_t_msb_neg" [(set (match_operand:SI 0 "arith_reg_dest") (plus:SI (match_operand 1 "negt_reg_operand") - (const_int 2147483647)))] ;; 0x7fffffff - "TARGET_SH1 && can_create_pseudo_p ()" + (const_int 2147483647))) ;; 0x7fffffff + (clobber (reg:SI T_REG))] + "TARGET_SH1" + "#" + "&& can_create_pseudo_p ()" [(parallel [(set (match_dup 0) (minus:SI (const_int -2147483648) (reg:SI T_REG))) (clobber (reg:SI T_REG))])]) -(define_split +(define_insn_and_split "*mov_t_msb_neg" [(set (match_operand:SI 0 "arith_reg_dest") (if_then_else:SI (match_operand 1 "t_reg_operand") (const_int 2147483647) ;; 0x7fffffff - (const_int -2147483648)))] ;; 0x80000000 - "TARGET_SH1 && can_create_pseudo_p ()" + (const_int -2147483648))) ;; 0x80000000 + (clobber (reg:SI T_REG))] + "TARGET_SH1" + "#" + "&& can_create_pseudo_p ()" [(parallel [(set (match_dup 0) (minus:SI (const_int -2147483648) (reg:SI T_REG))) (clobber (reg:SI T_REG))])])