2008-09-25 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Sep 2008 23:44:57 +0000 (23:44 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Sep 2008 23:44:57 +0000 (23:44 +0000)
* config/i386/i386.md: Check cmp/branch fuse for cmp peephole
optimization.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140673 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md

index 0515819..aa42f0b 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/i386/i386.md: Check cmp/branch fuse for cmp peephole
+       optimization.
+
 2008-09-25  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * combine.c (make_compound_operation): Handle the 'E' format.
@@ -11,7 +16,7 @@
 
 2008-09-25 Sergei Dyshel <sergeid@il.ibm.com>
 
-      * matrix-reorg.c (transform_allocation_sites): Initializers 
+       * matrix-reorg.c (transform_allocation_sites): Initializers 
        added to avoid the warning.
 
 2008-09-25  Martin Jambor  <mjambor@suse.cz>
index de58df3..c6fba67 100644 (file)
   "")
 \f
 ;; Convert compares with 1 to shorter inc/dec operations when CF is not
-;; required and register dies.  Similarly for 128 to plus -128.
+;; required and register dies.  Similarly for 128 to -128.
 (define_peephole2
   [(set (match_operand 0 "flags_reg_operand" "")
        (match_operator 1 "compare_operator"
          [(match_operand 2 "register_operand" "")
           (match_operand 3 "const_int_operand" "")]))]
-  "(INTVAL (operands[3]) == -1
-    || INTVAL (operands[3]) == 1
-    || INTVAL (operands[3]) == 128)
+  "(((!TARGET_FUSE_CMP_AND_BRANCH || optimize_size)
+     && incdec_operand (operands[3], GET_MODE (operands[3])))
+    || (!TARGET_FUSE_CMP_AND_BRANCH
+       && INTVAL (operands[3]) == 128))
    && ix86_match_ccmode (insn, CCGCmode)
    && peep2_reg_dead_p (1, operands[2])"
   [(parallel [(set (match_dup 0)