]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
predicates.md (logical_const_operand): Split out of logical_operand.
authorPaolo Bonzini <bonzini@gnu.org>
Mon, 5 Dec 2005 17:20:49 +0000 (17:20 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Mon, 5 Dec 2005 17:20:49 +0000 (17:20 +0000)
2005-12-05  Paolo Bonzini  <bonzini@gnu.org>

        * config/rs6000/predicates.md (logical_const_operand): Split
        out of logical_operand.
        (logical_operand): Use it.
        * config/rs6000/rs6000.md (cmp -> xor peephole2): Use
        logical_const_operand.

From-SVN: r108065

gcc/ChangeLog
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000.md

index ea5a9c9e25de4cf4df7ba1f3f20194c24647e403..d443ba6a98948073fe054a85bc5eca420f613ace 100644 (file)
@@ -1,3 +1,11 @@
+2005-12-05  Paolo Bonzini  <bonzini@gnu.org>
+
+        * config/rs6000/predicates.md (logical_const_operand): Split
+        out of logical_operand.
+        (logical_operand): Use it.
+        * config/rs6000/rs6000.md (cmp -> xor peephole2): Use
+        logical_const_operand.
+
 2005-12-05  Jan Beulich  <jbeulich@novell.com>
 
        * config/i386/i386.c (enum ix86_builtins): Remove IX86_BUILTIN_CMPNEPS
index 26f46a0e0fd7c01cd4f48a850858df4e88ef0893..7baa401aedc4d059f1fbe0a2717ae3e4668159b2 100644 (file)
        (match_test "!CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')
                    && !CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')")))
 
-;; Return 1 if the operand is a non-special register or a constant that
-;; can be used as the operand of an OR or XOR.
-(define_predicate "logical_operand"
-  (match_code "reg,subreg,const_int,const_double")
+;; Return 1 if the operand is a constant that can be used as the operand
+;; of an OR or XOR.
+(define_predicate "logical_const_operand"
+  (match_code "const_int,const_double")
 {
   HOST_WIDE_INT opl, oph;
 
-  if (gpc_reg_operand (op, mode))
-    return 1;
-
   if (GET_CODE (op) == CONST_INT)
     {
       opl = INTVAL (op) & GET_MODE_MASK (mode);
          || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0);
 })
 
+;; Return 1 if the operand is a non-special register or a constant that
+;; can be used as the operand of an OR or XOR.
+(define_predicate "logical_operand"
+  (ior (match_operand 0 "gpc_reg_operand")
+       (match_operand 0 "logical_const_operand")))
+
 ;; Return 1 if op is a constant that is not a logical operand, but could
 ;; be split into one.
 (define_predicate "non_logical_cint_operand"
index 14e1fb80531f1ab7f7963fc4b513ac2b0817e66c..17d8ef660ce6e3b990f08acbfa7273892b380e34 100644 (file)
 
 (define_peephole2
   [(set (match_operand:SI 0 "register_operand")
-        (match_operand:SI 1 "logical_operand" ""))
+        (match_operand:SI 1 "logical_const_operand" ""))
    (set (match_dup 0) (match_operator:SI 3 "boolean_or_operator"
                       [(match_dup 0)
-                       (match_operand:SI 2 "logical_operand" "")]))
+                       (match_operand:SI 2 "logical_const_operand" "")]))
    (set (match_operand:CC 4 "cc_reg_operand" "")
         (compare:CC (match_operand:SI 5 "gpc_reg_operand" "")
                     (match_dup 0)))