From patchwork Sat Sep 20 18:23:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 391540 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 B545314012C for ; Sun, 21 Sep 2014 04:24:46 +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=TmfL7Xj8hCKwqUtXlcm ym83TpmUcriEZaT75KdHeyHVaiS2GJzgiUSaPNt7WNNsQy5rLnnqZQYD0Oej5q2v lQBX3EB+c/WFO6Eq4JHp8PVpvVS22JO9RH4iedFPWyY4YajZwg71f93PhYADKKBL Yneqfz/e8+ppnFzyqcp4n9yQ= 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=G9MJMtFMAMYYnb3yhEkgYnRjb gw=; b=f82dCRmOniVXKObkoliO3K/l9W5ZHkyeJk5JCgSuon4MDVJyVFajSY5yq 4TRgdGAYvCgXYRVliFvL6PaAhnJbkmOCl1tKHX1ARbL6yfGEcL9wO2wS2Zgdv5/m TjVtWZ8gWbImOY+oRtjEWt5Ltn+jhaD8+Rfg6oHIYdD+Sj9nr4= Received: (qmail 6516 invoked by alias); 20 Sep 2014 18:24:13 -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 6390 invoked by uid 89); 20 Sep 2014 18:24:12 -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:24:10 +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 s8KIO8Q9014721; Sat, 20 Sep 2014 11:24:08 -0700 Received: (from segher@localhost) by gcc1-power7.osuosl.org (8.14.6/8.14.6/Submit) id s8KIO8UA014709; Sat, 20 Sep 2014 11:24:08 -0700 From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH 3/9] rs6000: Clean up one_cmpl2 Date: Sat, 20 Sep 2014 11:23:42 -0700 Message-Id: <0b3dde22d75d9b64800efc8501b9ae4a059b9889.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 Just the usual tidying. Also use the "not" extended mnemonic instead of the "nor" that translates to. 2014-09-20 Segher Boessenkool * config/rs6000/rs6000.md (*one_cmpl2): Generate "not" insn. (two anonymous define_insn and two define_split): Delete. (*one_cmpl2_dot, *one_cmpl2_dot2): New. --- gcc/config/rs6000/rs6000.md | 68 +++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 1e73e6a..1a289d6 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1594,61 +1594,49 @@ (define_insn "*one_cmpl2" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" - "nor %0,%1,%1") + "not %0,%1") -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) +(define_insn_and_split "*one_cmpl2_dot" + [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") + (compare:CC (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:P 2 "=r,r"))] - "" + (clobber (match_scratch:GPR 0 "=r,r"))] + "mode == Pmode && rs6000_gen_cell_microcode" "@ - nor. %2,%1,%1 + not. %0,%1 #" - [(set_attr "type" "logical,compare") + "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)" + [(set (match_dup 0) + (not:GPR (match_dup 1))) + (set (match_dup 2) + (compare:CC (match_dup 0) + (const_int 0)))] + "" + [(set_attr "type" "logical") (set_attr "dot" "yes") (set_attr "length" "4,8")]) -(define_split - [(set (match_operand:CC 0 "cc_reg_not_micro_cr0_operand" "") - (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:P 2 ""))] - "reload_completed" - [(set (match_dup 2) - (not:P (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" +(define_insn_and_split "*one_cmpl2_dot2" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) + (compare:CC (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:P 0 "gpc_reg_operand" "=r,r") - (not:P (match_dup 1)))] - "" + (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") + (not:GPR (match_dup 1)))] + "mode == Pmode && rs6000_gen_cell_microcode" "@ - nor. %0,%1,%1 + not. %0,%1 #" - [(set_attr "type" "logical,compare") - (set_attr "dot" "yes") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_micro_cr0_operand" "") - (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:P 0 "gpc_reg_operand" "") - (not:P (match_dup 1)))] - "reload_completed" + "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)" [(set (match_dup 0) - (not:P (match_dup 1))) + (not:GPR (match_dup 1))) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] - "") + "" + [(set_attr "type" "logical") + (set_attr "dot" "yes") + (set_attr "length" "4,8")]) + (define_insn "" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")