From patchwork Mon Dec 8 14:18:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 418700 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 F323E1400DD for ; Tue, 9 Dec 2014 01:19:20 +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:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=ZzFbvoSQM7ESaOYtmzl i0tj4xIzS0L7bkQdq9NrRnJ+pho/Dp1r4hM/1/nIlH9Ab37ISfaKqvqWHTUxrZsm FGApOxuPf31FCVEh3DQOAuEvoTg4R6cA/cBaRRboudO3aRcg2D7v+JyLn0vJSpD5 PE1HPVWZ582zL8+iC/Hgg2Sg= 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:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=wXysUUo3EFB2e+KB5ybf30QHg G8=; b=rLXVd397lEOsRQdccBBCMGNRsF0xN3N4LZenYZM3vaihGCuVDrpRskgj7 QII+g4HMobEbWHBUzvB3i9WrbaVDccxcREyyXHBG4ep3PoB/fJo8BLel0hqLzGFt riXp46iFgD5TJyuB/6gVkEVVOJ4UZs11av4N8zDiIxfdA51kh8= Received: (qmail 17384 invoked by alias); 8 Dec 2014 14:18:26 -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 17167 invoked by uid 89); 8 Dec 2014 14:18:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 08 Dec 2014 14:18:23 +0000 Received: from gcc1-power7.osuosl.org (localhost [127.0.0.1]) by gcc1-power7.osuosl.org (8.14.6/8.14.6) with ESMTP id sB8EIL6k032812; Mon, 8 Dec 2014 06:18:21 -0800 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id sB8EILXR032782; Mon, 8 Dec 2014 06:18:21 -0800 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH 03/10] rs6000: Do not use addic in the ctr* splitters Date: Mon, 8 Dec 2014 06:18:04 -0800 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes These splitters are only used when for some reason we generated a bdnz loop but we cannot actually use one (CTR is already used for something else, for example). This shouldn't happen often, so making the split sequence one insn longer isn't a big deal. 2014-12-08 Segher Boessenkool gcc/ PR target/64180 * config/rs6000/rs6000.md (*ctr_internal1, *ctr_internal2, *ctr_internal5, *ctr_internal6): Change "r" alternatives to "b". Increase length. (splitters for these): Split to cmp+addi instead of addic. --- gcc/config/rs6000/rs6000.md | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index abf20c3..6f4bafb 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -13496,7 +13496,7 @@ (define_expand "ctr" (define_insn "*ctr_internal1" [(set (pc) - (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r") + (if_then_else (ne (match_operand:P 1 "register_operand" "c,*b,*b,*b") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) @@ -13516,11 +13516,11 @@ (define_insn "*ctr_internal1" return \"bdz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) + (set_attr "length" "*,16,20,20")]) (define_insn "*ctr_internal2" [(set (pc) - (if_then_else (ne (match_operand:P 1 "register_operand" "c,*r,*r,*r") + (if_then_else (ne (match_operand:P 1 "register_operand" "c,*b,*b,*b") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) @@ -13540,13 +13540,13 @@ (define_insn "*ctr_internal2" return \"bdnz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) + (set_attr "length" "*,16,20,20")]) ;; Similar but use EQ (define_insn "*ctr_internal5" [(set (pc) - (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r") + (if_then_else (eq (match_operand:P 1 "register_operand" "c,*b,*b,*b") (const_int 1)) (label_ref (match_operand 0 "" "")) (pc))) @@ -13566,11 +13566,11 @@ (define_insn "*ctr_internal5" return \"bdnz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) + (set_attr "length" "*,16,20,20")]) (define_insn "*ctr_internal6" [(set (pc) - (if_then_else (eq (match_operand:P 1 "register_operand" "c,*r,*r,*r") + (if_then_else (eq (match_operand:P 1 "register_operand" "c,*b,*b,*b") (const_int 1)) (pc) (label_ref (match_operand 0 "" "")))) @@ -13590,7 +13590,7 @@ (define_insn "*ctr_internal6" return \"bdz $+8\;b %l0\"; }" [(set_attr "type" "branch") - (set_attr "length" "*,12,16,16")]) + (set_attr "length" "*,16,20,20")]) ;; Now the splitters if we could not allocate the CTR register @@ -13606,13 +13606,12 @@ (define_split (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:P 4 ""))] "reload_completed" - [(parallel [(set (match_dup 3) - (compare:CC (plus:P (match_dup 1) - (const_int -1)) - (const_int 0))) - (set (match_dup 0) - (plus:P (match_dup 1) - (const_int -1)))]) + [(set (match_dup 3) + (compare:CC (match_dup 1) + (const_int 1))) + (set (match_dup 0) + (plus:P (match_dup 1) + (const_int -1))) (set (pc) (if_then_else (match_dup 7) (match_dup 5) (match_dup 6)))] @@ -13632,13 +13631,12 @@ (define_split (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:P 4 ""))] "reload_completed && ! gpc_reg_operand (operands[0], SImode)" - [(parallel [(set (match_dup 3) - (compare:CC (plus:P (match_dup 1) - (const_int -1)) - (const_int 0))) - (set (match_dup 4) - (plus:P (match_dup 1) - (const_int -1)))]) + [(set (match_dup 3) + (compare:CC (match_dup 1) + (const_int 1))) + (set (match_dup 4) + (plus:P (match_dup 1) + (const_int -1))) (set (match_dup 0) (match_dup 4)) (set (pc) (if_then_else (match_dup 7)