OSDN Git Service

* config/m68k/m68k.md (dbcc peepholes): Match four forms of dbra.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Apr 2002 08:14:57 +0000 (08:14 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Apr 2002 08:14:57 +0000 (08:14 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51736 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/m68k/m68k.md

index f59547c..c1eeba4 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-02  Richard Henderson  <rth@redhat.com>
+
+       PR opt/420
+       * config/m68k/m68k.md (dbcc peepholes): Match four forms of dbra.
+
 2002-04-01  Richard Henderson  <rth@redhat.com>
 
        PR target/1538
index 41cf9b2..35ca2ba 100644 (file)
 ;;
 ;; Which moves the jCC condition outside the inner loop for free.
 ;;
+
+(define_peephole
+  [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
+                             [(cc0) (const_int 0)])
+                           (label_ref (match_operand 2 "" ""))
+                           (pc)))
+   (parallel
+    [(set (pc)
+         (if_then_else
+           (ne (match_operand:HI 0 "register_operand" "")
+               (const_int 0))
+           (label_ref (match_operand 1 "" ""))
+           (pc)))
+     (set (match_dup 0)
+         (plus:HI (match_dup 0)
+                  (const_int -1)))])]
+  "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+  "*
+{
+  CC_STATUS_INIT;
+  output_dbcc_and_branch (operands);
+  return \"\";
+}")
+
+(define_peephole
+  [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
+                             [(cc0) (const_int 0)])
+                           (label_ref (match_operand 2 "" ""))
+                           (pc)))
+   (parallel
+    [(set (pc)
+         (if_then_else
+           (ne (match_operand:SI 0 "register_operand" "")
+               (const_int 0))
+           (label_ref (match_operand 1 "" ""))
+           (pc)))
+     (set (match_dup 0)
+         (plus:SI (match_dup 0)
+                  (const_int -1)))])]
+  "!TARGET_5200 && DATA_REG_P (operands[0]) && ! flags_in_68881 ()"
+  "*
+{
+  CC_STATUS_INIT;
+  output_dbcc_and_branch (operands);
+  return \"\";
+}")
+
 (define_peephole
   [(set (pc) (if_then_else (match_operator 3 "valid_dbcc_comparison_p"
                              [(cc0) (const_int 0)])
    (parallel
     [(set (pc)
          (if_then_else
-           (ge (plus:HI (match_operand:HI 0 "register_operand" "+d")
+           (ge (plus:HI (match_operand:HI 0 "register_operand" "")
                         (const_int -1))
                (const_int 0))
            (label_ref (match_operand 1 "" ""))
    (parallel
     [(set (pc)
          (if_then_else
-           (ge (plus:SI (match_operand:SI 0 "register_operand" "+d")
+           (ge (plus:SI (match_operand:SI 0 "register_operand" "")
                         (const_int -1))
                (const_int 0))
            (label_ref (match_operand 1 "" ""))