01e27f8
--- gcc/config/i386/i386.c	Mon Oct 23 22:51:33 2000
01e27f8
+++ gcc/config/i386/i386.c	Fri Oct 27 17:41:12 2000
01e27f8
@@ -1272,47 +1272,58 @@ no_comparison_operator (op, mode)
01e27f8
       return 0;
01e27f8
     }
01e27f8
 }
01e27f8
-
01e27f8
-/* Return 1 if OP is a comparison operator that can be issued by fcmov.  */
01e27f8
-
01e27f8
+/* Return 1 if OP is a valid comparison operator in valid mode.  */
01e27f8
 int
01e27f8
-fcmov_comparison_operator (op, mode)
01e27f8
-    register rtx op;
01e27f8
-    enum machine_mode mode;
01e27f8
+ix86_comparison_operator (op, mode)
01e27f8
+     register rtx op;
01e27f8
+     enum machine_mode mode;
01e27f8
 {
01e27f8
+  enum machine_mode inmode;
01e27f8
   if (mode != VOIDmode && GET_MODE (op) != mode)
01e27f8
     return 0;
01e27f8
-
01e27f8
   switch (GET_CODE (op))
01e27f8
     {
01e27f8
     case EQ: case NE:
01e27f8
-    case LEU: case LTU: case GEU: case GTU:
01e27f8
-    case UNORDERED: case ORDERED:
01e27f8
       return 1;
01e27f8
-
01e27f8
+    case LT: case GE:
01e27f8
+      inmode = GET_MODE (XEXP (op, 0));
01e27f8
+      if (inmode == CCmode || inmode == CCGCmode
01e27f8
+	  || inmode == CCGOCmode || inmode == CCNOmode)
01e27f8
+	return 1;
01e27f8
+      return 0;
01e27f8
+    case LTU: case GTU: case LEU: case ORDERED: case UNORDERED: case GEU:
01e27f8
+      inmode = GET_MODE (XEXP (op, 0));
01e27f8
+      if (inmode == CCmode)
01e27f8
+	return 1;
01e27f8
+      return 0;
01e27f8
+    case GT: case LE:
01e27f8
+      inmode = GET_MODE (XEXP (op, 0));
01e27f8
+      if (inmode == CCmode || inmode == CCGCmode || inmode == CCNOmode)
01e27f8
+	return 1;
01e27f8
+      return 0;
01e27f8
     default:
01e27f8
       return 0;
01e27f8
     }
01e27f8
 }
01e27f8
 
01e27f8
-/* Return 1 if OP is any normal comparison operator plus {UN}ORDERED.  */
01e27f8
+/* Return 1 if OP is a comparison operator that can be issued by fcmov.  */
01e27f8
 
01e27f8
-int 
01e27f8
-uno_comparison_operator (op, mode)
01e27f8
+int
01e27f8
+fcmov_comparison_operator (op, mode)
01e27f8
     register rtx op;
01e27f8
     enum machine_mode mode;
01e27f8
 {
01e27f8
+  enum machine_mode inmode = GET_MODE (XEXP (op, 0));
01e27f8
   if (mode != VOIDmode && GET_MODE (op) != mode)
01e27f8
     return 0;
01e27f8
-
01e27f8
   switch (GET_CODE (op))
01e27f8
     {
01e27f8
     case EQ: case NE:
01e27f8
-    case LE: case LT: case GE: case GT:
01e27f8
-    case LEU: case LTU: case GEU: case GTU:
01e27f8
-    case UNORDERED: case ORDERED:
01e27f8
       return 1;
01e27f8
-
01e27f8
+    case LTU: case GTU: case LEU: case ORDERED: case UNORDERED: case GEU:
01e27f8
+      if (inmode == CCmode)
01e27f8
+	return 1;
01e27f8
+      return 0;
01e27f8
     default:
01e27f8
       return 0;
01e27f8
     }
01e27f8
@@ -3035,40 +3046,52 @@ put_condition_code (code, mode, reverse,
01e27f8
       suffix = "ne";
01e27f8
       break;
01e27f8
     case GT:
01e27f8
-      if (mode == CCNOmode)
01e27f8
+      if (mode != CCmode && mode != CCNOmode && mode != CCGCmode)
01e27f8
 	abort ();
01e27f8
       suffix = "g";
01e27f8
       break;
01e27f8
     case GTU:
01e27f8
       /* ??? Use "nbe" instead of "a" for fcmov losage on some assemblers.
01e27f8
 	 Those same assemblers have the same but opposite losage on cmov.  */
01e27f8
+      if (mode != CCmode)
01e27f8
+	abort();
01e27f8
       suffix = fp ? "nbe" : "a";
01e27f8
       break;
01e27f8
     case LT:
01e27f8
-      if (mode == CCNOmode)
01e27f8
+      if (mode == CCNOmode || mode == CCGOCmode)
01e27f8
 	suffix = "s";
01e27f8
-      else
01e27f8
+      else if (mode == CCmode || mode == CCGCmode)
01e27f8
 	suffix = "l";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
       break;
01e27f8
     case LTU:
01e27f8
+      if (mode != CCmode)
01e27f8
+	abort();
01e27f8
       suffix = "b";
01e27f8
       break;
01e27f8
     case GE:
01e27f8
-      if (mode == CCNOmode)
01e27f8
+      if (mode == CCNOmode || mode == CCGOCmode)
01e27f8
 	suffix = "ns";
01e27f8
-      else
01e27f8
+      else if (mode == CCmode || mode == CCGCmode)
01e27f8
 	suffix = "ge";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
       break;
01e27f8
     case GEU:
01e27f8
       /* ??? As above.  */
01e27f8
+      if (mode != CCmode)
01e27f8
+	abort();
01e27f8
       suffix = fp ? "nb" : "ae";
01e27f8
       break;
01e27f8
     case LE:
01e27f8
-      if (mode == CCNOmode)
01e27f8
+      if (mode != CCmode && mode != CCGCmode && mode != CCNOmode)
01e27f8
 	abort ();
01e27f8
       suffix = "le";
01e27f8
       break;
01e27f8
     case LEU:
01e27f8
+      if (mode != CCmode)
01e27f8
+	abort ();
01e27f8
       suffix = "be";
01e27f8
       break;
01e27f8
     case UNORDERED:
01e27f8
@@ -4454,15 +4477,27 @@ ix86_match_ccmode (insn, req_mode)
01e27f8
     set = XVECEXP (set, 0, 0);
01e27f8
   if (GET_CODE (set) != SET)
01e27f8
     abort ();
01e27f8
+  if (GET_CODE (SET_SRC (set)) != COMPARE)
01e27f8
+    abort ();
01e27f8
 
01e27f8
   set_mode = GET_MODE (SET_DEST (set));
01e27f8
   switch (set_mode)
01e27f8
     {
01e27f8
+    case CCNOmode:
01e27f8
+      if (req_mode != CCNOmode
01e27f8
+	  && (req_mode != CCmode
01e27f8
+	      || XEXP (SET_SRC (set), 1) != const0_rtx))
01e27f8
+	return 0;
01e27f8
+      break;
01e27f8
     case CCmode:
01e27f8
-      if (req_mode == CCNOmode)
01e27f8
+      if (req_mode == CCGCmode)
01e27f8
 	return 0;
01e27f8
       /* FALLTHRU */
01e27f8
-    case CCNOmode:
01e27f8
+    case CCGCmode:
01e27f8
+      if (req_mode == CCGOCmode || req_mode == CCNOmode)
01e27f8
+	return 0;
01e27f8
+      /* FALLTHRU */
01e27f8
+    case CCGOCmode:
01e27f8
       if (req_mode == CCZmode)
01e27f8
 	return 0;
01e27f8
       /* FALLTHRU */
01e27f8
@@ -4572,6 +4607,49 @@ ix86_fp_compare_mode (code)
01e27f8
   return unordered ? CCFPUmode : CCFPmode;
01e27f8
 }
01e27f8
 
01e27f8
+enum machine_mode
01e27f8
+ix86_cc_mode (code, op0, op1)
01e27f8
+     enum rtx_code code;
01e27f8
+     rtx op0, op1;
01e27f8
+{
01e27f8
+  if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT)
01e27f8
+    return ix86_fp_compare_mode (code);
01e27f8
+  switch (code)
01e27f8
+    {
01e27f8
+      /* Only zero flag is needed.  */
01e27f8
+    case EQ:			/* ZF=0 */
01e27f8
+    case NE:			/* ZF!=0 */
01e27f8
+      return CCZmode;
01e27f8
+      /* Codes needing carry flag.  */
01e27f8
+    case GEU:			/* CF=0 */
01e27f8
+    case GTU:			/* CF=0 & ZF=0 */
01e27f8
+    case LTU:			/* CF=1 */
01e27f8
+    case LEU:			/* CF=1 | ZF=1 */
01e27f8
+      return CCmode;
01e27f8
+      /* Codes possibly doable only with sign flag when
01e27f8
+         comparing against zero.  */
01e27f8
+    case GE:			/* SF=OF   or   SF=0 */
01e27f8
+    case LT:			/* SF<>OF  or   SF=0 */
01e27f8
+      if (op1 == const0_rtx)
01e27f8
+	return CCGOCmode;
01e27f8
+      else
01e27f8
+	/* For other cases Carry flag is not required.  */
01e27f8
+	return CCGCmode;
01e27f8
+      /* Codes doable only with sign flag when comparing
01e27f8
+         against zero, but we miss jump instruction for it
01e27f8
+         so we need to use relational tests agains overflow
01e27f8
+         that thus needs to be zero.  */
01e27f8
+    case GT:			/* ZF=0 & SF=OF */
01e27f8
+    case LE:			/* ZF=1 | SF<>OF */
01e27f8
+      if (op1 == const0_rtx)
01e27f8
+	return CCNOmode;
01e27f8
+      else
01e27f8
+	return CCGCmode;
01e27f8
+    default:
01e27f8
+      abort();
01e27f8
+    }
01e27f8
+}
01e27f8
+
01e27f8
 /* Return true if we should use an FCOMI instruction for this fp comparison.  */
01e27f8
 
01e27f8
 int
01e27f8
@@ -4816,6 +4894,7 @@ ix86_expand_fp_compare (code, op0, op1, 
01e27f8
 	      emit_insn (gen_andqi_ext_0 (scratch, scratch, GEN_INT (0x45)));
01e27f8
 	      emit_insn (gen_addqi_ext_1 (scratch, scratch, constm1_rtx));
01e27f8
 	      emit_insn (gen_cmpqi_ext_3 (scratch, GEN_INT (0x44)));
01e27f8
+	      intcmp_mode = CCmode;
01e27f8
 	      code = GEU;
01e27f8
 	      break;
01e27f8
 	    case UNLE:
01e27f8
@@ -5865,8 +5944,6 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
   rtx align_4_label = gen_label_rtx ();
01e27f8
   rtx end_0_label = gen_label_rtx ();
01e27f8
   rtx mem;
01e27f8
-  rtx no_flags = gen_rtx_REG (CCNOmode, FLAGS_REG);
01e27f8
-  rtx z_flags = gen_rtx_REG (CCNOmode, FLAGS_REG);
01e27f8
   rtx tmpreg = gen_reg_rtx (SImode);
01e27f8
 
01e27f8
   align = 0;
01e27f8
@@ -5888,30 +5965,12 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
 	  align_rtx = expand_binop (SImode, and_optab, scratch, GEN_INT (3),
01e27f8
 				    NULL_RTX, 0, OPTAB_WIDEN);
01e27f8
 
01e27f8
-	  emit_insn (gen_cmpsi_ccz_1 (align_rtx, const0_rtx));
01e27f8
-
01e27f8
-	  tmp = gen_rtx_EQ (VOIDmode, z_flags, const0_rtx);
01e27f8
-	  tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				      gen_rtx_LABEL_REF (VOIDmode,
01e27f8
-							 align_4_label),
01e27f8
-				      pc_rtx);
01e27f8
-	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
-
01e27f8
-	  emit_insn (gen_cmpsi_ccno_1 (align_rtx, GEN_INT (2)));
01e27f8
-
01e27f8
-	  tmp = gen_rtx_EQ (VOIDmode, no_flags, const0_rtx);
01e27f8
-	  tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				      gen_rtx_LABEL_REF (VOIDmode,
01e27f8
-							 align_2_label),
01e27f8
-				      pc_rtx);
01e27f8
-	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
-
01e27f8
-	  tmp = gen_rtx_GTU (VOIDmode, no_flags, const0_rtx);
01e27f8
-	  tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				      gen_rtx_LABEL_REF (VOIDmode,
01e27f8
-							 align_3_label),
01e27f8
-				      pc_rtx);
01e27f8
-	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
+	  emit_cmp_and_jump_insns (align_rtx, const0_rtx, EQ, NULL,
01e27f8
+			  	   SImode, 1, 0, align_4_label);
01e27f8
+	  emit_cmp_and_jump_insns (align_rtx, GEN_INT (2), EQ, NULL,
01e27f8
+				   SImode, 1, 0, align_2_label);
01e27f8
+	  emit_cmp_and_jump_insns (align_rtx, GEN_INT (2), GTU, NULL,
01e27f8
+				   SImode, 1, 0, align_3_label);
01e27f8
 	}
01e27f8
       else
01e27f8
         {
01e27f8
@@ -5921,14 +5980,8 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
 	  align_rtx = expand_binop (SImode, and_optab, scratch, GEN_INT (2),
01e27f8
 				    NULL_RTX, 0, OPTAB_WIDEN);
01e27f8
 
01e27f8
-	  emit_insn (gen_cmpsi_ccz_1 (align_rtx, const0_rtx));
01e27f8
-
01e27f8
-	  tmp = gen_rtx_EQ (VOIDmode, z_flags, const0_rtx);
01e27f8
-	  tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				      gen_rtx_LABEL_REF (VOIDmode,
01e27f8
-							 align_4_label),
01e27f8
-				      pc_rtx);
01e27f8
-	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
+	  emit_cmp_and_jump_insns (align_rtx, const0_rtx, EQ, NULL,
01e27f8
+				   SImode, 1, 0, align_4_label);
01e27f8
         }
01e27f8
 
01e27f8
       mem = gen_rtx_MEM (QImode, out);
01e27f8
@@ -5936,13 +5989,8 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
       /* Now compare the bytes.  */
01e27f8
 
01e27f8
       /* Compare the first n unaligned byte on a byte per byte basis. */
01e27f8
-      emit_insn (gen_cmpqi_ccz_1 (mem, const0_rtx));
01e27f8
-
01e27f8
-      tmp = gen_rtx_EQ (VOIDmode, z_flags, const0_rtx);
01e27f8
-      tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				  gen_rtx_LABEL_REF (VOIDmode, end_0_label),
01e27f8
-				  pc_rtx);
01e27f8
-      emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
+      emit_cmp_and_jump_insns (mem, const0_rtx, EQ, NULL,
01e27f8
+			       QImode, 1, 0, end_0_label);
01e27f8
 
01e27f8
       /* Increment the address. */
01e27f8
       emit_insn (gen_addsi3 (out, out, const1_rtx));
01e27f8
@@ -5952,27 +6000,16 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
 	{
01e27f8
 	  emit_label (align_2_label);
01e27f8
 
01e27f8
-	  emit_insn (gen_cmpqi_ccz_1 (mem, const0_rtx));
01e27f8
-
01e27f8
-	  tmp = gen_rtx_EQ (VOIDmode, z_flags, const0_rtx);
01e27f8
-	  tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				      gen_rtx_LABEL_REF (VOIDmode,
01e27f8
-							 end_0_label),
01e27f8
-				      pc_rtx);
01e27f8
-	  emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
+	  emit_cmp_and_jump_insns (mem, const0_rtx, EQ, NULL,
01e27f8
+				   QImode, 1, 0, end_0_label);
01e27f8
 
01e27f8
 	  emit_insn (gen_addsi3 (out, out, const1_rtx));
01e27f8
 
01e27f8
 	  emit_label (align_3_label);
01e27f8
 	}
01e27f8
 
01e27f8
-      emit_insn (gen_cmpqi_ccz_1 (mem, const0_rtx));
01e27f8
-
01e27f8
-      tmp = gen_rtx_EQ (VOIDmode, z_flags, const0_rtx);
01e27f8
-      tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, 
01e27f8
-				  gen_rtx_LABEL_REF (VOIDmode, end_0_label),
01e27f8
-				  pc_rtx);
01e27f8
-      emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp));
01e27f8
+      emit_cmp_and_jump_insns (mem, const0_rtx, EQ, NULL,
01e27f8
+			       QImode, 1, 0, end_0_label);
01e27f8
 
01e27f8
       emit_insn (gen_addsi3 (out, out, const1_rtx));
01e27f8
     }
01e27f8
@@ -5993,7 +6030,8 @@ ix86_expand_strlensi_unroll_1 (out, alig
01e27f8
   emit_insn (gen_one_cmplsi2 (scratch, scratch));
01e27f8
   emit_insn (gen_andsi3 (tmpreg, tmpreg, scratch));
01e27f8
   emit_insn (gen_andsi3 (tmpreg, tmpreg, GEN_INT (0x80808080)));
01e27f8
-  emit_cmp_and_jump_insns (tmpreg, const0_rtx, EQ, 0, SImode, 1, 0, align_4_label);
01e27f8
+  emit_cmp_and_jump_insns (tmpreg, const0_rtx, EQ, 0,
01e27f8
+			   SImode, 1, 0, align_4_label);
01e27f8
 
01e27f8
   if (TARGET_CMOVE)
01e27f8
     {
01e27f8
--- gcc/config/i386/i386.h	Mon Oct 30 15:33:07 2000
01e27f8
+++ gcc/config/i386/i386.h	Mon Oct 30 16:28:01 2000
01e27f8
@@ -2253,14 +2254,25 @@ while (0)
01e27f8
 
01e27f8
    For the i386, we need separate modes when floating-point
01e27f8
    equality comparisons are being done. 
01e27f8
-
01e27f8
-   Add CCNO to indicate No Overflow, which is often also includes
01e27f8
-   No Carry.  This is typically used on the output of logicals,
01e27f8
-   and is only valid in comparisons against zero.
01e27f8
+   
01e27f8
+   Add CCNO to indicate comparisons against zero that requires
01e27f8
+   No Overflow.  Sign bit test is used instead and thus
01e27f8
+   can be used to form "a&b>0" type of tests.
01e27f8
+
01e27f8
+   Add CCGC to indicate comparisons agains zero that allows
01e27f8
+   unspecified garbage in the Carry flag.  This mode is used
01e27f8
+   by inc/dec instructions.
01e27f8
+
01e27f8
+   Add CCGCO to indicate comparisons agains zero that allows
01e27f8
+   unspecified garbage in the Carry and Overflow flag. This
01e27f8
+   mode is used to simulate comparisons of (a-b) and (a+b)
01e27f8
+   against zero using sub/cmp/add operations.
01e27f8
 
01e27f8
    Add CCZ to indicate that only the Zero flag is valid.  */
01e27f8
 
01e27f8
 #define EXTRA_CC_MODES \
01e27f8
+	CC(CCGCmode, "CCGC") \
01e27f8
+	CC(CCGOCmode, "CCGOC") \
01e27f8
 	CC(CCNOmode, "CCNO") \
01e27f8
 	CC(CCZmode, "CCZ") \
01e27f8
 	CC(CCFPmode, "CCFP") \
01e27f8
@@ -2275,12 +2287,7 @@ while (0)
01e27f8
    For integer comparisons against zero, reduce to CCNOmode or CCZmode if
01e27f8
    possible, to allow for more combinations.  */
01e27f8
 
01e27f8
-#define SELECT_CC_MODE(OP,X,Y)				\
01e27f8
-  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT		\
01e27f8
-   ? (OP) == EQ || (OP) == NE ? CCFPUmode : CCFPmode	\
01e27f8
-   : (OP) == LE || (OP) == GT ? CCmode			\
01e27f8
-   : (Y) != const0_rtx ? CCmode				\
01e27f8
-   : (OP) == EQ || (OP) == NE ? CCZmode : CCNOmode)
01e27f8
+#define SELECT_CC_MODE(OP,X,Y) ix86_cc_mode (OP, X, Y)
01e27f8
 
01e27f8
 /* Control the assembler format that we output, to the extent
01e27f8
    this does not vary between assemblers.  */
01e27f8
@@ -2588,8 +2595,8 @@ do { long l;						\
01e27f8
   {"non_q_regs_operand", {SUBREG, REG}},				\
01e27f8
   {"no_comparison_operator", {EQ, NE, LT, GE, LTU, GTU, LEU, GEU}},	\
01e27f8
   {"fcmov_comparison_operator", {EQ, NE, LTU, GTU, LEU, GEU}},		\
01e27f8
-  {"uno_comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU,	\
01e27f8
-			       GTU, UNORDERED, ORDERED}},		\
01e27f8
+  {"ix86_comparison_operator", {EQ, NE, LE, LT, GE, GT, LEU, LTU, GEU,	\
01e27f8
+				GTU, UNORDERED, ORDERED}},		\
01e27f8
   {"cmp_fp_expander_operand", {CONST_DOUBLE, SUBREG, REG, MEM}},	\
01e27f8
   {"ext_register_operand", {SUBREG, REG}},				\
01e27f8
   {"binary_fp_operator", {PLUS, MINUS, MULT, DIV}},			\
01e27f8
--- gcc/config/i386/i386.md	Mon Oct 30 15:33:04 2000
01e27f8
+++ gcc/config/i386/i386.md	Mon Oct 30 16:23:52 2000
01e27f8
@@ -71,6 +71,7 @@
01e27f8
 ;; 9  This is an `fnstsw' operation.
01e27f8
 ;; 10 This is a `sahf' operation.
01e27f8
 ;; 11 This is a `fstcw' operation
01e27f8
+;; 12 This is behaviour of add when setting carry flag.
01e27f8
 ;;
01e27f8
 ;; Insns whose names begin with "x86_" are emitted by gen_FOO calls
01e27f8
 ;; from i386.c.
01e27f8
@@ -1043,11 +1044,11 @@
01e27f8
   DONE;
01e27f8
 }")
01e27f8
 
01e27f8
-(define_insn "cmpsi_ccz_1"
01e27f8
-  [(set (reg:CCZ 17)
01e27f8
-	(compare:CCZ (match_operand:SI 0 "nonimmediate_operand" "r,?mr")
01e27f8
-		     (match_operand:SI 1 "const0_operand" "n,n")))]
01e27f8
-  ""
01e27f8
+(define_insn "*cmpsi_ccno_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:SI 0 "nonimmediate_operand" "r,?mr")
01e27f8
+		 (match_operand:SI 1 "const0_operand" "n,n")))]
01e27f8
+  "ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "@
01e27f8
    test{l}\\t{%0, %0|%0, %0}
01e27f8
    cmp{l}\\t{%1, %0|%0, %1}"
01e27f8
@@ -1055,28 +1056,34 @@
01e27f8
    (set_attr "length_immediate" "0,1")
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
-(define_insn "cmpsi_ccno_1"
01e27f8
-  [(set (reg:CCNO 17)
01e27f8
-	(compare:CCNO (match_operand:SI 0 "nonimmediate_operand" "r,?mr")
01e27f8
-		      (match_operand:SI 1 "const0_operand" "n,n")))]
01e27f8
-  ""
01e27f8
-  "@
01e27f8
-   test{l}\\t{%0, %0|%0, %0}
01e27f8
-   cmp{l}\\t{%1, %0|%0, %1}"
01e27f8
-  [(set_attr "type" "test,icmp")
01e27f8
-   (set_attr "length_immediate" "0,1")
01e27f8
+(define_insn "*cmpsi_minus_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (minus:SI (match_operand:SI 0 "nonimmediate_operand" "rm,r")
01e27f8
+			   (match_operand:SI 1 "general_operand" "ri,mr"))
01e27f8
+		 (const_int 0)))]
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)"
01e27f8
+  "cmp{l}\\t{%1, %0|%0, %1}"
01e27f8
+  [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
-(define_insn "cmpsi_1"
01e27f8
+(define_expand "cmpsi_1"
01e27f8
   [(set (reg:CC 17)
01e27f8
 	(compare:CC (match_operand:SI 0 "nonimmediate_operand" "rm,r")
01e27f8
 		    (match_operand:SI 1 "general_operand" "ri,mr")))]
01e27f8
-  "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
01e27f8
+  ""
01e27f8
+  "")
01e27f8
+
01e27f8
+(define_insn "*cmpsi_1_insn"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:SI 0 "nonimmediate_operand" "rm,r")
01e27f8
+		 (match_operand:SI 1 "general_operand" "ri,mr")))]
01e27f8
+  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
01e27f8
+    && ix86_match_ccmode (insn, CCmode)"
01e27f8
   "cmp{l}\\t{%1, %0|%0, %1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
-(define_insn "*cmphi_0"
01e27f8
+(define_insn "*cmphi_ccno_1"
01e27f8
   [(set (reg 17)
01e27f8
 	(compare (match_operand:HI 0 "nonimmediate_operand" "r,?mr")
01e27f8
 		 (match_operand:HI 1 "const0_operand" "n,n")))]
01e27f8
@@ -1088,32 +1095,31 @@
01e27f8
    (set_attr "length_immediate" "0,1")
01e27f8
    (set_attr "mode" "HI")])
01e27f8
 
01e27f8
-(define_insn "*cmphi_1"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (match_operand:HI 0 "nonimmediate_operand" "rm,r")
01e27f8
-		    (match_operand:HI 1 "general_operand" "ri,mr")))]
01e27f8
-  "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
01e27f8
+(define_insn "*cmphi_minus_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (minus:HI (match_operand:HI 0 "nonimmediate_operand" "rm,r")
01e27f8
+			   (match_operand:HI 1 "general_operand" "ri,mr"))
01e27f8
+		 (const_int 0)))]
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)"
01e27f8
   "cmp{w}\\t{%1, %0|%0, %1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "HI")])
01e27f8
 
01e27f8
-(define_insn "cmpqi_ccz_1"
01e27f8
-  [(set (reg:CCZ 17)
01e27f8
-	(compare:CCZ (match_operand:QI 0 "nonimmediate_operand" "q,?mq")
01e27f8
-		     (match_operand:QI 1 "const0_operand" "n,n")))]
01e27f8
-  ""
01e27f8
-  "@
01e27f8
-   test{b}\\t{%0, %0|%0, %0}
01e27f8
-   cmp{b}\\t{$0, %0|%0, 0}"
01e27f8
-  [(set_attr "type" "test,icmp")
01e27f8
-   (set_attr "length_immediate" "0,1")
01e27f8
-   (set_attr "mode" "QI")])
01e27f8
+(define_insn "*cmphi_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:HI 0 "nonimmediate_operand" "rm,r")
01e27f8
+		 (match_operand:HI 1 "general_operand" "ri,mr")))]
01e27f8
+  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
01e27f8
+   && ix86_match_ccmode (insn, CCmode)"
01e27f8
+  "cmp{w}\\t{%1, %0|%0, %1}"
01e27f8
+  [(set_attr "type" "icmp")
01e27f8
+   (set_attr "mode" "HI")])
01e27f8
 
01e27f8
 (define_insn "*cmpqi_ccno_1"
01e27f8
-  [(set (reg:CCNO 17)
01e27f8
-	(compare:CCNO (match_operand:QI 0 "nonimmediate_operand" "q,?mq")
01e27f8
-		      (match_operand:QI 1 "const0_operand" "n,n")))]
01e27f8
-  ""
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:QI 0 "nonimmediate_operand" "q,?mq")
01e27f8
+		 (match_operand:QI 1 "const0_operand" "n,n")))]
01e27f8
+  "ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "@
01e27f8
    test{b}\\t{%0, %0|%0, %0}
01e27f8
    cmp{b}\\t{$0, %0|%0, 0}"
01e27f8
@@ -1122,24 +1128,35 @@
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
 (define_insn "*cmpqi_1"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (match_operand:QI 0 "nonimmediate_operand" "qm,q")
01e27f8
-		    (match_operand:QI 1 "general_operand" "qi,mq")))]
01e27f8
-  "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:QI 0 "nonimmediate_operand" "qm,q")
01e27f8
+		 (match_operand:QI 1 "general_operand" "qi,mq")))]
01e27f8
+  "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
01e27f8
+    && ix86_match_ccmode (insn, CCmode)"
01e27f8
   "cmp{b}\\t{%1, %0|%0, %1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
+(define_insn "*cmpqi_minus_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (minus:QI (match_operand:QI 0 "nonimmediate_operand" "rm,r")
01e27f8
+			   (match_operand:QI 1 "general_operand" "ri,mr"))
01e27f8
+		 (const_int 0)))]
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)"
01e27f8
+  "cmp{w}\\t{%1, %0|%0, %1}"
01e27f8
+  [(set_attr "type" "icmp")
01e27f8
+   (set_attr "mode" "QI")])
01e27f8
+
01e27f8
 (define_insn "*cmpqi_ext_1"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
 	  (match_operand:QI 0 "general_operand" "qm")
01e27f8
 	  (subreg:QI
01e27f8
 	    (zero_extract:SI
01e27f8
 	      (match_operand 1 "ext_register_operand" "q")
01e27f8
 	      (const_int 8)
01e27f8
 	      (const_int 8)) 0)))]
01e27f8
-  ""
01e27f8
+  "ix86_match_ccmode (insn, CCmode)"
01e27f8
   "cmp{b}\\t{%h1, %0|%0, %h1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
@@ -1159,7 +1176,7 @@
01e27f8
    (set_attr "length_immediate" "0")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
-(define_insn "cmpqi_ext_3"
01e27f8
+(define_expand "cmpqi_ext_3"
01e27f8
   [(set (reg:CC 17)
01e27f8
 	(compare:CC
01e27f8
 	  (subreg:QI
01e27f8
@@ -1169,13 +1186,25 @@
01e27f8
 	      (const_int 8)) 0)
01e27f8
 	  (match_operand:QI 1 "general_operand" "qmn")))]
01e27f8
   ""
01e27f8
+  "")
01e27f8
+
01e27f8
+(define_insn "cmpqi_ext_3_insn"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
+	  (subreg:QI
01e27f8
+	    (zero_extract:SI
01e27f8
+	      (match_operand 0 "ext_register_operand" "q")
01e27f8
+	      (const_int 8)
01e27f8
+	      (const_int 8)) 0)
01e27f8
+	  (match_operand:QI 1 "general_operand" "qmn")))]
01e27f8
+  "ix86_match_ccmode (insn, CCmode)"
01e27f8
   "cmp{b}\\t{%1, %h0|%h0, %1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
 (define_insn "*cmpqi_ext_4"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
 	  (subreg:QI
01e27f8
 	    (zero_extract:SI
01e27f8
 	      (match_operand 0 "ext_register_operand" "q")
01e27f8
@@ -1186,7 +1215,7 @@
01e27f8
 	      (match_operand 1 "ext_register_operand" "q")
01e27f8
 	      (const_int 8)
01e27f8
 	      (const_int 8)) 0)))]
01e27f8
-  ""
01e27f8
+  "ix86_match_ccmode (insn, CCmode)"
01e27f8
   "cmp{b}\\t{%h1, %h0|%h0, %h1}"
01e27f8
   [(set_attr "type" "icmp")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
@@ -3680,20 +3709,33 @@
01e27f8
 		 (match_operand:DI 2 "general_operand" "")))
01e27f8
    (clobber (reg:CC 17))]
01e27f8
   "reload_completed"
01e27f8
-  [(parallel [(set (reg:CC 17) (plus:CC (match_dup 1) (match_dup 2)))
01e27f8
+  [(parallel [(set (reg:CC 17) (unspec:CC [(match_dup 1) (match_dup 2)] 12))
01e27f8
 	      (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
01e27f8
    (parallel [(set (match_dup 3)
01e27f8
-		   (plus:SI (match_dup 4)
01e27f8
-		   (plus:SI (match_dup 5)
01e27f8
-			    (ltu:SI (reg:CC 17) (const_int 0)))))
01e27f8
+		   (plus:SI (plus:SI (ltu:SI (reg:CC 17) (const_int 0))
01e27f8
+				     (match_dup 4))
01e27f8
+			    (match_dup 5)))
01e27f8
 	      (clobber (reg:CC 17))])]
01e27f8
   "split_di (operands+0, 1, operands+0, operands+3);
01e27f8
    split_di (operands+1, 1, operands+1, operands+4);
01e27f8
    split_di (operands+2, 1, operands+2, operands+5);")
01e27f8
 
01e27f8
+(define_insn "*addsi3_carry"
01e27f8
+  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
+	(plus:SI (plus:SI (ltu:SI (reg:CC 17) (const_int 0))
01e27f8
+			  (match_operand:SI 1 "nonimmediate_operand" "%0,0"))
01e27f8
+		 (match_operand:SI 2 "general_operand" "ri,rm")))
01e27f8
+   (clobber (reg:CC 17))]
01e27f8
+  "ix86_binary_operator_ok (PLUS, SImode, operands)"
01e27f8
+  "adc{l}\\t{%2, %0|%0, %2}"
01e27f8
+  [(set_attr "type" "alu")
01e27f8
+   (set_attr "pent_pair" "pu")
01e27f8
+   (set_attr "mode" "SI")
01e27f8
+   (set_attr "ppro_uops" "few")])
01e27f8
+
01e27f8
 (define_insn "*addsi3_cc"
01e27f8
-  [(set (reg:CC 17) (plus:CC (match_operand:SI 1 "nonimmediate_operand" "%0,0")
01e27f8
-		    (match_operand:SI 2 "general_operand" "ri,rm")))
01e27f8
+  [(set (reg:CC 17) (unspec:CC [(match_operand:SI 1 "nonimmediate_operand" "%0,0")
01e27f8
+			        (match_operand:SI 2 "general_operand" "ri,rm")] 12))
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
 	(plus:SI (match_dup 1) (match_dup 2)))]
01e27f8
   "ix86_binary_operator_ok (PLUS, SImode, operands)"
01e27f8
@@ -3702,8 +3744,8 @@
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
 (define_insn "addqi3_cc"
01e27f8
-  [(set (reg:CC 17) (plus:CC (match_operand:QI 1 "nonimmediate_operand" "%0,0")
01e27f8
-		    (match_operand:QI 2 "general_operand" "qi,qm")))
01e27f8
+  [(set (reg:CC 17) (unspec:CC [(match_operand:QI 1 "nonimmediate_operand" "%0,0")
01e27f8
+			        (match_operand:QI 2 "general_operand" "qi,qm")] 12))
01e27f8
    (set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
01e27f8
 	(plus:QI (match_dup 1) (match_dup 2)))]
01e27f8
   "ix86_binary_operator_ok (PLUS, QImode, operands)"
01e27f8
@@ -3711,19 +3753,6 @@
01e27f8
   [(set_attr "type" "alu")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
-(define_insn "*addsi3_carry"
01e27f8
-  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
-	  (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
01e27f8
-	    (plus:SI (match_operand:SI 2 "general_operand" "ri,rm")
01e27f8
-	      (ltu:SI (reg:CC 17) (const_int 0)))))
01e27f8
-   (clobber (reg:CC 17))]
01e27f8
-  "ix86_binary_operator_ok (PLUS, SImode, operands)"
01e27f8
-  "adc{l}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
-   (set_attr "pent_pair" "pu")
01e27f8
-   (set_attr "mode" "SI")
01e27f8
-   (set_attr "ppro_uops" "few")])
01e27f8
-
01e27f8
 (define_expand "addsi3"
01e27f8
   [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "")
01e27f8
 		   (plus:SI (match_operand:SI 1 "nonimmediate_operand" "")
01e27f8
@@ -3925,7 +3954,7 @@
01e27f8
 	  (const_int 0)))			
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm")
01e27f8
 	(plus:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (PLUS, SImode, operands)
01e27f8
    /* Current assemblers are broken and do not allow @GOTOFF in
01e27f8
       ought but a memory context. */
01e27f8
@@ -3971,7 +4000,7 @@
01e27f8
 	(compare (neg:SI (match_operand:SI 2 "general_operand" "rmni"))
01e27f8
 		 (match_operand:SI 1 "nonimmediate_operand" "%0")))
01e27f8
    (clobber (match_scratch:SI 0 "=r"))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCZmode)
01e27f8
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
01e27f8
    /* Current assemblers are broken and do not allow @GOTOFF in
01e27f8
       ought but a memory context. */
01e27f8
@@ -4012,31 +4041,98 @@
01e27f8
 	(const_string "alu")))
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
+; For comparisons agains 1, -1 and 128, we may generate better code
01e27f8
+; by converting cmp to add, inc or dec as done by peephole2.  This pattern
01e27f8
+; is matched then.  We can't accept general immediate, because for
01e27f8
+; case of overflows,  the result is messed up.
01e27f8
+; This pattern also don't hold of 0x80000000, since the value overflows
01e27f8
+; when negated.
01e27f8
+; Also carry flag is reversed compared to cmp, so this converison is valid
01e27f8
+; only for comparisons not depending on it.
01e27f8
 (define_insn "*addsi_4"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:SI (match_operand:SI 2 "general_operand" "rmni,rni"))
01e27f8
-		    (match_operand:SI 1 "nonimmediate_operand" "%0,0")))
01e27f8
-   (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm")
01e27f8
-	(plus:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_binary_operator_ok (PLUS, SImode, operands)
01e27f8
-   /* Current assemblers are broken and do not allow @GOTOFF in
01e27f8
-      ought but a memory context. */
01e27f8
-   && ! pic_symbolic_operand (operands[2], VOIDmode)"
01e27f8
-  "add{l}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:SI 1 "nonimmediate_operand" "0")
01e27f8
+		 (match_operand:SI 2 "const_int_operand" "n")))
01e27f8
+   (clobber (match_scratch:SI 0 "=rm"))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && (INTVAL (operands[2]) & 0xffffffff) != 0x80000000"
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (operands[2] == constm1_rtx)
01e27f8
+        return \"inc{l}\\t%0\";
01e27f8
+      else if (operands[2] == const1_rtx)
01e27f8
+        return \"dec{l}\\t%0\";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      if (! rtx_equal_p (operands[0], operands[1]))
01e27f8
+	abort ();
01e27f8
+      /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
01e27f8
+	 Exceptions: -128 encodes smaller than 128, so swap sign and op.  */
01e27f8
+      if ((INTVAL (operands[2]) == -128
01e27f8
+	   || (INTVAL (operands[2]) > 0
01e27f8
+	       && INTVAL (operands[2]) != 128)))
01e27f8
+	return \"sub{l}\\t{%2, %0|%0, %2}\";
01e27f8
+      operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+      return \"add{l}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:SI 2 "incdec_operand" "")
01e27f8
+	(const_string "incdec")
01e27f8
+	(const_string "alu")))
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
 (define_insn "*addsi_5"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:SI (match_operand:SI 2 "general_operand" "rmni"))
01e27f8
-		    (match_operand:SI 1 "nonimmediate_operand" "%0")))
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
+	  (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
01e27f8
+		   (match_operand:SI 2 "general_operand" "rmni"))
01e27f8
+	  (const_int 0)))			
01e27f8
    (clobber (match_scratch:SI 0 "=r"))]
01e27f8
-  "(GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
01e27f8
    /* Current assemblers are broken and do not allow @GOTOFF in
01e27f8
       ought but a memory context. */
01e27f8
    && ! pic_symbolic_operand (operands[2], VOIDmode)"
01e27f8
-  "add{l}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (! rtx_equal_p (operands[0], operands[1]))
01e27f8
+	abort ();
01e27f8
+      if (operands[2] == const1_rtx)
01e27f8
+        return \"inc{l}\\t%0\";
01e27f8
+      else if (operands[2] == constm1_rtx)
01e27f8
+        return \"dec{l}\\t%0\";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      if (! rtx_equal_p (operands[0], operands[1]))
01e27f8
+	abort ();
01e27f8
+      /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
01e27f8
+	 Exceptions: -128 encodes smaller than 128, so swap sign and op.  */
01e27f8
+      if (GET_CODE (operands[2]) == CONST_INT
01e27f8
+          && (INTVAL (operands[2]) == 128
01e27f8
+	      || (INTVAL (operands[2]) < 0
01e27f8
+		  && INTVAL (operands[2]) != -128)))
01e27f8
+        {
01e27f8
+          operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+          return \"sub{l}\\t{%2, %0|%0, %2}\";
01e27f8
+        }
01e27f8
+      return \"add{l}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:SI 2 "incdec_operand" "")
01e27f8
+	(const_string "incdec")
01e27f8
+	(const_string "alu")))
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
 (define_expand "addhi3"
01e27f8
@@ -4143,7 +4239,7 @@
01e27f8
 	  (const_int 0)))			
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
01e27f8
 	(plus:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (PLUS, HImode, operands)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -4183,7 +4279,7 @@
01e27f8
 	(compare (neg:HI (match_operand:HI 2 "general_operand" "rmni"))
01e27f8
 		 (match_operand:HI 1 "nonimmediate_operand" "%0")))
01e27f8
    (clobber (match_scratch:HI 0 "=r"))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCZmode)
01e27f8
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -4218,25 +4314,88 @@
01e27f8
 	(const_string "alu")))
01e27f8
    (set_attr "mode" "HI")])
01e27f8
 
01e27f8
+; See comments above addsi_3_imm for details.
01e27f8
 (define_insn "*addhi_4"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:HI (match_operand:HI 2 "general_operand" "rmni,rni"))
01e27f8
-		    (match_operand:HI 1 "nonimmediate_operand" "%0,0")))
01e27f8
-   (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
01e27f8
-	(plus:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_binary_operator_ok (PLUS, HImode, operands)"
01e27f8
-  "add{w}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
-   (set_attr "mode" "HI")])
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:HI 1 "nonimmediate_operand" "0")
01e27f8
+		 (match_operand:HI 2 "const_int_operand" "n")))
01e27f8
+   (clobber (match_scratch:HI 0 "=rm"))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && (INTVAL (operands[2]) & 0xffff) != 0x8000"
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (operands[2] == constm1_rtx
01e27f8
+	  || (GET_CODE (operands[2]) == CONST_INT
01e27f8
+	      && INTVAL (operands[2]) == 65535))
01e27f8
+        return \"inc{w}\\t%0\";
01e27f8
+      else if (operands[2] == const1_rtx)
01e27f8
+        return \"dec{w}\\t%0\";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      if (! rtx_equal_p (operands[0], operands[1]))
01e27f8
+	abort ();
01e27f8
+      /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
01e27f8
+	 Exceptions: -128 encodes smaller than 128, so swap sign and op.  */
01e27f8
+      if ((INTVAL (operands[2]) == -128
01e27f8
+	   || (INTVAL (operands[2]) > 0
01e27f8
+	       && INTVAL (operands[2]) != 128)))
01e27f8
+	return \"sub{w}\\t{%2, %0|%0, %2}\";
01e27f8
+      operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+      return \"add{w}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:HI 2 "incdec_operand" "")
01e27f8
+	(const_string "incdec")
01e27f8
+	(const_string "alu")))
01e27f8
+   (set_attr "mode" "SI")])
01e27f8
+
01e27f8
 
01e27f8
 (define_insn "*addhi_5"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:HI (match_operand:HI 2 "general_operand" "rmni"))
01e27f8
-		    (match_operand:HI 1 "nonimmediate_operand" "%0")))
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
+	  (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0")
01e27f8
+		   (match_operand:HI 2 "general_operand" "rmni"))
01e27f8
+	  (const_int 0)))			
01e27f8
    (clobber (match_scratch:HI 0 "=r"))]
01e27f8
-  "(GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
-  "add{w}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (operands[2] == const1_rtx)
01e27f8
+	return \"inc{w}\\t%0\";
01e27f8
+      else if (operands[2] == constm1_rtx
01e27f8
+	       || (GET_CODE (operands[2]) == CONST_INT
01e27f8
+		   && INTVAL (operands[2]) == 65535))
01e27f8
+	return \"dec{w}\\t%0\";
01e27f8
+      abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'.
01e27f8
+	 Exceptions: -128 encodes smaller than 128, so swap sign and op.  */
01e27f8
+      if (GET_CODE (operands[2]) == CONST_INT
01e27f8
+          && (INTVAL (operands[2]) == 128
01e27f8
+	      || (INTVAL (operands[2]) < 0
01e27f8
+		  && INTVAL (operands[2]) != -128)))
01e27f8
+	{
01e27f8
+	  operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+	  return \"sub{w}\\t{%2, %0|%0, %2}\";
01e27f8
+	}
01e27f8
+      return \"add{w}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:HI 2 "incdec_operand" "")
01e27f8
+	(const_string "incdec")
01e27f8
+	(const_string "alu")))
01e27f8
    (set_attr "mode" "HI")])
01e27f8
 
01e27f8
 (define_expand "addqi3"
01e27f8
@@ -4354,7 +4513,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:QI 0 "nonimmediate_operand" "=q,qm")
01e27f8
 	(plus:QI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (PLUS, QImode, operands)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -4390,8 +4549,8 @@
01e27f8
   [(set (reg 17)
01e27f8
 	(compare (neg:QI (match_operand:QI 2 "general_operand" "qmni"))
01e27f8
 		 (match_operand:QI 1 "nonimmediate_operand" "%0")))
01e27f8
-   (clobber (match_scratch:QI 0 "=r"))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+   (clobber (match_scratch:QI 0 "=q"))]
01e27f8
+  "ix86_match_ccmode (insn, CCZmode)
01e27f8
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -4423,25 +4582,82 @@
01e27f8
 	(const_string "alu")))
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
+; See comments above addsi_3_imm for details.
01e27f8
 (define_insn "*addqi_4"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:QI (match_operand:QI 2 "general_operand" "qmni,qni"))
01e27f8
-		    (match_operand:QI 1 "nonimmediate_operand" "%0,0")))
01e27f8
-   (set (match_operand:QI 0 "nonimmediate_operand" "=q,qm")
01e27f8
-	(plus:QI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_binary_operator_ok (PLUS, QImode, operands)"
01e27f8
-  "add{b}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
+  [(set (reg 17)
01e27f8
+        (compare (match_operand:QI 1 "nonimmediate_operand" "0")
01e27f8
+		 (match_operand:QI 2 "const_int_operand" "n")))
01e27f8
+   (clobber (match_scratch:QI 0 "=qm"))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && (INTVAL (operands[2]) & 0xff) != 0x80"
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (operands[2] == constm1_rtx
01e27f8
+	  || (GET_CODE (operands[2]) == CONST_INT
01e27f8
+	      && INTVAL (operands[2]) == 255))
01e27f8
+	return \"inc{b}\\t%0\";
01e27f8
+      else if (operands[2] == const1_rtx)
01e27f8
+	return \"dec{b}\\t%0\";
01e27f8
+      else
01e27f8
+	abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      if (! rtx_equal_p (operands[0], operands[1]))
01e27f8
+	abort ();
01e27f8
+      if (INTVAL (operands[2]) < 0)
01e27f8
+	{
01e27f8
+	  operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+	  return \"add{b}\\t{%2, %0|%0, %2}\";
01e27f8
+	}
01e27f8
+      return \"sub{b}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:HI 2 "incdec_operand" "")
01e27f8
+       (const_string "incdec")
01e27f8
+       (const_string "alu")))
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
 (define_insn "*addqi_5"
01e27f8
-  [(set (reg:CC 17)
01e27f8
-	(compare:CC (neg:QI (match_operand:QI 2 "general_operand" "qmni"))
01e27f8
-		    (match_operand:QI 1 "nonimmediate_operand" "%0")))
01e27f8
-   (clobber (match_scratch:QI 0 "=r"))]
01e27f8
-  "(GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
-  "add{b}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
+	  (plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
01e27f8
+		   (match_operand:QI 2 "general_operand" "qmni"))
01e27f8
+	  (const_int 0)))
01e27f8
+   (clobber (match_scratch:QI 0 "=q"))]
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
+  "*
01e27f8
+{
01e27f8
+  switch (get_attr_type (insn))
01e27f8
+    {
01e27f8
+    case TYPE_INCDEC:
01e27f8
+      if (operands[2] == const1_rtx)
01e27f8
+	return \"inc{b}\\t%0\";
01e27f8
+      else if (operands[2] == constm1_rtx
01e27f8
+	       || (GET_CODE (operands[2]) == CONST_INT
01e27f8
+		   && INTVAL (operands[2]) == 255))
01e27f8
+	return \"dec{b}\\t%0\";
01e27f8
+      abort();
01e27f8
+
01e27f8
+    default:
01e27f8
+      /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'.  */
01e27f8
+      if (GET_CODE (operands[2]) == CONST_INT
01e27f8
+          && INTVAL (operands[2]) < 0)
01e27f8
+	{
01e27f8
+	  operands[2] = GEN_INT (-INTVAL (operands[2]));
01e27f8
+	  return \"sub{b}\\t{%2, %0|%0, %2}\";
01e27f8
+	}
01e27f8
+      return \"add{b}\\t{%2, %0|%0, %2}\";
01e27f8
+    }
01e27f8
+}"
01e27f8
+  [(set (attr "type")
01e27f8
+     (if_then_else (match_operand:QI 2 "incdec_operand" "")
01e27f8
+	(const_string "incdec")
01e27f8
+	(const_string "alu")))
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
 
01e27f8
@@ -4541,32 +4757,22 @@
01e27f8
 		  (match_operand:DI 2 "general_operand" "")))
01e27f8
    (clobber (reg:CC 17))]
01e27f8
   "reload_completed"
01e27f8
-  [(parallel [(set (reg:CC 17) (minus:CC (match_dup 1) (match_dup 2)))
01e27f8
+  [(parallel [(set (reg:CC 17) (compare:CC (match_dup 1) (match_dup 2)))
01e27f8
 	      (set (match_dup 0) (minus:SI (match_dup 1) (match_dup 2)))])
01e27f8
    (parallel [(set (match_dup 3)
01e27f8
 		   (minus:SI (match_dup 4)
01e27f8
-			     (plus:SI (match_dup 5)
01e27f8
-			     (ltu:SI (reg:CC 17) (const_int 0)))))
01e27f8
+			     (plus:SI (ltu:SI (reg:CC 17) (const_int 0))
01e27f8
+				      (match_dup 5))))
01e27f8
 	      (clobber (reg:CC 17))])]
01e27f8
   "split_di (operands+0, 1, operands+0, operands+3);
01e27f8
    split_di (operands+1, 1, operands+1, operands+4);
01e27f8
    split_di (operands+2, 1, operands+2, operands+5);")
01e27f8
 
01e27f8
-(define_insn "*subsi3_cc"
01e27f8
-  [(set (reg:CC 17) (minus:CC (match_operand:SI 1 "nonimmediate_operand" "0,0")
01e27f8
-			      (match_operand:SI 2 "general_operand" "ri,rm")))
01e27f8
-   (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
-	(minus:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_binary_operator_ok (MINUS, SImode, operands)"
01e27f8
-  "sub{l}\\t{%2, %0|%0, %2}"
01e27f8
-  [(set_attr "type" "alu")
01e27f8
-   (set_attr "mode" "SI")])
01e27f8
-
01e27f8
 (define_insn "subsi3_carry"
01e27f8
   [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
 	  (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
01e27f8
-	    (plus:SI (match_operand:SI 2 "general_operand" "ri,rm")
01e27f8
-	      (ltu:SI (reg:CC 17) (const_int 0)))))
01e27f8
+		    (plus:SI (ltu:SI (reg:CC 17) (const_int 0))
01e27f8
+			     (match_operand:SI 2 "general_operand" "ri,rm"))))
01e27f8
    (clobber (reg:CC 17))]
01e27f8
   "ix86_binary_operator_ok (MINUS, SImode, operands)"
01e27f8
   "sbb{l}\\t{%2, %0|%0, %2}"
01e27f8
@@ -4601,7 +4807,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=rm,r")
01e27f8
 	(minus:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (MINUS, SImode, operands)"
01e27f8
   "sub{l}\\t{%2, %0|%0, %2}"
01e27f8
   [(set_attr "type" "alu")
01e27f8
@@ -4645,7 +4851,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
01e27f8
 	(minus:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (MINUS, HImode, operands)"
01e27f8
   "sub{w}\\t{%2, %0|%0, %2}"
01e27f8
   [(set_attr "type" "alu")
01e27f8
@@ -4689,7 +4895,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=qm,q")
01e27f8
 	(minus:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (MINUS, QImode, operands)"
01e27f8
   "sub{b}\\t{%2, %0|%0, %2}"
01e27f8
   [(set_attr "type" "alu")
01e27f8
@@ -5145,31 +5351,28 @@
01e27f8
 ;; On Pentium, "test imm, reg" is pairable only with eax, ax, and al.
01e27f8
 ;; Note that this excludes ah.
01e27f8
 
01e27f8
-(define_insn "*testsi_ccz_1"
01e27f8
-  [(set (reg:CCZ 17)
01e27f8
-	(compare:CCZ
01e27f8
+
01e27f8
+(define_insn "testsi_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
 	  (and:SI (match_operand:SI 0 "nonimmediate_operand" "%*a,r,rm")
01e27f8
 		  (match_operand:SI 1 "nonmemory_operand" "in,in,rin"))
01e27f8
 	  (const_int 0)))]
01e27f8
-  ""
01e27f8
+  "ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "test{l}\\t{%1, %0|%0, %1}"
01e27f8
   [(set_attr "type" "test")
01e27f8
    (set_attr "modrm" "0,1,1")
01e27f8
    (set_attr "mode" "SI")
01e27f8
    (set_attr "pent_pair" "uv,np,uv")])
01e27f8
 
01e27f8
-(define_insn "testsi_ccno_1"
01e27f8
+(define_expand "testsi_ccno_1"
01e27f8
   [(set (reg:CCNO 17)
01e27f8
 	(compare:CCNO
01e27f8
-	  (and:SI (match_operand:SI 0 "nonimmediate_operand" "%*a,r,rm")
01e27f8
-		  (match_operand:SI 1 "nonmemory_operand" "in,in,rin"))
01e27f8
+	  (and:SI (match_operand:SI 0 "nonimmediate_operand" "")
01e27f8
+		  (match_operand:SI 1 "nonmemory_operand" ""))
01e27f8
 	  (const_int 0)))]
01e27f8
   ""
01e27f8
-  "test{l}\\t{%1, %0|%0, %1}"
01e27f8
-  [(set_attr "type" "test")
01e27f8
-   (set_attr "modrm" "0,1,1")
01e27f8
-   (set_attr "mode" "SI")
01e27f8
-   (set_attr "pent_pair" "uv,np,uv")])
01e27f8
+  "")
01e27f8
 
01e27f8
 (define_insn "*testhi_1"
01e27f8
   [(set (reg 17)
01e27f8
@@ -5183,55 +5386,46 @@
01e27f8
    (set_attr "mode" "HI")
01e27f8
    (set_attr "pent_pair" "uv,np,uv")])
01e27f8
 
01e27f8
-(define_insn "testqi_ccz_1"
01e27f8
+(define_expand "testqi_ccz_1"
01e27f8
   [(set (reg:CCZ 17)
01e27f8
-        (compare:CCZ
01e27f8
-	  (and:QI (match_operand:QI 0 "nonimmediate_operand" "%*a,q,qm")
01e27f8
-		  (match_operand:QI 1 "nonmemory_operand" "n,n,qn"))
01e27f8
-	  (const_int 0)))]
01e27f8
+        (compare:CCZ (and:QI (match_operand:QI 0 "nonimmediate_operand" "")
01e27f8
+			     (match_operand:QI 1 "nonmemory_operand" ""))
01e27f8
+		     (const_int 0)))]
01e27f8
   ""
01e27f8
-  "test{b}\\t{%1, %0|%0, %1}"
01e27f8
-  [(set_attr "type" "test")
01e27f8
-   (set_attr "modrm" "0,1,1")
01e27f8
-   (set_attr "mode" "QI")
01e27f8
-   (set_attr "pent_pair" "uv,np,uv")])
01e27f8
+  "")
01e27f8
 
01e27f8
-(define_insn "testqi_ccno_1"
01e27f8
-  [(set (reg:CCNO 17)
01e27f8
-        (compare:CCNO (and:QI (match_operand:QI 0 "nonimmediate_operand" "%*a,q,qm,r")
01e27f8
-			      (match_operand:QI 1 "nonmemory_operand" "n,n,qn,n"))
01e27f8
-		      (const_int 0)))]
01e27f8
-  ""
01e27f8
+(define_insn "*testqi_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (and:QI (match_operand:QI 0 "nonimmediate_operand" "%*a,q,qm,r")
01e27f8
+			 (match_operand:QI 1 "nonmemory_operand" "n,n,qn,n"))
01e27f8
+		 (const_int 0)))]
01e27f8
+  "ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "@
01e27f8
    test{b}\\t{%1, %0|%0, %1} 
01e27f8
    test{b}\\t{%1, %0|%0, %1} 
01e27f8
    test{b}\\t{%1, %0|%0, %1} 
01e27f8
-   test{l}\\t{%1, %0|%0, %1}"
01e27f8
+   test{l}\\t{%1, %k0|%k0, %1}"
01e27f8
   [(set_attr "type" "test")
01e27f8
    (set_attr "modrm" "0,1,1,1")
01e27f8
    (set_attr "mode" "QI,QI,QI,SI")
01e27f8
    (set_attr "pent_pair" "uv,np,uv,np")])
01e27f8
 
01e27f8
-(define_insn "*testqi_ext_ccz_0"
01e27f8
-  [(set (reg:CCZ 17)
01e27f8
-	(compare:CCZ
01e27f8
+(define_expand "testqi_ext_ccno_0"
01e27f8
+  [(set (reg:CCNO 17)
01e27f8
+	(compare:CCNO
01e27f8
 	  (and:SI
01e27f8
 	    (zero_extract:SI
01e27f8
-	      (match_operand 0 "ext_register_operand" "q")
01e27f8
+	      (match_operand 0 "ext_register_operand" "")
01e27f8
 	      (const_int 8)
01e27f8
 	      (const_int 8))
01e27f8
-	    (match_operand 1 "const_int_operand" "n"))
01e27f8
+	    (match_operand 1 "const_int_operand" ""))
01e27f8
 	  (const_int 0)))]
01e27f8
-  "(unsigned HOST_WIDE_INT) INTVAL (operands[1]) <= 0xff"
01e27f8
-  "test{b}\\t{%1, %h0|%h0, %1}"
01e27f8
-  [(set_attr "type" "test")
01e27f8
-   (set_attr "mode" "QI")
01e27f8
-   (set_attr "length_immediate" "1")
01e27f8
-   (set_attr "pent_pair" "np")])
01e27f8
+  ""
01e27f8
+  "")
01e27f8
 
01e27f8
-(define_insn "testqi_ext_ccno_0"
01e27f8
-  [(set (reg:CCNO 17)
01e27f8
-	(compare:CCNO
01e27f8
+(define_insn "*testqi_ext_0"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
 	  (and:SI
01e27f8
 	    (zero_extract:SI
01e27f8
 	      (match_operand 0 "ext_register_operand" "q")
01e27f8
@@ -5239,7 +5433,8 @@
01e27f8
 	      (const_int 8))
01e27f8
 	    (match_operand 1 "const_int_operand" "n"))
01e27f8
 	  (const_int 0)))]
01e27f8
-  "(unsigned HOST_WIDE_INT) INTVAL (operands[1]) <= 0xff"
01e27f8
+  "(unsigned HOST_WIDE_INT) INTVAL (operands[1]) <= 0xff
01e27f8
+   && ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "test{b}\\t{%1, %h0|%h0, %1}"
01e27f8
   [(set_attr "type" "test")
01e27f8
    (set_attr "mode" "QI")
01e27f8
@@ -5745,7 +5940,7 @@
01e27f8
 	(compare (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
01e27f8
 			 (match_operand:QI 2 "general_operand" "qim"))
01e27f8
 		 (const_int 0)))
01e27f8
-   (clobber (match_scratch:QI 0 "=r"))]
01e27f8
+   (clobber (match_scratch:QI 0 "=q"))]
01e27f8
   "ix86_match_ccmode (insn, CCNOmode)
01e27f8
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
   "or{b}\\t{%2, %0|%0, %2}"
01e27f8
@@ -5904,16 +6099,16 @@
01e27f8
 	  (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
01e27f8
 		  (match_operand:QI 2 "general_operand" "qim"))
01e27f8
 	  (const_int 0)))
01e27f8
-   (clobber (match_scratch:QI 0 "=r"))]
01e27f8
+   (clobber (match_scratch:QI 0 "=q"))]
01e27f8
   "ix86_match_ccmode (insn, CCNOmode)
01e27f8
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
01e27f8
   "xor{b}\\t{%2, %0|%0, %2}"
01e27f8
   [(set_attr "type" "alu")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
 
01e27f8
-(define_insn "xorqi_cc_ext_1"
01e27f8
-  [(set (reg:CCNO 17)
01e27f8
-	(compare:CCNO
01e27f8
+(define_insn "*xorqi_cc_ext_1"
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare
01e27f8
 	  (xor:SI
01e27f8
 	    (zero_extract:SI
01e27f8
 	      (match_operand 1 "ext_register_operand" "0")
01e27f8
@@ -5927,10 +6122,30 @@
01e27f8
 	(xor:SI 
01e27f8
 	  (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8))
01e27f8
 	  (match_dup 2)))]
01e27f8
-  ""
01e27f8
+  "ix86_match_ccmode (insn, CCNOmode)"
01e27f8
   "xor{b}\\t{%2, %h0|%h0, %2}"
01e27f8
   [(set_attr "type" "alu")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
+
01e27f8
+(define_expand "xorqi_cc_ext_1"
01e27f8
+  [(parallel [
01e27f8
+     (set (reg:CCNO 17)
01e27f8
+	  (compare:CCNO
01e27f8
+	    (xor:SI
01e27f8
+	      (zero_extract:SI
01e27f8
+		(match_operand 1 "ext_register_operand" "")
01e27f8
+		(const_int 8)
01e27f8
+		(const_int 8))
01e27f8
+	      (match_operand:QI 2 "general_operand" ""))
01e27f8
+	    (const_int 0)))
01e27f8
+     (set (zero_extract:SI (match_operand 0 "ext_register_operand" "")
01e27f8
+			   (const_int 8)
01e27f8
+			   (const_int 8))
01e27f8
+	  (xor:SI 
01e27f8
+	    (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8))
01e27f8
+	    (match_dup 2)))])]
01e27f8
+  ""
01e27f8
+  "")
01e27f8
 
01e27f8
 ;; Negation instructions
01e27f8
 
01e27f8
@@ -5961,9 +6176,9 @@
01e27f8
      (set (match_dup 0) (neg:SI (match_dup 2)))])
01e27f8
    (parallel
01e27f8
     [(set (match_dup 1)
01e27f8
-	  (plus:SI (match_dup 3)
01e27f8
-	    (plus:SI (const_int 0)
01e27f8
-	      (ltu:SI (reg:CC 17) (const_int 0)))))
01e27f8
+	  (plus:SI (plus:SI (ltu:SI (reg:CC 17) (const_int 0))
01e27f8
+			    (match_dup 3))
01e27f8
+		   (const_int 0)))
01e27f8
      (clobber (reg:CC 17))])
01e27f8
    (parallel
01e27f8
     [(set (match_dup 1)
01e27f8
@@ -6780,7 +6995,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(ashift:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (ASHIFT, SImode, operands)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -6909,7 +7124,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(ashift:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (ASHIFT, HImode, operands)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -7076,7 +7291,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
01e27f8
 	(ashift:QI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (ASHIFT, QImode, operands)"
01e27f8
   "*
01e27f8
 {
01e27f8
@@ -7546,7 +7761,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(lshiftrt:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && (TARGET_PENTIUM || TARGET_PENTIUMPRO)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
01e27f8
   "shr{l}\\t%0"
01e27f8
@@ -7567,7 +7782,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:SI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(lshiftrt:SI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
01e27f8
   "@
01e27f8
    shr{l}\\t{%2, %0|%0, %2}"
01e27f8
@@ -7619,7 +7834,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(lshiftrt:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && (TARGET_PENTIUM || TARGET_PENTIUMPRO)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
01e27f8
   "shr{w}\\t%0"
01e27f8
@@ -7640,7 +7855,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:HI 0 "nonimmediate_operand" "=rm")
01e27f8
 	(lshiftrt:HI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
01e27f8
   "@
01e27f8
    shr{w}\\t{%2, %0|%0, %2}"
01e27f8
@@ -7692,7 +7907,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
01e27f8
 	(lshiftrt:QI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && (TARGET_PENTIUM || TARGET_PENTIUMPRO)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
01e27f8
   "shr{b}\\t%0"
01e27f8
@@ -7713,7 +7928,7 @@
01e27f8
 	  (const_int 0)))
01e27f8
    (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
01e27f8
 	(lshiftrt:QI (match_dup 1) (match_dup 2)))]
01e27f8
-  "ix86_match_ccmode (insn, CCNOmode)
01e27f8
+  "ix86_match_ccmode (insn, CCGOCmode)
01e27f8
    && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
01e27f8
   "shr{b}\\t{%2, %0|%0, %2}"
01e27f8
   [(set_attr "type" "ishift")
01e27f8
@@ -8102,7 +8317,7 @@
01e27f8
 
01e27f8
 (define_insn "*setcc_1"
01e27f8
   [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
01e27f8
-	(match_operator:QI 1 "no_comparison_operator"
01e27f8
+	(match_operator:QI 1 "ix86_comparison_operator"
01e27f8
 	  [(reg 17) (const_int 0)]))]
01e27f8
   ""
01e27f8
   "set%C1\\t%0"
01e27f8
@@ -8111,30 +8326,12 @@
01e27f8
 
01e27f8
 (define_insn "*setcc_2"
01e27f8
   [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm"))
01e27f8
-	(match_operator:QI 1 "no_comparison_operator"
01e27f8
+	(match_operator:QI 1 "ix86_comparison_operator"
01e27f8
 	  [(reg 17) (const_int 0)]))]
01e27f8
   ""
01e27f8
   "set%C1\\t%0"
01e27f8
   [(set_attr "type" "setcc")
01e27f8
    (set_attr "mode" "QI")])
01e27f8
-
01e27f8
-(define_insn "*setcc_3"
01e27f8
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
01e27f8
-	(match_operator:QI 1 "uno_comparison_operator"
01e27f8
-	  [(reg:CC 17) (const_int 0)]))]
01e27f8
-  ""
01e27f8
-  "set%C1\\t%0"
01e27f8
-  [(set_attr "type" "setcc")
01e27f8
-   (set_attr "mode" "QI")])
01e27f8
-
01e27f8
-(define_insn "*setcc_4"
01e27f8
-  [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm"))
01e27f8
-	(match_operator:QI 1 "uno_comparison_operator"
01e27f8
-	  [(reg:CC 17) (const_int 0)]))]
01e27f8
-  ""
01e27f8
-  "set%C1\\t%0"
01e27f8
-  [(set_attr "type" "setcc")
01e27f8
-   (set_attr "mode" "QI")])
01e27f8
 
01e27f8
 ;; Basic conditional jump instructions.
01e27f8
 ;; We ignore the overflow flag for signed branch instructions.
01e27f8
@@ -8288,7 +8485,7 @@
01e27f8
 
01e27f8
 (define_insn "*jcc_1"
01e27f8
   [(set (pc)
01e27f8
-	(if_then_else (match_operator 1 "no_comparison_operator"
01e27f8
+	(if_then_else (match_operator 1 "ix86_comparison_operator"
01e27f8
 				      [(reg 17) (const_int 0)])
01e27f8
 		      (label_ref (match_operand 0 "" ""))
01e27f8
 		      (pc)))]
01e27f8
@@ -8305,7 +8502,7 @@
01e27f8
 
01e27f8
 (define_insn "*jcc_2"
01e27f8
   [(set (pc)
01e27f8
-	(if_then_else (match_operator 1 "no_comparison_operator"
01e27f8
+	(if_then_else (match_operator 1 "ix86_comparison_operator"
01e27f8
 				      [(reg 17) (const_int 0)])
01e27f8
 		      (pc)
01e27f8
 		      (label_ref (match_operand 0 "" ""))))]
01e27f8
@@ -8320,40 +8517,6 @@
01e27f8
 	     (const_int 0)
01e27f8
 	     (const_int 1)))])
01e27f8
 
01e27f8
-(define_insn "*jcc_3"
01e27f8
-  [(set (pc)
01e27f8
-	(if_then_else (match_operator 1 "uno_comparison_operator"
01e27f8
-				      [(reg:CC 17) (const_int 0)])
01e27f8
-		      (label_ref (match_operand 0 "" ""))
01e27f8
-		      (pc)))]
01e27f8
-  ""
01e27f8
-  "j%C1\\t%l0"
01e27f8
-  [(set_attr "type" "ibr")
01e27f8
-   (set (attr "prefix_0f")
01e27f8
-	   (if_then_else (and (ge (minus (match_dup 0) (pc))
01e27f8
-				  (const_int -128))
01e27f8
-			      (lt (minus (match_dup 0) (pc))
01e27f8
-				  (const_int 124)))
01e27f8
-	     (const_int 0)
01e27f8
-	     (const_int 1)))])
01e27f8
-
01e27f8
-(define_insn "*jcc_4"
01e27f8
-  [(set (pc)
01e27f8
-	(if_then_else (match_operator 1 "uno_comparison_operator"
01e27f8
-				      [(reg:CC 17) (const_int 0)])
01e27f8
-		      (pc)
01e27f8
-		      (label_ref (match_operand 0 "" ""))))]
01e27f8
-  ""
01e27f8
-  "j%c1\\t%l0"
01e27f8
-  [(set_attr "type" "ibr")
01e27f8
-   (set (attr "prefix_0f")
01e27f8
-	   (if_then_else (and (ge (minus (match_dup 0) (pc))
01e27f8
-				  (const_int -128))
01e27f8
-			      (lt (minus (match_dup 0) (pc))
01e27f8
-				  (const_int 124)))
01e27f8
-	     (const_int 0)
01e27f8
-	     (const_int 1)))])
01e27f8
-
01e27f8
 ;; Define combination compare-and-branch fp compare instructions to use
01e27f8
 ;; during early optimization.  Splitting the operation apart early makes
01e27f8
 ;; for bad code when we want to reverse the operation.
01e27f8
@@ -10436,7 +10599,7 @@
01e27f8
 
01e27f8
 (define_insn "*movsicc_noc"
01e27f8
   [(set (match_operand:SI 0 "register_operand" "=r,r")
01e27f8
-	(if_then_else:SI (match_operator 1 "no_comparison_operator" 
01e27f8
+	(if_then_else:SI (match_operator 1 "ix86_comparison_operator" 
01e27f8
 				[(reg 17) (const_int 0)])
01e27f8
 		      (match_operand:SI 2 "nonimmediate_operand" "rm,0")
01e27f8
 		      (match_operand:SI 3 "nonimmediate_operand" "0,rm")))]
01e27f8
@@ -10448,20 +10611,6 @@
01e27f8
   [(set_attr "type" "icmov")
01e27f8
    (set_attr "mode" "SI")])
01e27f8
 
01e27f8
-(define_insn "*movsicc_c"
01e27f8
-  [(set (match_operand:SI 0 "register_operand" "=r,r")
01e27f8
-	(if_then_else:SI (match_operator 1 "uno_comparison_operator" 
01e27f8
-				[(reg:CC 17) (const_int 0)])
01e27f8
-		      (match_operand:SI 2 "nonimmediate_operand" "rm,0")
01e27f8
-		      (match_operand:SI 3 "nonimmediate_operand" "0,rm")))]
01e27f8
-  "TARGET_CMOVE
01e27f8
-   && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
01e27f8
-  "@
01e27f8
-   cmov%C1\\t{%2, %0|%0, %2}
01e27f8
-   cmov%c1\\t{%3, %0|%0, %3}"
01e27f8
-  [(set_attr "type" "icmov")
01e27f8
-   (set_attr "mode" "SI")])
01e27f8
-
01e27f8
 (define_expand "movhicc"
01e27f8
   [(set (match_operand:HI 0 "register_operand" "")
01e27f8
 	(if_then_else:HI (match_operand 1 "comparison_operator" "")
01e27f8
@@ -10472,7 +10621,7 @@
01e27f8
 
01e27f8
 (define_insn "*movhicc_noc"
01e27f8
   [(set (match_operand:HI 0 "register_operand" "=r,r")
01e27f8
-	(if_then_else:HI (match_operator 1 "no_comparison_operator" 
01e27f8
+	(if_then_else:HI (match_operator 1 "ix86_comparison_operator" 
01e27f8
 				[(reg 17) (const_int 0)])
01e27f8
 		      (match_operand:HI 2 "nonimmediate_operand" "rm,0")
01e27f8
 		      (match_operand:HI 3 "nonimmediate_operand" "0,rm")))]
01e27f8
@@ -10484,20 +10633,6 @@
01e27f8
   [(set_attr "type" "icmov")
01e27f8
    (set_attr "mode" "HI")])
01e27f8
 
01e27f8
-(define_insn "*movhicc_c"
01e27f8
-  [(set (match_operand:HI 0 "register_operand" "=r,r")
01e27f8
-	(if_then_else:HI (match_operator 1 "uno_comparison_operator" 
01e27f8
-				[(reg:CC 17) (const_int 0)])
01e27f8
-		      (match_operand:HI 2 "nonimmediate_operand" "rm,0")
01e27f8
-		      (match_operand:HI 3 "nonimmediate_operand" "0,rm")))]
01e27f8
-  "TARGET_CMOVE
01e27f8
-   && (GET_CODE (operands[2]) != MEM || GET_CODE (operands[3]) != MEM)"
01e27f8
-  "@
01e27f8
-   cmov%C1\\t{%2, %0|%0, %2}
01e27f8
-   cmov%c1\\t{%3, %0|%0, %3}"
01e27f8
-  [(set_attr "type" "icmov")
01e27f8
-   (set_attr "mode" "HI")])
01e27f8
-
01e27f8
 (define_expand "movsfcc"
01e27f8
   [(set (match_operand:SF 0 "register_operand" "")
01e27f8
 	(if_then_else:SF (match_operand 1 "comparison_operator" "")
01e27f8
@@ -11290,6 +11425,68 @@
01e27f8
 	      (set (reg:SI 7) (plus:SI (reg:SI 7) (const_int 4)))])]
01e27f8
   "")
01e27f8
 
01e27f8
+;; Convert compares with 1 to shorter inc/dec operations when CF is not
01e27f8
+;; required and register dies.
01e27f8
+(define_peephole2
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:SI 0 "register_operand" "")
01e27f8
+		 (match_operand:SI 1 "incdec_operand" "")))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
01e27f8
+  [(parallel [(set (reg:CCGC 17)
01e27f8
+		   (compare:CCGC (match_dup 0)
01e27f8
+				 (match_dup 1)))
01e27f8
+	      (clobber (match_dup 0))])]
01e27f8
+  "")
01e27f8
+
01e27f8
+(define_peephole2
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:HI 0 "register_operand" "")
01e27f8
+		 (match_operand:HI 1 "incdec_operand" "")))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
01e27f8
+  [(parallel [(set (reg:CCGC 17)
01e27f8
+		   (compare:CCGC (match_dup 0)
01e27f8
+				 (match_dup 1)))
01e27f8
+	      (clobber (match_dup 0))])]
01e27f8
+  "")
01e27f8
+
01e27f8
+(define_peephole2
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:QI 0 "register_operand" "")
01e27f8
+		 (match_operand:QI 1 "incdec_operand" "")))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
01e27f8
+  [(parallel [(set (reg:CCGC 17)
01e27f8
+		   (compare:CCGC (match_dup 0)
01e27f8
+				 (match_dup 1)))
01e27f8
+	      (clobber (match_dup 0))])]
01e27f8
+  "")
01e27f8
+
01e27f8
+;; Convert compares with 128 to shorter add -128
01e27f8
+(define_peephole2
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:SI 0 "register_operand" "")
01e27f8
+		 (const_int 128)))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
01e27f8
+  [(parallel [(set (reg:CCGC 17)
01e27f8
+		   (compare:CCGC (match_dup 0)
01e27f8
+			         (const_int 128)))
01e27f8
+	      (clobber (match_dup 0))])]
01e27f8
+  "")
01e27f8
+
01e27f8
+(define_peephole2
01e27f8
+  [(set (reg 17)
01e27f8
+	(compare (match_operand:HI 0 "register_operand" "")
01e27f8
+		 (const_int 128)))]
01e27f8
+  "ix86_match_ccmode (insn, CCGCmode)
01e27f8
+   && find_regno_note (insn, REG_DEAD, true_regnum (operands[0]))"
01e27f8
+  [(parallel [(set (reg:CCGC 17)
01e27f8
+		   (compare:CCGC (match_dup 0)
01e27f8
+			         (const_int 128)))
01e27f8
+	      (clobber (match_dup 0))])]
01e27f8
+  "")
01e27f8
 ;; Call-value patterns last so that the wildcard operand does not
01e27f8
 ;; disrupt insn-recog's switch tables.
01e27f8
 
01e27f8
--- gcc/config/i386/i386-protos.h	Sun Jul  2 10:37:12 2000
01e27f8
+++ gcc/config/i386/i386-protos.h	Wed Oct 18 13:27:27 2000
01e27f8
@@ -57,7 +57,7 @@ extern int q_regs_operand PARAMS ((rtx, 
01e27f8
 extern int non_q_regs_operand PARAMS ((rtx, enum machine_mode));
01e27f8
 extern int no_comparison_operator PARAMS ((rtx, enum machine_mode));
01e27f8
 extern int fcmov_comparison_operator PARAMS ((rtx, enum machine_mode));
01e27f8
-extern int uno_comparison_operator PARAMS ((rtx, enum machine_mode));
01e27f8
+extern int ix86_comparison_operator PARAMS ((rtx, enum machine_mode));
01e27f8
 extern int cmp_fp_expander_operand PARAMS ((rtx, enum machine_mode));
01e27f8
 extern int ext_register_operand PARAMS ((rtx, enum machine_mode));
01e27f8
 extern int binary_fp_operator PARAMS ((rtx, enum machine_mode));
01e27f8
@@ -121,6 +121,7 @@ extern int ix86_adjust_cost PARAMS ((rtx
01e27f8
 extern void ix86_sched_init PARAMS ((FILE *, int));
01e27f8
 extern int ix86_sched_reorder PARAMS ((FILE *, int, rtx *, int, int));
01e27f8
 extern int ix86_variable_issue PARAMS ((FILE *, int, rtx, int));
01e27f8
+extern enum machine_mode ix86_cc_mode PARAMS ((enum rtx_code, rtx, rtx));
01e27f8
 
01e27f8
 #ifdef TREE_CODE
01e27f8
 extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx));