From patchwork Tue Sep 13 18:02:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 114526 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 2471DB71C1 for ; Wed, 14 Sep 2011 04:03:07 +1000 (EST) Received: (qmail 1454 invoked by alias); 13 Sep 2011 18:03:03 -0000 Received: (qmail 1351 invoked by uid 22791); 13 Sep 2011 18:03:01 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Sep 2011 18:02:43 +0000 Received: by eya25 with SMTP id 25so346793eya.20 for ; Tue, 13 Sep 2011 11:02:41 -0700 (PDT) Received: by 10.216.210.201 with SMTP id u51mr1265051weo.22.1315936961327; Tue, 13 Sep 2011 11:02:41 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk. [82.133.89.107]) by mx.google.com with ESMTPS id fa7sm1224819wbb.26.2011.09.13.11.02.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Sep 2011 11:02:40 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, rdsandiford@googlemail.com Cc: dje.gcc@gmail.com Subject: [PPC] Use match_test rather than eq/ne symbol_ref Date: Tue, 13 Sep 2011 19:02:38 +0100 Message-ID: <871uvk722p.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 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 As per the subject. Tested by making sure that there were no new warnings building powerpc-linux-gnu, and that there were no changes in the assembly output for the C and C++ testsuite. OK to install? Richard gcc/ * config/rs6000/rs6000.md: Use match_test rather than eq/ne symbol_ref throughout file. * config/rs6000/constraints.md: Likewise. Index: gcc/config/rs6000/rs6000.md =================================================================== --- gcc/config/rs6000/rs6000.md 2011-09-13 18:43:39.000000000 +0100 +++ gcc/config/rs6000/rs6000.md 2011-09-13 19:02:06.000000000 +0100 @@ -9429,7 +9429,7 @@ (define_insn "*movcc_internal1" (const_string "load") (eq_attr "alternative" "12") (const_string "store") - (ne (symbol_ref "TARGET_MFCRF") (const_int 0)) + (match_test "TARGET_MFCRF") (const_string "mfcrf") ] (const_string "mfcr"))) @@ -10323,7 +10323,7 @@ (define_insn "*movti_string" } }" [(set_attr "type" "store_ux,store_ux,*,load_ux,load_ux,*") - (set (attr "cell_micro") (if_then_else (eq (symbol_ref "TARGET_STRING") (const_int 1)) + (set (attr "cell_micro") (if_then_else (match_test "TARGET_STRING") (const_string "always") (const_string "conditional")))]) @@ -13449,7 +13449,7 @@ (define_insn "" "" "mfcr %0%Q2\;{rlinm|rlwinm} %0,%0,%J1,1" [(set (attr "type") - (cond [(ne (symbol_ref "TARGET_MFCRF") (const_int 0)) + (cond [(match_test "TARGET_MFCRF") (const_string "mfcrf") ] (const_string "mfcr"))) @@ -13481,7 +13481,7 @@ (define_insn "" "TARGET_POWERPC64" "mfcr %0%Q2\;{rlinm|rlwinm} %0,%0,%J1,1" [(set (attr "type") - (cond [(ne (symbol_ref "TARGET_MFCRF") (const_int 0)) + (cond [(match_test "TARGET_MFCRF") (const_string "mfcrf") ] (const_string "mfcr"))) @@ -13542,7 +13542,7 @@ (define_insn "" return \"mfcr %0%Q2\;{rlinm|rlwinm} %0,%0,%4,%5,%5\"; }" [(set (attr "type") - (cond [(ne (symbol_ref "TARGET_MFCRF") (const_int 0)) + (cond [(match_test "TARGET_MFCRF") (const_string "mfcrf") ] (const_string "mfcr"))) Index: gcc/config/rs6000/constraints.md =================================================================== --- gcc/config/rs6000/constraints.md 2011-09-13 18:43:39.000000000 +0100 +++ gcc/config/rs6000/constraints.md 2011-09-13 19:02:06.000000000 +0100 @@ -198,4 +198,4 @@ (define_constraint "W" (define_constraint "j" "Zero vector constant" - (match_test "(op == const0_rtx || op == CONST0_RTX (GET_MODE (op)))")) + (match_test "op == const0_rtx || op == CONST0_RTX (GET_MODE (op))"))