From patchwork Sat Sep 20 18:23:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 391543 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 3153B14011E for ; Sun, 21 Sep 2014 04:47:28 +1000 (EST) 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=hgYiV42tUSYs6A2TDqr 9k8jTY7GvPb7RVIL46IqCkppp8JDcTJmfl3VO1D3Pvyp5LbA+pEDimhT0h/v+El1 AuLpVwN5+VukgRbhF88vR8QbGEzq4pZZTVQDgkOTJUR5YnR/wwdeu2JqYY2y3W6K hdLR+QC6P/JgVkTXl1HZlFZM= 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=WdgHzsKAXltB6VzTgfPZTKjy3 D0=; b=oFzMLX2cGZzFs6pYRBW7NSpChG/Rywmtp6hKDpsiKi0L4BQpwz0jXviff RhI5///bcpZXI9XojxRXSpYgtCQAzx5xuohgnFlJf8m2yUGX7bx09jlEJ2wQJWoJ LNfD4cMBonamPkbtZzZ5ulmGlOn4oQmFUybqKu/Q8cHEzinaZQ= Received: (qmail 22825 invoked by alias); 20 Sep 2014 18:47:12 -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 22409 invoked by uid 89); 20 Sep 2014 18:47:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, 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; Sat, 20 Sep 2014 18:47:07 +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 s8KIOAmB015041; Sat, 20 Sep 2014 11:24:10 -0700 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id s8KIOAJ7015024; Sat, 20 Sep 2014 11:24:10 -0700 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH 8/9] rs6000: Clean up sra[wd] Date: Sat, 20 Sep 2014 11:23:47 -0700 Message-Id: <75b510a74c5510f6e13fc0dbbc9168658ed58b8b.1411216924.git.segher@kernel.crashing.org> In-Reply-To: <8ab893d5c8a1ae9a4558be48e14b0e605ee90d67.1411216924.git.segher@kernel.crashing.org> References: <8ab893d5c8a1ae9a4558be48e14b0e605ee90d67.1411216924.git.segher@kernel.crashing.org> In-Reply-To: <8ab893d5c8a1ae9a4558be48e14b0e605ee90d67.1411216924.git.segher@kernel.crashing.org> References: <8ab893d5c8a1ae9a4558be48e14b0e605ee90d67.1411216924.git.segher@kernel.crashing.org> X-IsSubscribed: yes 2014-09-20 Segher Boessenkool * config/rs6000/rs6000.md (ashr3, *ashr3, *ashrsi3_64, *ashr3_dot, *ashr3_dot2): Clobber CA_REGNO. (floatdisf2_internal2): Ditto. (ashrdi3_no_power): Ditto. Fix formatting. --- gcc/config/rs6000/rs6000.md | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index b03c6c1..13fbb7eb 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -4633,9 +4633,10 @@ (define_split (define_expand "ashr3" - [(set (match_operand:GPR 0 "gpc_reg_operand" "") - (ashiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_cint_operand" "")))] + [(parallel [(set (match_operand:GPR 0 "gpc_reg_operand" "") + (ashiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:SI 2 "reg_or_cint_operand" ""))) + (clobber (reg:GPR CA_REGNO))])] "" { /* The generic code does not generate optimal code for the low word @@ -4657,7 +4658,8 @@ (define_expand "ashr3" (define_insn "*ashr3" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (ashiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_cint_operand" "rn")))] + (match_operand:SI 2 "reg_or_cint_operand" "rn"))) + (clobber (reg:GPR CA_REGNO))] "" "sra%I2 %0,%1,%2" [(set_attr "type" "shift") @@ -4667,7 +4669,8 @@ (define_insn "*ashrsi3_64" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (sign_extend:DI (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r") - (match_operand:SI 2 "reg_or_cint_operand" "rn"))))] + (match_operand:SI 2 "reg_or_cint_operand" "rn")))) + (clobber (reg:SI CA_REGNO))] "TARGET_POWERPC64" "sraw%I2 %0,%1,%h2" [(set_attr "type" "shift") @@ -4678,15 +4681,17 @@ (define_insn_and_split "*ashr3_dot" (compare:CC (ashiftrt:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r") (match_operand:SI 2 "reg_or_cint_operand" "rn,rn")) (const_int 0))) - (clobber (match_scratch:GPR 0 "=r,r"))] + (clobber (match_scratch:GPR 0 "=r,r")) + (clobber (reg:GPR CA_REGNO))] "mode == Pmode && rs6000_gen_cell_microcode" "@ sra%I2. %0,%1,%2 #" "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)" - [(set (match_dup 0) - (ashiftrt:GPR (match_dup 1) - (match_dup 2))) + [(parallel [(set (match_dup 0) + (ashiftrt:GPR (match_dup 1) + (match_dup 2))) + (clobber (reg:GPR CA_REGNO))]) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] @@ -4703,15 +4708,17 @@ (define_insn_and_split "*ashr3_dot2" (const_int 0))) (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") (ashiftrt:GPR (match_dup 1) - (match_dup 2)))] + (match_dup 2))) + (clobber (reg:GPR CA_REGNO))] "mode == Pmode && rs6000_gen_cell_microcode" "@ sra%I2. %0,%1,%2 #" "&& reload_completed && cc_reg_not_cr0_operand (operands[3], CCmode)" - [(set (match_dup 0) - (ashiftrt:GPR (match_dup 1) - (match_dup 2))) + [(parallel [(set (match_dup 0) + (ashiftrt:GPR (match_dup 1) + (match_dup 2))) + (clobber (reg:GPR CA_REGNO))]) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] @@ -6152,8 +6159,9 @@ (define_insn_and_split "floatdisf2_internal1" ;; by a bit that won't be lost at that stage, but is below the SFmode ;; rounding position. (define_expand "floatdisf2_internal2" - [(set (match_dup 3) (ashiftrt:DI (match_operand:DI 1 "" "") - (const_int 53))) + [(parallel [(set (match_dup 3) (ashiftrt:DI (match_operand:DI 1 "" "") + (const_int 53))) + (clobber (reg:DI CA_REGNO))]) (set (match_operand:DI 0 "" "") (and:DI (match_dup 1) (const_int 2047))) (set (match_dup 3) (plus:DI (match_dup 3) @@ -6316,9 +6324,9 @@ (define_insn "*negdi2_noppc64" (define_insn "ashrdi3_no_power" [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r") (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "const_int_operand" "M,i")))] + (match_operand:SI 2 "const_int_operand" "M,i"))) + (clobber (reg:SI CA_REGNO))] "!TARGET_POWERPC64" - "* { switch (which_alternative) { @@ -6335,7 +6343,7 @@ (define_insn "ashrdi3_no_power" else return \"srwi %0,%1,%h2\;insrwi %0,%L1,%h2,0\;srawi %L0,%L1,%h2\"; } -}" +} [(set_attr "type" "two,three") (set_attr "length" "8,12")])