Patchwork [PPC] Use match_test rather than eq/ne symbol_ref

login
register
mail settings
Submitter Richard Sandiford
Date Sept. 13, 2011, 6:02 p.m.
Message ID <871uvk722p.fsf@firetop.home>
Download mbox | patch
Permalink /patch/114526/
State New
Headers show

Comments

Richard Sandiford - Sept. 13, 2011, 6:02 p.m.
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.
David Edelsohn - Sept. 13, 2011, 11:57 p.m.
On Tue, Sep 13, 2011 at 2:02 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> 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.

Okay.

Thanks, David

Patch

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))"))