Patchwork [i386] : Remove ext_QIreg_nomode_operands predicate

login
register
mail settings
Submitter Uros Bizjak
Date April 26, 2011, 1:06 p.m.
Message ID <BANLkTikiiOeMecx0pArC=ZPvGTkJrgtOPg@mail.gmail.com>
Download mbox | patch
Permalink /patch/92925/
State New
Headers show

Comments

Uros Bizjak - April 26, 2011, 1:06 p.m.
Hello!

We can use ext_QIreg_operands instead.  These predicates automatically
include mode checks with VOIDmode override.

Also, clean predicates.md a bit while there.

2011-04-26  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/predicates.md (ext_QIreg_operand): Remove extra
	mode check.
	(ext_QIreg_nomode_operands): Remove.
	* config/i386/i386.md (*anddi_1): Use ext_QIreg_operand.
	(*andsi_1): Ditto.
	(*andhi_1): Ditto.

Tested on x86_64-pc-linux-gnu  {,-m32}, committed to mainline SVN.

Uros.

Patch

Index: predicates.md
===================================================================
--- predicates.md	(revision 172954)
+++ predicates.md	(working copy)
@@ -86,16 +86,9 @@ 
 ;; %[abcd][hl].
 (define_predicate "ext_QIreg_operand"
   (and (match_code "reg")
-       (match_test "TARGET_64BIT
-		    && GET_MODE (op) == QImode
-		    && REGNO (op) > BX_REG")))
+       (match_test "TARGET_64BIT")
+       (match_test "REGNO (op) > BX_REG")))
 
-;; Similarly, but don't check mode of the operand.
-(define_predicate "ext_QIreg_nomode_operand"
-  (and (match_code "reg")
-       (match_test "TARGET_64BIT
-		    && REGNO (op) > BX_REG")))
-
 ;; Return true if op is not xmm0 register.
 (define_predicate "reg_not_xmm0_operand"
   (match_operand 0 "register_operand")
@@ -391,7 +384,8 @@ 
 
 ;; Return true if OP is nonmemory operand acceptable by movabs patterns.
 (define_predicate "x86_64_movabs_operand"
-  (if_then_else (match_test "!TARGET_64BIT || !flag_pic")
+  (if_then_else (not (and (match_test "TARGET_64BIT")
+			  (match_test "flag_pic")))
     (match_operand 0 "nonmemory_operand")
     (ior (match_operand 0 "register_operand")
 	 (and (match_operand 0 "const_double_operand")
@@ -483,7 +477,7 @@ 
 ;; scripts means that we can't be sure of that in general, so assume
 ;; that @GOTOFF is never valid on VxWorks.
 (define_predicate "gotoff_operand"
-  (and (match_test "!TARGET_VXWORKS_RTP")
+  (and (not (match_test "TARGET_VXWORKS_RTP"))
        (match_operand 0 "local_symbolic_operand")))
 
 ;; Test for various thread-local symbols.
@@ -611,7 +605,8 @@ 
 ;; Match 0 or 1.
 (define_predicate "const_0_to_1_operand"
   (and (match_code "const_int")
-       (match_test "op == const0_rtx || op == const1_rtx")))
+       (ior (match_test "op == const0_rtx")
+	    (match_test "op == const1_rtx"))))
 
 ;; Match 0 to 3.
 (define_predicate "const_0_to_3_operand"
@@ -696,7 +691,8 @@ 
 ;; Match exactly one bit in 2-bit mask.
 (define_predicate "const_pow2_1_to_2_operand"
   (and (match_code "const_int")
-       (match_test "INTVAL (op) == 1 || INTVAL (op) == 2")))
+       (ior (match_test "op == const1_rtx")
+	    (match_test "op == const2_rtx"))))
 
 ;; Match exactly one bit in 4-bit mask.
 (define_predicate "const_pow2_1_to_8_operand"
@@ -737,7 +733,8 @@ 
 (define_predicate "reg_or_pm1_operand"
   (ior (match_operand 0 "register_operand")
        (and (match_code "const_int")
-	    (match_test "op == const1_rtx || op == constm1_rtx"))))
+	    (ior (match_test "op == const1_rtx")
+		 (match_test "op == constm1_rtx")))))
 
 ;; True if OP is acceptable as operand of DImode shift expander.
 (define_predicate "shiftdi_operand"
@@ -984,8 +981,8 @@ 
 
 (define_predicate "sse_comparison_operator"
   (ior (match_code "eq,ne,lt,le,unordered,unge,ungt,ordered")
-       (and (match_code "ge,gt,uneq,unle,unlt,ltgt")
-	    (match_test "TARGET_AVX"))))
+       (and (match_test "TARGET_AVX")
+	    (match_code "ge,gt,uneq,unle,unlt,ltgt"))))
 
 (define_predicate "ix86_comparison_int_operator"
   (match_code "ne,eq,ge,gt,le,lt"))
Index: i386.md
===================================================================
--- i386.md	(revision 172954)
+++ i386.md	(working copy)
@@ -7932,7 +7932,7 @@ 
      (if_then_else
        (and (eq_attr "type" "imovx")
 	    (and (ne (symbol_ref "INTVAL (operands[2]) == 0xff") (const_int 0))
-		 (match_operand 1 "ext_QIreg_nomode_operand" "")))
+		 (match_operand 1 "ext_QIreg_operand" "")))
        (const_string "1")
        (const_string "*")))
    (set_attr "mode" "SI,DI,DI,SI")])
@@ -7976,7 +7976,7 @@ 
      (if_then_else
        (and (eq_attr "type" "imovx")
 	    (and (ne (symbol_ref "INTVAL (operands[2]) == 0xff") (const_int 0))
-		 (match_operand 1 "ext_QIreg_nomode_operand" "")))
+		 (match_operand 1 "ext_QIreg_operand" "")))
        (const_string "1")
        (const_string "*")))
    (set_attr "length_immediate" "*,*,0")
@@ -8019,7 +8019,7 @@ 
    (set (attr "prefix_rex")
      (if_then_else
        (and (eq_attr "type" "imovx")
-	    (match_operand 1 "ext_QIreg_nomode_operand" ""))
+	    (match_operand 1 "ext_QIreg_operand" ""))
        (const_string "1")
        (const_string "*")))
    (set_attr "mode" "HI,HI,SI")])