[PATCH] Speedup by 3.5% by overhauling rtx classes

Bonzini bonzini@gnu.org
Sat Feb 7 13:46:00 GMT 2004


This patch achieves a 3.5% speed improvement in bootstrapping by
reordering the rtx classes.  The two biggest benefits are compact
switch statements that are translated to lookup tables and the
ability to test several register classes together with ANDs.

before  user  22m27.950s
after   user  21m39.490s

I introduced two new rtx classes for commutative comparison
operators and for constant objects.  There are many new predicates
in rtx.h to test against rtx classes, which are specially optimized
as hinted above.

It is quite invasive, but these parts of the compiler luckily are
not touched very much these days.  Almost all changes are quite
safe, the only exception being possibly in the changes to
reg_dead_after and in the other places where the loop was cut&pasted;
I will run simulator tests in the next few days (of course, I'd rather
have people run native tests if possible...).

I understand the difficulty of reviewing this patch, but I think it is
worth the improvement; I will also add that I bootstrapped, regtested
and reviewed the patch myself along the way (after adding the constant
objects rtx class, after adding the predicates, after adding the
commutative comparison rtx class, after adding the enum with the old
ASCII values of rtx classes, and at end).

Bootstrapped/regtested on i686-pc-linux-gnu.

Paolo

2004-02-07  Paolo Bonzini  <bonzini@gnu.org>

	* alias.c (rtx_equal_for_memref_p): Use predicates
	to test rtx classes and new rtx class codes, possibly
	splitting conditionals that tested against '<' and 'o'.
	* caller-save.c (save_call_clobbered_regs): Likewise.
	* combine.c (contains_muldiv, find_split_point, subst,
	combine_simplify_rtx, simplify_if_then_else,
	simplify_set, simplify_logical, expand_compound_operation,
	make_compound_operation, if_then_else_cond, known_cond,
	apply_distributive_law, cached_nonzero_bits,
	cached_num_sign_bit_copies, simplify_shift_const,
	gen_binary, simplify_comparison, update_table_tick,
	record_value_for_reg, get_lsat_value_validate): Likewise.
	* cse.c (mention_regs, find_best_addr, find_comparison_args,
	fold_rtx, cse_insn, invalidate_memory, cse_basic_block):
	Likewise.
	* emit-rtl.c (copy_insn_1): Likewise.
	* expr.c (force_operand): Likewise.
	* final.c (final_scan_insn, get_mem_expr_from_op): Likewise.
	* flow.c (notice_stack_pointer_modification_1,
	invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond,
	and_reg_cond, elim_reg_cond): Likewise.
	* genattrtab.c (attr_rtx_1): Likewise.
	* genopinit.c (gen_insn): Likewise.
	* integrate.c (subst_constants): Likewise.
	* jump.c (reversed_comparison_code_parts,
	reversed_comparison_code, delete_related_insns,
	rtx_renumbered_equal_p): Likewise.
	* local-alloc.c (block_alloc): Likewise.
	* loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv,
	canonicalize_condition): Likewise.
	* optabs.c (add_equal_node, expand_binop): Likewise.
	* predict.c (estimate_probability): Likewise.
	* ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise.
	* recog.c (validate_replace_rtx_1, comparison_operator,
	offsettable_address_p, constrain_operands): Likewise.
	* reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat):
	Likewise.
	* regclass.c (scan_one_insn): Likewise.
	* regmove.c (stable_and_no_regs_but_for_p): Likewise.
	* regrename.c (kill_autoinc_value): Likewise.
	* reload.c (find_reusable_reload, find_reloads,
	reg_overlap_mentioned_for_reload_p): Likewise.
	* reload1.c (gen_reload, delete_address_reloads_1): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* rtl.h (CONSTANT_P, INSN_P): Likewise.
	* rtlanal.c (commutative_operand_precedence): Likewise.
	* sched-deps.c (conditions_mutex_p): Likewise.
	* sched-rgn.c (is_cfg_nonregular): Likewise.
	* simplify-rtx.c (simplify_gen_binary,
	simplify_gen_relational, simplify_replace_rtx,
	simplify_unary_operation, simplify_binary_operation,
	simplify_ternary_operation, simplify_rtx): Likewise.
	* unroll.c (reg_dead_after_loop): Likewise.
	* config/alpha/alpha.c (alpha_swapped_comparison_operator,
	print_operand): Likewise.
	* config/arc/arc.c (proper_comparison_operator): Likewise.
	* config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode):
	Likewise.
	* config/avr/avr.c (_reg_unused_after): Likewise.
	* config/frv/frv.c (frv_ifcvt_modify_tests,
	frv_ifcvt_modify_insn, frv_pack_insn): Likewise.
	* config/i386/i386.c (ix86_comparison_operator,
	ix86_carry_flag_operator, fcmov_comparison_operator,
	arith_or_logical_operator, print_operand,
	ix86_expand_binary_operator, ix86_binary_operator_ok):
	Likewise.
	* config/i386/i386.md: Likewise.
	* config/ia64/ia64.c (not_postinc_memory_operand,
	ia64_print_operand, update_set_flags, errata_emit_nops):
	Likewise.
	* config/ia64/ia64.h (PREFERRED_RELOAD_CLASS,
	CONSTRAINT_OK_FOR_S): Likewise.
	* config/ip2k/ip2k.c (mdr_resequence_xy_yx,
	mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
	ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p,
	ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator):
	Likewise.
	* config/iq2000/iq2000.c (cmp_op, symbolic_expression_p,
	eqne_comparison_operator, signed_comparison_operator):
	Likewise.
	* config/mips/mips.c (cmp_op, symbolic_expression_p):
	Likewise.
	* config/mmix/mmix (mmix_foldable_comparison_operator,
	mmix_comparison_operator): Likewise.
	* config/pa/pa.c (hppa_legitimize_address): Likewise.
	* config/rs6000/rs6000.c (stmw_operation,
	branch_comparison_operator, trap_comparison_operator,
	ccr_bit): Likewise.
	* config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise.
	* config/s390/s390.c (s390_alc_comparison,
	s390_slb_comparison):L Likewise.
	* config/sh/sh.c (gen_block_redirect, reg_unused_after):
	Likewise.
	* config/sparc/sparc.c (eq_or_neq, normal_comp_operator,
	noov_compare_op, noov_compare64_op, v9_regcmp_op,
	emit_hard_tfmode_operation, reg_unused_after)
	* doc/md.texi, doc/rtl.texi: Likewise.

	* combine.c (simplify_logical): Remove dummy test,
	(apply_distributive_law): Fix typo in comment.
	GET_CODE (x) == AND so x is a commutative binary op.
	* jump.c (delete_related_insns): simplify loop
	condition, move testing of RTX codes inside the loop.
	(rtx_renumbered_equal_p): do not use RTX_CODE.
	* rtl.c (rtx_class): Declare as enum rtx_class.
	* rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED):
	Move to RTX_COMM_COMPARE class.
	(HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE):
	Move to RTX_CONST_OBJ class.
	* rtl.h (enum rtx_class): New declaration,
	(RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK,
	RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT,
	RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK,
	RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT,
	RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P,
	ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P,
	SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P,
	OBJECT_P): New macros.
	* config/sparc/sparc.c (noov_compare_op): Remove register
	from parameter.


Index: alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/alias.c,v
retrieving revision 1.214
diff -u -p -r1.214 alias.c
--- alias.c	3 Feb 2004 23:53:48 -0000	1.214
+++ alias.c	7 Feb 2004 11:42:06 -0000
@@ -1173,7 +1173,7 @@ rtx_equal_for_memref_p (rtx x, rtx y)
 		&& rtx_equal_for_memref_p (XEXP (x, 1), XEXP (y, 0))));
   /* For commutative operations, the RTX match if the operand match in any
      order.  Also handle the simple binary and unary cases without a loop.  */
-  if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+  if (COMMUTATIVE_P (x))
     {
       rtx xop0 = canon_rtx (XEXP (x, 0));
       rtx yop0 = canon_rtx (XEXP (y, 0));
@@ -1184,14 +1184,14 @@ rtx_equal_for_memref_p (rtx x, rtx y)
 	      || (rtx_equal_for_memref_p (xop0, yop1)
 		  && rtx_equal_for_memref_p (canon_rtx (XEXP (x, 1)), yop0)));
     }
-  else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2')
+  else if (NON_COMMUTATIVE_P (x))
     {
       return (rtx_equal_for_memref_p (canon_rtx (XEXP (x, 0)),
 				      canon_rtx (XEXP (y, 0)))
 	      && rtx_equal_for_memref_p (canon_rtx (XEXP (x, 1)),
 					 canon_rtx (XEXP (y, 1))));
     }
-  else if (GET_RTX_CLASS (code) == '1')
+  else if (UNARY_P (x))
     return rtx_equal_for_memref_p (canon_rtx (XEXP (x, 0)),
 				   canon_rtx (XEXP (y, 0)));
 
@@ -1261,7 +1261,7 @@ find_symbolic_term (rtx x)
   code = GET_CODE (x);
   if (code == SYMBOL_REF || code == LABEL_REF)
     return x;
-  if (GET_RTX_CLASS (code) == 'o')
+  if (OBJECT_P (x))
     return 0;
 
   fmt = GET_RTX_FORMAT (code);
Index: caller-save.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/caller-save.c,v
retrieving revision 1.62
diff -u -p -r1.62 caller-save.c
--- caller-save.c	4 Feb 2004 19:15:16 -0000	1.62
+++ caller-save.c	7 Feb 2004 11:42:06 -0000
@@ -384,7 +384,7 @@ save_call_clobbered_regs (void)
       if (chain->is_caller_save_insn)
 	abort ();
 
-      if (GET_RTX_CLASS (code) == 'i')
+      if (INSN_P (insn))
 	{
 	  /* If some registers have been saved, see if INSN references
 	     any of them.  We must restore them before the insn if so.  */
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.408
diff -u -p -r1.408 combine.c
--- combine.c	3 Feb 2004 05:15:35 -0000	1.408
+++ combine.c	7 Feb 2004 11:42:07 -0000
@@ -1344,18 +1344,14 @@ contains_muldiv (rtx x)
       return ! (GET_CODE (XEXP (x, 1)) == CONST_INT
 		&& exact_log2 (INTVAL (XEXP (x, 1))) >= 0);
     default:
-      switch (GET_RTX_CLASS (GET_CODE (x)))
-	{
-	case 'c':  case '<':  case '2':
-	  return contains_muldiv (XEXP (x, 0))
+      if (BINARY_P (x))
+	return contains_muldiv (XEXP (x, 0))
 	    || contains_muldiv (XEXP (x, 1));
 
-	case '1':
-	  return contains_muldiv (XEXP (x, 0));
+      if (UNARY_P (x))
+	return contains_muldiv (XEXP (x, 0));
 
-	default:
-	  return 0;
-	}
+      return 0;
     }
 }
 
@@ -2949,10 +2945,9 @@ find_split_point (rtx *loc, rtx insn)
 	     This will occur on machines that just support REG + CONST
 	     and have a constant moved through some previous computation.  */
 
-	  else if (GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) != 'o'
+	  else if (!OBJECT_P (XEXP (XEXP (x, 0), 0))
 		   && ! (GET_CODE (XEXP (XEXP (x, 0), 0)) == SUBREG
-			 && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (XEXP (x, 0), 0))))
-			     == 'o')))
+			 && OBJECT_P (SUBREG_REG (XEXP (XEXP (x, 0), 0)))))
 	    return &XEXP (XEXP (x, 0), 0);
 	}
       break;
@@ -2967,9 +2962,9 @@ find_split_point (rtx *loc, rtx insn)
       if (SET_DEST (x) == cc0_rtx
 	  && GET_CODE (SET_SRC (x)) != COMPARE
 	  && GET_CODE (SET_SRC (x)) != ZERO_EXTRACT
-	  && GET_RTX_CLASS (GET_CODE (SET_SRC (x))) != 'o'
+	  && !OBJECT_P (SET_SRC (x))
 	  && ! (GET_CODE (SET_SRC (x)) == SUBREG
-		&& GET_RTX_CLASS (GET_CODE (SUBREG_REG (SET_SRC (x)))) == 'o'))
+		&& OBJECT_P (SUBREG_REG (SET_SRC (x)))))
 	return &SET_SRC (x);
 #endif
 
@@ -3160,14 +3155,11 @@ find_split_point (rtx *loc, rtx insn)
       /* See if this is a simple operation with a constant as the second
 	 operand.  It might be that this constant is out of range and hence
 	 could be used as a split point.  */
-      if ((GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '2'
-	   || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == 'c'
-	   || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '<')
+      if (BINARY_P (SET_SRC (x))
 	  && CONSTANT_P (XEXP (SET_SRC (x), 1))
-	  && (GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (x), 0))) == 'o'
+	  && (OBJECT_P (XEXP (SET_SRC (x), 0))
 	      || (GET_CODE (XEXP (SET_SRC (x), 0)) == SUBREG
-		  && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (SET_SRC (x), 0))))
-		      == 'o'))))
+		  && OBJECT_P (SUBREG_REG (XEXP (SET_SRC (x), 0))))))
 	return &XEXP (SET_SRC (x), 1);
 
       /* Finally, see if this is a simple operation with its first operand
@@ -3175,10 +3167,7 @@ find_split_point (rtx *loc, rtx insn)
 	 register, so return it as a split point.  We can always do this
 	 because if the first operand were another operation, we would have
 	 already found it as a split point.  */
-      if ((GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '2'
-	   || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == 'c'
-	   || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '<'
-	   || GET_RTX_CLASS (GET_CODE (SET_SRC (x))) == '1')
+      if ((BINARY_P (SET_SRC (x)) || UNARY_P (SET_SRC (x)))
 	  && ! register_operand (XEXP (SET_SRC (x), 0), VOIDmode))
 	return &XEXP (SET_SRC (x), 0);
 
@@ -3218,20 +3207,21 @@ find_split_point (rtx *loc, rtx insn)
   /* Otherwise, select our actions depending on our rtx class.  */
   switch (GET_RTX_CLASS (code))
     {
-    case 'b':			/* This is ZERO_EXTRACT and SIGN_EXTRACT.  */
-    case '3':
+    case RTX_BITFIELD_OPS:		/* This is ZERO_EXTRACT and SIGN_EXTRACT.  */
+    case RTX_TERNARY:
       split = find_split_point (&XEXP (x, 2), insn);
       if (split)
 	return split;
       /* ... fall through ...  */
-    case '2':
-    case 'c':
-    case '<':
+    case RTX_BIN_ARITH:
+    case RTX_COMM_ARITH:
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
       split = find_split_point (&XEXP (x, 1), insn);
       if (split)
 	return split;
       /* ... fall through ...  */
-    case '1':
+    case RTX_UNARY:
       /* Some machines have (and (shift ...) ...) insns.  If X is not
 	 an AND, but XEXP (X, 0) is, use it as our split point.  */
       if (GET_CODE (x) != AND && GET_CODE (XEXP (x, 0)) == AND)
@@ -3241,10 +3231,11 @@ find_split_point (rtx *loc, rtx insn)
       if (split)
 	return split;
       return loc;
-    }
 
-  /* Otherwise, we don't have a split point.  */
-  return 0;
+    default:
+      /* Otherwise, we don't have a split point.  */
+      return 0;
+    }
 }
 
 /* Throughout X, replace FROM with TO, and return the result.
@@ -3303,7 +3294,7 @@ subst (rtx x, rtx from, rtx to, int in_d
 
   /* If this is an object, we are done unless it is a MEM or LO_SUM, both
      of which may contain things that can be combined.  */
-  if (code != MEM && code != LO_SUM && GET_RTX_CLASS (code) == 'o')
+  if (code != MEM && code != LO_SUM && OBJECT_P (x))
     return x;
 
   /* It is possible to have a subexpression appear twice in the insn.
@@ -3550,7 +3541,7 @@ combine_simplify_rtx (rtx x, enum machin
 
   /* If this is a commutative operation, put a constant last and a complex
      expression first.  We don't need to do this for comparisons here.  */
-  if (GET_RTX_CLASS (code) == 'c'
+  if (COMMUTATIVE_ARITH_P (x)
       && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
     {
       temp = XEXP (x, 0);
@@ -3606,21 +3597,17 @@ combine_simplify_rtx (rtx x, enum machin
 
      Don't do anything if all operands are very simple.  */
 
-  if (((GET_RTX_CLASS (code) == '2' || GET_RTX_CLASS (code) == 'c'
-	|| GET_RTX_CLASS (code) == '<')
-       && ((GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) != 'o'
+  if ((BINARY_P (x)
+       && ((!OBJECT_P (XEXP (x, 0))
 	    && ! (GET_CODE (XEXP (x, 0)) == SUBREG
-		  && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0))))
-		      == 'o')))
-	   || (GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) != 'o'
+		  && OBJECT_P (SUBREG_REG (XEXP (x, 0)))))
+	   || (!OBJECT_P (XEXP (x, 1))
 	       && ! (GET_CODE (XEXP (x, 1)) == SUBREG
-		     && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 1))))
-			 == 'o')))))
-      || (GET_RTX_CLASS (code) == '1'
-	  && ((GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) != 'o'
+		     && OBJECT_P (SUBREG_REG (XEXP (x, 1)))))))
+      || (UNARY_P (x)
+          && (!OBJECT_P (XEXP (x, 0))
 	       && ! (GET_CODE (XEXP (x, 0)) == SUBREG
-		     && (GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0))))
-			 == 'o'))))))
+		     && OBJECT_P (SUBREG_REG (XEXP (x, 0)))))))
     {
       rtx cond, true_rtx, false_rtx;
 
@@ -3628,14 +3615,13 @@ combine_simplify_rtx (rtx x, enum machin
       if (cond != 0
 	  /* If everything is a comparison, what we have is highly unlikely
 	     to be simpler, so don't use it.  */
-	  && ! (GET_RTX_CLASS (code) == '<'
-		&& (GET_RTX_CLASS (GET_CODE (true_rtx)) == '<'
-		    || GET_RTX_CLASS (GET_CODE (false_rtx)) == '<')))
+	  && ! (COMPARISON_P (x)
+		&& (COMPARISON_P (true_rtx) || COMPARISON_P (false_rtx))))
 	{
 	  rtx cop1 = const0_rtx;
 	  enum rtx_code cond_code = simplify_comparison (NE, &cond, &cop1);
 
-	  if (cond_code == NE && GET_RTX_CLASS (GET_CODE (cond)) == '<')
+	  if (cond_code == NE && COMPARISON_P (cond))
 	    return x;
 
 	  /* Simplify the alternative arms; this may collapse the true and
@@ -3701,12 +3687,13 @@ combine_simplify_rtx (rtx x, enum machin
   temp = 0;
   switch (GET_RTX_CLASS (code))
     {
-    case '1':
+    case RTX_UNARY:
       if (op0_mode == VOIDmode)
 	op0_mode = GET_MODE (XEXP (x, 0));
       temp = simplify_unary_operation (code, mode, XEXP (x, 0), op0_mode);
       break;
-    case '<':
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
       {
 	enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0));
 	if (cmp_mode == VOIDmode)
@@ -3729,15 +3716,17 @@ combine_simplify_rtx (rtx x, enum machin
 	}
 #endif
       break;
-    case 'c':
-    case '2':
+    case RTX_COMM_ARITH:
+    case RTX_BIN_ARITH:
       temp = simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
       break;
-    case 'b':
-    case '3':
+    case RTX_BITFIELD_OPS:
+    case RTX_TERNARY:
       temp = simplify_ternary_operation (code, mode, op0_mode, XEXP (x, 0),
 					 XEXP (x, 1), XEXP (x, 2));
       break;
+    default:
+      break;
     }
 
   if (temp)
@@ -3775,7 +3764,7 @@ combine_simplify_rtx (rtx x, enum machin
 
 	  /* Make sure we pass the constant operand if any as the second
 	     one if this is a commutative operation.  */
-	  if (CONSTANT_P (inner_op0) && GET_RTX_CLASS (code) == 'c')
+	  if (CONSTANT_P (inner_op0) && COMMUTATIVE_ARITH_P (x))
 	    {
 	      rtx tem = inner_op0;
 	      inner_op0 = inner_op1;
@@ -3788,7 +3777,7 @@ combine_simplify_rtx (rtx x, enum machin
 
 	  /* For commutative operations, try the other pair if that one
 	     didn't simplify.  */
-	  if (inner == 0 && GET_RTX_CLASS (code) == 'c')
+	  if (inner == 0 && COMMUTATIVE_ARITH_P (x))
 	    {
 	      other = XEXP (XEXP (x, 0), 1);
 	      inner = simplify_binary_operation (code, mode,
@@ -3996,7 +3985,7 @@ combine_simplify_rtx (rtx x, enum machin
          but it works even if the comparison is done in a mode larger
          than HOST_BITS_PER_WIDE_INT.  */
       if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
-	  && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
+	  && COMPARISON_P (XEXP (x, 0))
 	  && ((HOST_WIDE_INT) STORE_FLAG_VALUE & ~GET_MODE_MASK (mode)) == 0)
 	return gen_lowpart (mode, XEXP (x, 0));
 
@@ -4006,7 +3995,7 @@ combine_simplify_rtx (rtx x, enum machin
       if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
 	  && ((HOST_WIDE_INT) STORE_FLAG_VALUE & ~GET_MODE_MASK (mode)) == 0
 	  && (temp = get_last_value (XEXP (x, 0)))
-	  && GET_RTX_CLASS (GET_CODE (temp)) == '<')
+	  && COMPARISON_P (temp))
 	return gen_lowpart (mode, XEXP (x, 0));
 
       break;
@@ -4172,7 +4161,7 @@ combine_simplify_rtx (rtx x, enum machin
 	 C is 1 and STORE_FLAG_VALUE is -1 or if C is -1 and STORE_FLAG_VALUE
 	 is 1.  This produces better code than the alternative immediately
 	 below.  */
-      if (GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
+      if (COMPARISON_P (XEXP (x, 0))
 	  && ((STORE_FLAG_VALUE == -1 && XEXP (x, 1) == const1_rtx)
 	      || (STORE_FLAG_VALUE == 1 && XEXP (x, 1) == constm1_rtx))
 	  && (reversed = reversed_comparison (XEXP (x, 0), mode,
@@ -4222,7 +4211,7 @@ combine_simplify_rtx (rtx x, enum machin
 	 by reversing the comparison code if valid.  */
       if (STORE_FLAG_VALUE == 1
 	  && XEXP (x, 0) == const1_rtx
-	  && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<'
+	  && COMPARISON_P (XEXP (x, 1))
 	  && (reversed = reversed_comparison (XEXP (x, 1), mode,
 					      XEXP (XEXP (x, 1), 0),
 					      XEXP (XEXP (x, 1), 1))))
@@ -4615,7 +4604,7 @@ simplify_if_then_else (rtx x)
   rtx true_rtx = XEXP (x, 1);
   rtx false_rtx = XEXP (x, 2);
   enum rtx_code true_code = GET_CODE (cond);
-  int comparison_p = GET_RTX_CLASS (true_code) == '<';
+  int comparison_p = COMPARISON_P (cond);
   rtx temp;
   int i;
   enum rtx_code false_code;
@@ -4700,11 +4689,9 @@ simplify_if_then_else (rtx x)
 	  || (CONSTANT_P (true_rtx)
 	      && GET_CODE (false_rtx) != CONST_INT && false_rtx != pc_rtx)
 	  || true_rtx == const0_rtx
-	  || (GET_RTX_CLASS (GET_CODE (true_rtx)) == 'o'
-	      && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o')
-	  || (GET_CODE (true_rtx) == SUBREG
-	      && GET_RTX_CLASS (GET_CODE (SUBREG_REG (true_rtx))) == 'o'
-	      && GET_RTX_CLASS (GET_CODE (false_rtx)) != 'o')
+	  || (OBJECT_P (true_rtx) && !OBJECT_P (false_rtx))
+	  || (GET_CODE (true_rtx) == SUBREG && OBJECT_P (SUBREG_REG (true_rtx))
+	      && !OBJECT_P (false_rtx))
 	  || reg_mentioned_p (true_rtx, false_rtx)
 	  || rtx_equal_p (false_rtx, XEXP (cond, 0))))
     {
@@ -4721,7 +4708,7 @@ simplify_if_then_else (rtx x)
 
       /* It is possible that the conditional has been simplified out.  */
       true_code = GET_CODE (cond);
-      comparison_p = GET_RTX_CLASS (true_code) == '<';
+      comparison_p = COMPARISON_P (cond);
     }
 
   /* If the two arms are identical, we don't need the comparison.  */
@@ -4973,7 +4960,7 @@ simplify_set (rtx x)
        || CC0_P (dest))
       && (cc_use = find_single_use (dest, subst_insn, &other_insn)) != 0
       && (undobuf.other_insn == 0 || other_insn == undobuf.other_insn)
-      && GET_RTX_CLASS (GET_CODE (*cc_use)) == '<'
+      && COMPARISON_P (*cc_use)
       && rtx_equal_p (XEXP (*cc_use, 0), dest))
     {
       enum rtx_code old_code = GET_CODE (*cc_use);
@@ -5136,7 +5123,7 @@ simplify_set (rtx x)
      as long as M1 and M2 have the same number of words.  */
 
   if (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)
-      && GET_RTX_CLASS (GET_CODE (SUBREG_REG (src))) != 'o'
+      && !OBJECT_P (SUBREG_REG (src))
       && (((GET_MODE_SIZE (GET_MODE (src)) + (UNITS_PER_WORD - 1))
 	   / UNITS_PER_WORD)
 	  == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (src)))
@@ -5340,9 +5327,8 @@ simplify_logical (rtx x, int last)
 	  if (GET_CODE (x) != AND)
 	    return x;
 
-	  if (GET_RTX_CLASS (GET_CODE (x)) == 'c'
-	      || GET_RTX_CLASS (GET_CODE (x)) == '2')
-	    op0 = XEXP (x, 0), op1 = XEXP (x, 1);
+	  op0 = XEXP (x, 0);
+	  op1 = XEXP (x, 1);
 	}
 
       /* Convert (A | B) & A to A.  */
@@ -5537,7 +5523,7 @@ simplify_logical (rtx x, int last)
 	 comparison if STORE_FLAG_VALUE is 1.  */
       if (STORE_FLAG_VALUE == 1
 	  && op1 == const1_rtx
-	  && GET_RTX_CLASS (GET_CODE (op0)) == '<'
+	  && COMPARISON_P (op0)
 	  && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0),
 					      XEXP (op0, 1))))
 	return reversed;
@@ -5559,7 +5545,7 @@ simplify_logical (rtx x, int last)
 	  && ((STORE_FLAG_VALUE & GET_MODE_MASK (mode))
 	      == (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1))
 	  && op1 == const_true_rtx
-	  && GET_RTX_CLASS (GET_CODE (op0)) == '<'
+	  && COMPARISON_P (op0)
 	  && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0),
 					      XEXP (op0, 1))))
 	return reversed;
@@ -5723,7 +5709,7 @@ expand_compound_operation (rtx x)
          than HOST_WIDE_INT.  */
       if (GET_CODE (XEXP (x, 0)) == TRUNCATE
 	  && GET_MODE (XEXP (XEXP (x, 0), 0)) == GET_MODE (x)
-	  && GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) == '<'
+	  && COMPARISON_P (XEXP (XEXP (x, 0), 0))
 	  && (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))
 	      <= HOST_BITS_PER_WIDE_INT)
 	  && ((HOST_WIDE_INT) STORE_FLAG_VALUE
@@ -5734,7 +5720,7 @@ expand_compound_operation (rtx x)
       if (GET_CODE (XEXP (x, 0)) == SUBREG
 	  && GET_MODE (SUBREG_REG (XEXP (x, 0))) == GET_MODE (x)
 	  && subreg_lowpart_p (XEXP (x, 0))
-	  && GET_RTX_CLASS (GET_CODE (SUBREG_REG (XEXP (x, 0)))) == '<'
+	  && COMPARISON_P (SUBREG_REG (XEXP (x, 0)))
 	  && (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))
 	      <= HOST_BITS_PER_WIDE_INT)
 	  && ((HOST_WIDE_INT) STORE_FLAG_VALUE
@@ -6415,7 +6401,7 @@ make_compound_operation (rtx x, enum rtx
      but once inside, go back to our default of SET.  */
 
   next_code = (code == MEM || code == PLUS || code == MINUS ? MEM
-	       : ((code == COMPARE || GET_RTX_CLASS (code) == '<')
+	       : ((code == COMPARE || COMPARISON_P (x))
 		  && XEXP (x, 1) == const0_rtx) ? COMPARE
 	       : in_code == COMPARE ? SET : in_code);
 
@@ -6581,9 +6567,9 @@ make_compound_operation (rtx x, enum rtx
 	 also do this for some cases of SIGN_EXTRACT, but it doesn't
 	 seem worth the effort; the case checked for occurs on Alpha.  */
 
-      if (GET_RTX_CLASS (GET_CODE (lhs)) != 'o'
+      if (!OBJECT_P (lhs)
 	  && ! (GET_CODE (lhs) == SUBREG
-		&& (GET_RTX_CLASS (GET_CODE (SUBREG_REG (lhs))) == 'o'))
+		&& (OBJECT_P (SUBREG_REG (lhs))))
 	  && GET_CODE (rhs) == CONST_INT
 	  && INTVAL (rhs) < HOST_BITS_PER_WIDE_INT
 	  && (new = extract_left_shift (lhs, INTVAL (rhs))) != 0)
@@ -7266,7 +7252,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rt
 
   /* If this is a unary operation whose operand has one of two values, apply
      our opcode to compute those values.  */
-  else if (GET_RTX_CLASS (code) == '1'
+  else if (UNARY_P (x)
 	   && (cond0 = if_then_else_cond (XEXP (x, 0), &true0, &false0)) != 0)
     {
       *ptrue = simplify_gen_unary (code, mode, true0, GET_MODE (XEXP (x, 0)));
@@ -7283,8 +7269,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rt
   /* If this is a binary operation, see if either side has only one of two
      values.  If either one does or if both do and they are conditional on
      the same value, compute the new true and false values.  */
-  else if (GET_RTX_CLASS (code) == 'c' || GET_RTX_CLASS (code) == '2'
-	   || GET_RTX_CLASS (code) == '<')
+  else if (BINARY_P (x))
     {
       cond0 = if_then_else_cond (XEXP (x, 0), &true0, &false0);
       cond1 = if_then_else_cond (XEXP (x, 1), &true1, &false1);
@@ -7320,8 +7305,8 @@ if_then_else_cond (rtx x, rtx *ptrue, rt
 	  cond0 = XEXP (XEXP (x, 0), 0);
 	  cond1 = XEXP (XEXP (x, 1), 0);
 
-	  if (GET_RTX_CLASS (GET_CODE (cond0)) == '<'
-	      && GET_RTX_CLASS (GET_CODE (cond1)) == '<'
+	  if (COMPARISON_P (cond0)
+	      && COMPARISON_P (cond1)
 	      && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1)
 		   && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0))
 		   && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1)))
@@ -7351,8 +7336,8 @@ if_then_else_cond (rtx x, rtx *ptrue, rt
 	  cond0 = XEXP (XEXP (x, 0), 0);
 	  cond1 = XEXP (XEXP (x, 1), 0);
 
-	  if (GET_RTX_CLASS (GET_CODE (cond0)) == '<'
-	      && GET_RTX_CLASS (GET_CODE (cond1)) == '<'
+	  if (COMPARISON_P (cond0)
+	      && COMPARISON_P (cond1)
 	      && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1)
 		   && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0))
 		   && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1)))
@@ -7486,14 +7471,14 @@ known_cond (rtx x, enum rtx_code cond, r
   /* The only other cases we handle are MIN, MAX, and comparisons if the
      operands are the same as REG and VAL.  */
 
-  else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == 'c')
+  else if (COMPARISON_P (x) || COMMUTATIVE_ARITH_P (x))
     {
       if (rtx_equal_p (XEXP (x, 0), val))
 	cond = swap_condition (cond), temp = val, val = reg, reg = temp;
 
       if (rtx_equal_p (XEXP (x, 0), reg) && rtx_equal_p (XEXP (x, 1), val))
 	{
-	  if (GET_RTX_CLASS (code) == '<')
+	  if (COMPARISON_P (x))
 	    {
 	      if (comparison_dominates_p (cond, code))
 		return const_true_rtx;
@@ -7785,8 +7770,7 @@ apply_distributive_law (rtx x)
 
   /* If either operand is a primitive we can't do anything, so get out
      fast.  */
-  if (GET_RTX_CLASS (GET_CODE (lhs)) == 'o'
-      || GET_RTX_CLASS (GET_CODE (rhs)) == 'o')
+  if (OBJECT_P (lhs) || OBJECT_P (rhs))
     return x;
 
   lhs = expand_compound_operation (lhs);
@@ -7848,15 +7832,15 @@ apply_distributive_law (rtx x)
 
   /* Set LHS and RHS to the inner operands (A and B in the example
      above) and set OTHER to the common operand (C in the example).
-     These is only one way to do this unless the inner operation is
+     There is only one way to do this unless the inner operation is
      commutative.  */
-  if (GET_RTX_CLASS (inner_code) == 'c'
+  if (COMMUTATIVE_ARITH_P (lhs)
       && rtx_equal_p (XEXP (lhs, 0), XEXP (rhs, 0)))
     other = XEXP (lhs, 0), lhs = XEXP (lhs, 1), rhs = XEXP (rhs, 1);
-  else if (GET_RTX_CLASS (inner_code) == 'c'
+  else if (COMMUTATIVE_ARITH_P (lhs)
 	   && rtx_equal_p (XEXP (lhs, 0), XEXP (rhs, 1)))
     other = XEXP (lhs, 0), lhs = XEXP (lhs, 1), rhs = XEXP (rhs, 0);
-  else if (GET_RTX_CLASS (inner_code) == 'c'
+  else if (COMMUTATIVE_ARITH_P (lhs)
 	   && rtx_equal_p (XEXP (lhs, 1), XEXP (rhs, 0)))
     other = XEXP (lhs, 1), lhs = XEXP (lhs, 0), rhs = XEXP (rhs, 1);
   else if (rtx_equal_p (XEXP (lhs, 1), XEXP (rhs, 1)))
@@ -8025,8 +8009,7 @@ cached_nonzero_bits (rtx x, enum machine
      nonzero_bits1 on X with the subexpressions as KNOWN_X and the
      precomputed value for the subexpression as KNOWN_RET.  */
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c')
+  if (ARITHMETIC_P (x))
     {
       rtx x0 = XEXP (x, 0);
       rtx x1 = XEXP (x, 1);
@@ -8037,14 +8020,12 @@ cached_nonzero_bits (rtx x, enum machine
 			      nonzero_bits_with_known (x0, mode));
 
       /* Check the second level.  */
-      if ((GET_RTX_CLASS (GET_CODE (x0)) == '2'
-	   || GET_RTX_CLASS (GET_CODE (x0)) == 'c')
+      if (ARITHMETIC_P (x0)
 	  && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1)))
 	return nonzero_bits1 (x, mode, x1, mode,
 			      nonzero_bits_with_known (x1, mode));
 
-      if ((GET_RTX_CLASS (GET_CODE (x1)) == '2'
-	   || GET_RTX_CLASS (GET_CODE (x1)) == 'c')
+      if (ARITHMETIC_P (x1)
 	  && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1)))
 	return nonzero_bits1 (x, mode, x0, mode,
 			 nonzero_bits_with_known (x0, mode));
@@ -8554,8 +8535,7 @@ cached_num_sign_bit_copies (rtx x, enum 
      num_sign_bit_copies1 on X with the subexpressions as KNOWN_X and
      the precomputed value for the subexpression as KNOWN_RET.  */
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c')
+  if (ARITHMETIC_P (x))
     {
       rtx x0 = XEXP (x, 0);
       rtx x1 = XEXP (x, 1);
@@ -8567,15 +8547,13 @@ cached_num_sign_bit_copies (rtx x, enum 
 				num_sign_bit_copies_with_known (x0, mode));
 
       /* Check the second level.  */
-      if ((GET_RTX_CLASS (GET_CODE (x0)) == '2'
-	   || GET_RTX_CLASS (GET_CODE (x0)) == 'c')
+      if (ARITHMETIC_P (x0)
 	  && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1)))
 	return
 	  num_sign_bit_copies1 (x, mode, x1, mode,
 				num_sign_bit_copies_with_known (x1, mode));
 
-      if ((GET_RTX_CLASS (GET_CODE (x1)) == '2'
-	   || GET_RTX_CLASS (GET_CODE (x1)) == 'c')
+      if (ARITHMETIC_P (x1)
 	  && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1)))
 	return
 	  num_sign_bit_copies1 (x, mode, x0, mode,
@@ -9790,7 +9768,7 @@ simplify_shift_const (rtx x, enum rtx_co
      If we were passed a value for X, see if we can use any pieces of
      it.  If not, make new rtx.  */
 
-  if (x && GET_RTX_CLASS (GET_CODE (x)) == '2'
+  if (x && GET_RTX_CLASS (GET_CODE (x)) == RTX_BIN_ARITH
       && GET_CODE (XEXP (x, 1)) == CONST_INT
       && (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) == count)
     const_rtx = XEXP (x, 1);
@@ -9849,7 +9827,7 @@ simplify_shift_const (rtx x, enum rtx_co
 	/* This means that we have determined that the result is
 	   equivalent to a constant.  This should be rare.  */
 	x = GEN_INT (outer_const);
-      else if (GET_RTX_CLASS (outer_op) == '1')
+      else if (GET_RTX_CLASS (outer_op) == RTX_UNARY)
 	x = simplify_gen_unary (outer_op, result_mode, x, result_mode);
       else
 	x = gen_binary (outer_op, result_mode, x, GEN_INT (outer_const));
@@ -10058,7 +10036,7 @@ gen_lowpart_for_combine (enum machine_mo
 
   /* If X is a comparison operator, rewrite it in a new mode.  This
      probably won't match, but may allow further simplifications.  */
-  else if (GET_RTX_CLASS (GET_CODE (x)) == '<')
+  else if (COMPARISON_P (x))
     return gen_rtx_fmt_ee (GET_CODE (x), mode, XEXP (x, 0), XEXP (x, 1));
 
   /* If we couldn't simplify X any other way, just enclose it in a
@@ -10099,11 +10077,12 @@ gen_binary (enum rtx_code code, enum mac
   else if (GET_CODE (op1) == CLOBBER)
     return op1;
   
-  if (GET_RTX_CLASS (code) == 'c'
+  if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
       && swap_commutative_operands_p (op0, op1))
     tem = op0, op0 = op1, op1 = tem;
 
-  if (GET_RTX_CLASS (code) == '<')
+  if (GET_RTX_CLASS (code) == RTX_COMPARE
+      || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
     {
       enum machine_mode op_mode = GET_MODE (op0);
 
@@ -10127,7 +10106,7 @@ gen_binary (enum rtx_code code, enum mac
     return result;
 
   /* Put complex operands first and constants second.  */
-  if (GET_RTX_CLASS (code) == 'c'
+  if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
       && swap_commutative_operands_p (op0, op1))
     return gen_rtx_fmt_ee (code, mode, op1, op0);
 
@@ -10327,8 +10306,7 @@ simplify_comparison (enum rtx_code code,
 
       if (GET_MODE_CLASS (mode) != MODE_INT
 	  && ! (mode == VOIDmode
-		&& (GET_CODE (op0) == COMPARE
-		    || GET_RTX_CLASS (GET_CODE (op0)) == '<')))
+		&& (GET_CODE (op0) == COMPARE || COMPARISON_P (op0))))
 	break;
 
       /* Get the constant we are comparing against and turn off all bits
@@ -10903,9 +10881,9 @@ simplify_comparison (enum rtx_code code,
 	      mask = ((INTVAL (XEXP (op0, 1)) & GET_MODE_MASK (mode))
 		      << INTVAL (XEXP (XEXP (op0, 0), 1)));
 	      if ((~STORE_FLAG_VALUE & mask) == 0
-		  && (GET_RTX_CLASS (GET_CODE (XEXP (XEXP (op0, 0), 0))) == '<'
+		  && (COMPARISON_P (XEXP (XEXP (op0, 0), 0))
 		      || ((tem = get_last_value (XEXP (XEXP (op0, 0), 0))) != 0
-			  && GET_RTX_CLASS (GET_CODE (tem)) == '<')))
+			  && COMPARISON_P (tem))))
 		{
 		  op0 = XEXP (XEXP (op0, 0), 0);
 		  continue;
@@ -11385,9 +11363,7 @@ update_table_tick (rtx x)
 	/* Check for identical subexpressions.  If x contains
 	   identical subexpression we only have to traverse one of
 	   them.  */
-	if (i == 0
-	    && (GET_RTX_CLASS (code) == '2'
-		|| GET_RTX_CLASS (code) == 'c'))
+	if (i == 0 && ARITHMETIC_P (x))
 	  {
 	    /* Note that at this point x1 has already been
 	       processed.  */
@@ -11402,15 +11378,13 @@ update_table_tick (rtx x)
 	    /* If x0 is identical to a subexpression of x1 then while
 	       processing x1, x0 has already been processed.  Thus we
 	       are done with x.  */
-	    if ((GET_RTX_CLASS (GET_CODE (x1)) == '2'
-		 || GET_RTX_CLASS (GET_CODE (x1)) == 'c')
+	    if (ARITHMETIC_P (x1)
 		&& (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1)))
 	      break;
 
 	    /* If x1 is identical to a subexpression of x0 then we
 	       still have to process the rest of x0.  */
-	    if ((GET_RTX_CLASS (GET_CODE (x0)) == '2'
-		 || GET_RTX_CLASS (GET_CODE (x0)) == 'c')
+	    if (ARITHMETIC_P (x0)
 		&& (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1)))
 	      {
 		update_table_tick (XEXP (x0, x1 == XEXP (x0, 0) ? 1 : 0));
@@ -11453,8 +11427,7 @@ record_value_for_reg (rtx reg, rtx insn,
 
       if (tem)
 	{
-	  if ((GET_RTX_CLASS (GET_CODE (tem)) == '2'
-	       || GET_RTX_CLASS (GET_CODE (tem)) == 'c')
+	  if (ARITHMETIC_P (tem)
 	      && GET_CODE (XEXP (tem, 0)) == CLOBBER
 	      && GET_CODE (XEXP (tem, 1)) == CLOBBER)
 	    tem = XEXP (tem, 0);
@@ -11764,9 +11737,7 @@ get_last_value_validate (rtx *loc, rtx i
 	  /* Check for identical subexpressions.  If x contains
 	     identical subexpression we only have to traverse one of
 	     them.  */
-	  if (i == 1
-	      && (GET_RTX_CLASS (GET_CODE (x)) == '2'
-		  || GET_RTX_CLASS (GET_CODE (x)) == 'c'))
+	  if (i == 1 && ARITHMETIC_P (x))
 	    {
 	      /* Note that at this point x0 has already been checked
 		 and found valid.  */
@@ -11780,15 +11751,13 @@ get_last_value_validate (rtx *loc, rtx i
 	      /* If x1 is identical to a subexpression of x0 then
 		 while checking x0, x1 has already been checked.  Thus
 		 it is valid and so as x.  */
-	      if ((GET_RTX_CLASS (GET_CODE (x0)) == '2'
-		   || GET_RTX_CLASS (GET_CODE (x0)) == 'c')
+	      if (ARITHMETIC_P (x0)
 		  && (x1 == XEXP (x0, 0) || x1 == XEXP (x0, 1)))
 		return 1;
 
 	      /* If x0 is identical to a subexpression of x1 then x is
 		 valid iff the rest of x1 is valid.  */
-	      if ((GET_RTX_CLASS (GET_CODE (x1)) == '2'
-		   || GET_RTX_CLASS (GET_CODE (x1)) == 'c')
+	      if (ARITHMETIC_P (x1)
 		  && (x0 == XEXP (x1, 0) || x0 == XEXP (x1, 1)))
 		return
 		  get_last_value_validate (&XEXP (x1,
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.285
diff -u -p -r1.285 cse.c
--- cse.c	2 Feb 2004 00:17:08 -0000	1.285
+++ cse.c	7 Feb 2004 11:42:07 -0000
@@ -1214,7 +1214,7 @@ mention_regs (rtx x)
      call that expensive function in the most common case where the only
      use of the register is in the comparison.  */
 
-  if (code == COMPARE || GET_RTX_CLASS (code) == '<')
+  if (code == COMPARE || COMPARISON_P (x))
     {
       if (GET_CODE (XEXP (x, 0)) == REG
 	  && ! REGNO_QTY_VALID_P (REGNO (XEXP (x, 0))))
@@ -2953,8 +2953,7 @@ find_best_addr (rtx insn, rtx *loc, enum
      code on the Alpha for unaligned byte stores.  */
 
   if (flag_expensive_optimizations
-      && (GET_RTX_CLASS (GET_CODE (*loc)) == '2'
-	  || GET_RTX_CLASS (GET_CODE (*loc)) == 'c')
+      && ARITHMETIC_P (*loc)
       && GET_CODE (XEXP (*loc, 0)) == REG)
     {
       rtx op1 = XEXP (*loc, 1);
@@ -3068,7 +3067,7 @@ find_comparison_args (enum rtx_code code
       /* If ARG1 is a comparison operator and CODE is testing for
 	 STORE_FLAG_VALUE, get the inner arguments.  */
 
-      else if (GET_RTX_CLASS (GET_CODE (arg1)) == '<')
+      else if (COMPARISON_P (arg1))
 	{
 #ifdef FLOAT_STORE_FLAG_VALUE
 	  REAL_VALUE_TYPE fsfv;
@@ -3157,7 +3156,7 @@ find_comparison_args (enum rtx_code code
 			   REAL_VALUE_NEGATIVE (fsfv)))
 #endif
 		   )
-		  && GET_RTX_CLASS (GET_CODE (p->exp)) == '<'))
+		  && COMPARISON_P (p->exp)))
 	    {
 	      x = p->exp;
 	      break;
@@ -3177,7 +3176,7 @@ find_comparison_args (enum rtx_code code
 			    REAL_VALUE_NEGATIVE (fsfv)))
 #endif
 		    )
-		   && GET_RTX_CLASS (GET_CODE (p->exp)) == '<')
+		   && COMPARISON_P (p->exp))
 	    {
 	      reverse_code = 1;
 	      x = p->exp;
@@ -3210,7 +3209,7 @@ find_comparison_args (enum rtx_code code
 	  else
 	    code = reversed;
 	}
-      else if (GET_RTX_CLASS (GET_CODE (x)) == '<')
+      else if (COMPARISON_P (x))
 	code = GET_CODE (x);
       arg1 = XEXP (x, 0), arg2 = XEXP (x, 1);
     }
@@ -3391,9 +3390,9 @@ fold_rtx (rtx x, rtx insn)
 		enum rtx_code eltcode = GET_CODE (elt->exp);
 
 	        /* Just check for unary and binary operations.  */
-	        if (GET_RTX_CLASS (GET_CODE (elt->exp)) == '1'
-		    && GET_CODE (elt->exp) != SIGN_EXTEND
-		    && GET_CODE (elt->exp) != ZERO_EXTEND
+	        if (UNARY_P (elt->exp)
+		    && eltcode != SIGN_EXTEND
+		    && eltcode != ZERO_EXTEND
 		    && GET_CODE (XEXP (elt->exp, 0)) == SUBREG
 		    && GET_MODE (SUBREG_REG (XEXP (elt->exp, 0))) == mode
 		    && (GET_MODE_CLASS (mode)
@@ -3409,8 +3408,7 @@ fold_rtx (rtx x, rtx insn)
 		      new = simplify_unary_operation (GET_CODE (elt->exp), mode,
 						      op0, mode);
 		  }
-	        else if ((GET_RTX_CLASS (GET_CODE (elt->exp)) == '2'
-			  || GET_RTX_CLASS (GET_CODE (elt->exp)) == 'c')
+	        else if (ARITHMETIC_P (elt->exp)
 		         && eltcode != DIV && eltcode != MOD
 		         && eltcode != UDIV && eltcode != UMOD
 		         && eltcode != ASHIFTRT && eltcode != LSHIFTRT
@@ -3768,9 +3766,8 @@ fold_rtx (rtx x, rtx insn)
 	    if (validate_change (insn, &XEXP (x, i), replacements[j], 0))
 	      break;
 
-	    if (code == NE || code == EQ || GET_RTX_CLASS (code) == 'c'
-		|| code == LTGT || code == UNEQ || code == ORDERED
-		|| code == UNORDERED)
+	    if (GET_RTX_CLASS (code) == RTX_COMM_COMPARE
+		|| GET_RTX_CLASS (code) == RTX_COMM_ARITH)
 	      {
 		validate_change (insn, &XEXP (x, i), XEXP (x, 1 - i), 1);
 		validate_change (insn, &XEXP (x, 1 - i), replacements[j], 1);
@@ -3802,9 +3799,7 @@ fold_rtx (rtx x, rtx insn)
      operand unless the first operand is also a constant integer.  Otherwise,
      place any constant second unless the first operand is also a constant.  */
 
-  if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c'
-      || code == LTGT || code == UNEQ || code == ORDERED
-      || code == UNORDERED)
+  if (COMMUTATIVE_P (x))
     {
       if (must_swap
 	  || swap_commutative_operands_p (const_arg0 ? const_arg0
@@ -3834,7 +3829,7 @@ fold_rtx (rtx x, rtx insn)
 
   switch (GET_RTX_CLASS (code))
     {
-    case '1':
+    case RTX_UNARY:
       {
 	int is_const = 0;
 
@@ -3857,7 +3852,8 @@ fold_rtx (rtx x, rtx insn)
       }
       break;
 
-    case '<':
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
       /* See what items are actually being compared and set FOLDED_ARG[01]
 	 to those values and CODE to the actual comparison code.  If any are
 	 constant, set CONST_ARG0 and CONST_ARG1 appropriately.  We needn't
@@ -4039,8 +4035,8 @@ fold_rtx (rtx x, rtx insn)
 #endif
       break;
 
-    case '2':
-    case 'c':
+    case RTX_BIN_ARITH:
+    case RTX_COMM_ARITH:
       switch (code)
 	{
 	case PLUS:
@@ -4245,7 +4241,7 @@ fold_rtx (rtx x, rtx insn)
 				       const_arg1 ? const_arg1 : folded_arg1);
       break;
 
-    case 'o':
+    case RTX_OBJ:
       /* (lo_sum (high X) X) is simply X.  */
       if (code == LO_SUM && const_arg0 != 0
 	  && GET_CODE (const_arg0) == HIGH
@@ -4253,15 +4249,15 @@ fold_rtx (rtx x, rtx insn)
 	return const_arg1;
       break;
 
-    case '3':
-    case 'b':
+    case RTX_TERNARY:
+    case RTX_BITFIELD_OPS:
       new = simplify_ternary_operation (code, mode, mode_arg0,
 					const_arg0 ? const_arg0 : folded_arg0,
 					const_arg1 ? const_arg1 : folded_arg1,
 					const_arg2 ? const_arg2 : XEXP (x, 2));
       break;
 
-    case 'x':
+    case RTX_EXTRA:
       /* Eliminate CONSTANT_P_RTX if its constant.  */
       if (code == CONSTANT_P_RTX)
 	{
@@ -4271,6 +4267,9 @@ fold_rtx (rtx x, rtx insn)
 	    return const0_rtx;
 	}
       break;
+
+    default:
+      break;
     }
 
   return new ? new : x;
@@ -5647,7 +5646,7 @@ cse_insn (rtx insn, rtx libcall_insn)
 #ifdef PUSH_ROUNDING
 	  /* Stack pushes invalidate the stack pointer.  */
 	  rtx addr = XEXP (dest, 0);
-	  if (GET_RTX_CLASS (GET_CODE (addr)) == 'a'
+	  if (GET_RTX_CLASS (GET_CODE (addr)) == RTX_AUTOINC
 	      && XEXP (addr, 0) == stack_pointer_rtx)
 	    invalidate (stack_pointer_rtx, Pmode);
 #endif
@@ -6303,7 +6302,7 @@ invalidate_memory (void)
 static int
 addr_affects_sp_p (rtx addr)
 {
-  if (GET_RTX_CLASS (GET_CODE (addr)) == 'a'
+  if (GET_RTX_CLASS (GET_CODE (addr)) == RTX_AUTOINC
       && GET_CODE (XEXP (addr, 0)) == REG
       && REGNO (XEXP (addr, 0)) == STACK_POINTER_REGNUM)
     {
@@ -7183,7 +7182,7 @@ cse_basic_block (rtx from, rtx to, struc
       if (GET_MODE (insn) == QImode)
 	PUT_MODE (insn, VOIDmode);
 
-      if (GET_RTX_CLASS (code) == 'i')
+      if (GET_RTX_CLASS (code) == RTX_INSN)
 	{
 	  rtx p;
 
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.376
diff -u -p -r1.376 emit-rtl.c
--- emit-rtl.c	5 Feb 2004 14:15:35 -0000	1.376
+++ emit-rtl.c	7 Feb 2004 11:42:08 -0000
@@ -4987,7 +4987,7 @@ copy_insn_1 (rtx orig)
   RTX_FLAG (copy, used) = 0;
 
   /* We do not copy JUMP, CALL, or FRAME_RELATED for INSNs.  */
-  if (GET_RTX_CLASS (code) == 'i')
+  if (INSN_P (orig))
     {
       RTX_FLAG (copy, jump) = 0;
       RTX_FLAG (copy, call) = 0;
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.622
diff -u -p -r1.622 expr.c
--- expr.c	6 Feb 2004 06:18:12 -0000	1.622
+++ expr.c	7 Feb 2004 11:42:08 -0000
@@ -5609,7 +5609,7 @@ force_operand (rtx value, rtx target)
       return target;
     }
 
-  if (GET_RTX_CLASS (code) == '2' || GET_RTX_CLASS (code) == 'c')
+  if (ARITHMETIC_P (value))
     {
       op2 = XEXP (value, 1);
       if (!CONSTANT_P (op2) && !(GET_CODE (op2) == REG && op2 != subtarget))
@@ -5678,7 +5678,7 @@ force_operand (rtx value, rtx target)
 				      target, 1, OPTAB_LIB_WIDEN);
 	}
     }
-  if (GET_RTX_CLASS (code) == '1')
+  if (UNARY_P (value))
     {
       op1 = force_operand (XEXP (value, 0), NULL_RTX);
       return expand_simple_unop (GET_MODE (value), code, op1, target, 0);
Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.307
diff -u -p -r1.307 final.c
--- final.c	6 Feb 2004 20:03:41 -0000	1.307
+++ final.c	7 Feb 2004 11:42:09 -0000
@@ -2217,7 +2217,7 @@ final_scan_insn (rtx insn, FILE *file, i
 	    && GET_CODE (body) == SET
 	    && SET_DEST (body) == pc_rtx
 	    && GET_CODE (SET_SRC (body)) == IF_THEN_ELSE
-	    && GET_RTX_CLASS (GET_CODE (XEXP (SET_SRC (body), 0))) == '<'
+	    && COMPARISON_P (XEXP (SET_SRC (body), 0))
 	    && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx
 	    /* This is done during prescan; it is not done again
 	       in final scan when prescan has been done.  */
@@ -2845,8 +2845,8 @@ get_mem_expr_from_op (rtx op, int *paddr
 	   && (expr = get_mem_expr_from_op (XEXP (op, 1), &inner_addressp)))
     return expr;
 
-  while (GET_RTX_CLASS (GET_CODE (op)) == '1'
-	 || GET_RTX_CLASS (GET_CODE (op)) == '2')
+  while (GET_RTX_CLASS (GET_CODE (op)) == RTX_UNARY
+	 || GET_RTX_CLASS (GET_CODE (op)) == RTX_BIN_ARITH)
     op = XEXP (op, 0);
 
   expr = get_mem_expr_from_op (op, &inner_addressp);
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.578
diff -u -p -r1.578 flow.c
--- flow.c	6 Feb 2004 19:29:56 -0000	1.578
+++ flow.c	7 Feb 2004 11:42:09 -0000
@@ -914,7 +914,7 @@ notice_stack_pointer_modification_1 (rtx
 	 of a push until later in flow.  See the comments in rtl.texi
 	 regarding Embedded Side-Effects on Addresses.  */
       || (GET_CODE (x) == MEM
-	  && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == 'a'
+	  && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == RTX_AUTOINC
 	  && XEXP (XEXP (x, 0), 0) == stack_pointer_rtx))
     current_function_sp_is_unchanging = 0;
 }
@@ -2430,7 +2430,7 @@ invalidate_mems_from_autoinc (rtx *px, v
   rtx x = *px;
   struct propagate_block_info *pbi = data;
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'a')
+  if (GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
     {
       invalidate_mems_from_set (pbi, XEXP (x, 0));
       return -1;
@@ -3037,9 +3037,9 @@ ior_reg_cond (rtx old, rtx x, int add)
 {
   rtx op0, op1;
 
-  if (GET_RTX_CLASS (GET_CODE (old)) == '<')
+  if (COMPARISON_P (old))
     {
-      if (GET_RTX_CLASS (GET_CODE (x)) == '<'
+      if (COMPARISON_P (x))
 	  && REVERSE_CONDEXEC_PREDICATES_P (GET_CODE (x), GET_CODE (old))
 	  && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0)))
 	return const1_rtx;
@@ -3132,7 +3132,7 @@ not_reg_cond (rtx x)
   x_code = GET_CODE (x);
   if (x_code == NOT)
     return XEXP (x, 0);
-  if (GET_RTX_CLASS (x_code) == '<'
+  if (COMPARISON_P (x)
       && GET_CODE (XEXP (x, 0)) == REG)
     {
       if (XEXP (x, 1) != const0_rtx)
@@ -3149,9 +3149,9 @@ and_reg_cond (rtx old, rtx x, int add)
 {
   rtx op0, op1;
 
-  if (GET_RTX_CLASS (GET_CODE (old)) == '<')
+  if (COMPARISON_P (old))
     {
-      if (GET_RTX_CLASS (GET_CODE (x)) == '<'
+      if (COMPARISON_P (x))
 	  && GET_CODE (x) == reverse_condition (GET_CODE (old))
 	  && REGNO (XEXP (x, 0)) == REGNO (XEXP (old, 0)))
 	return const0_rtx;
@@ -3242,7 +3242,7 @@ elim_reg_cond (rtx x, unsigned int regno
 {
   rtx op0, op1;
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '<')
+  if (COMPARISON_P (x))
     {
       if (REGNO (XEXP (x, 0)) == regno)
 	return const0_rtx;
Index: genattrtab.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genattrtab.c,v
retrieving revision 1.142
diff -u -p -r1.142 genattrtab.c
--- genattrtab.c	4 Feb 2004 06:12:51 -0000	1.142
+++ genattrtab.c	7 Feb 2004 11:42:09 -0000
@@ -565,7 +565,7 @@ attr_rtx_1 (enum rtx_code code, va_list 
      Use that entry if one is found; otherwise create a new RTL and add it
      to the table.  */
 
-  if (GET_RTX_CLASS (code) == '1')
+  if (GET_RTX_CLASS (code) == RTX_UNARY)
     {
       rtx arg0 = va_arg (p, rtx);
 
@@ -591,9 +591,10 @@ attr_rtx_1 (enum rtx_code code, va_list 
 	  XEXP (rt_val, 0) = arg0;
 	}
     }
-  else if (GET_RTX_CLASS (code) == 'c'
-	   || GET_RTX_CLASS (code) == '2'
-	   || GET_RTX_CLASS (code) == '<')
+  else if (GET_RTX_CLASS (code) == RTX_BIN_ARITH
+  	   || GET_RTX_CLASS (code) == RTX_COMM_ARITH
+  	   || GET_RTX_CLASS (code) == RTX_COMPARE
+  	   || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
     {
       rtx arg0 = va_arg (p, rtx);
       rtx arg1 = va_arg (p, rtx);
Index: genopinit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genopinit.c,v
retrieving revision 1.66
diff -u -p -r1.66 genopinit.c
--- genopinit.c	21 Jan 2004 20:40:01 -0000	1.66
+++ genopinit.c	7 Feb 2004 11:42:09 -0000
@@ -220,7 +220,9 @@ gen_insn (rtx insn)
 		    /* We have to be concerned about matching "gt" and
 		       missing "gtu", e.g., so verify we have reached the
 		       end of thing we are to match.  */
-		    if (*p == 0 && *q == 0 && GET_RTX_CLASS(op) == '<')
+		    if (*p == 0 && *q == 0
+			&& (GET_RTX_CLASS (op) == RTX_COMPARE
+			    || GET_RTX_CLASS (op) == RTX_COMM_COMPARE))
 		      break;
 		  }
 
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.247
diff -u -p -r1.247 integrate.c
--- integrate.c	2 Feb 2004 00:17:16 -0000	1.247
+++ integrate.c	7 Feb 2004 11:42:09 -0000
@@ -2709,7 +2709,8 @@ subst_constants (rtx *loc, rtx insn, str
   /* If this is a commutative operation, move a constant to the second
      operand unless the second operand is already a CONST_INT.  */
   if (! memonly
-      && (GET_RTX_CLASS (code) == 'c' || code == NE || code == EQ)
+      && (GET_RTX_CLASS (code) == RTX_COMM_ARITH
+	  || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
       && CONSTANT_P (XEXP (x, 0)) && GET_CODE (XEXP (x, 1)) != CONST_INT)
     {
       rtx tem = XEXP (x, 0);
@@ -2721,14 +2722,15 @@ subst_constants (rtx *loc, rtx insn, str
   if (! memonly)
     switch (GET_RTX_CLASS (code))
       {
-      case '1':
+      case RTX_UNARY:
 	if (op0_mode == MAX_MACHINE_MODE)
 	  abort ();
 	new = simplify_unary_operation (code, GET_MODE (x),
 					XEXP (x, 0), op0_mode);
 	break;
 
-      case '<':
+      case RTX_COMPARE:
+      case RTX_COMM_COMPARE:
 	{
 	  enum machine_mode op_mode = GET_MODE (XEXP (x, 0));
 
@@ -2755,14 +2757,14 @@ subst_constants (rtx *loc, rtx insn, str
 	  break;
 	}
 
-      case '2':
-      case 'c':
+      case RTX_BIN_ARITH:
+      case RTX_COMM_ARITH:
 	new = simplify_binary_operation (code, GET_MODE (x),
 					 XEXP (x, 0), XEXP (x, 1));
 	break;
 
-      case 'b':
-      case '3':
+      case RTX_BITFIELD_OPS:
+      case RTX_TERNARY:
 	if (op0_mode == MAX_MACHINE_MODE)
 	  abort ();
 
@@ -2770,7 +2772,7 @@ subst_constants (rtx *loc, rtx insn, str
 	  {
 	    rtx op0 = XEXP (x, 0);
 
-	    if (GET_RTX_CLASS (GET_CODE (op0)) == '<'
+	    if (COMPARISON_P (op0)
 		&& GET_MODE (op0) == VOIDmode
 		&& ! side_effects_p (op0)
 		&& XEXP (op0, 0) == map->compare_src
@@ -2794,6 +2796,9 @@ subst_constants (rtx *loc, rtx insn, str
 	  new = simplify_ternary_operation (code, GET_MODE (x), op0_mode,
 					    XEXP (x, 0), XEXP (x, 1),
 					    XEXP (x, 2));
+	break;
+
+      default:
 	break;
       }
 
Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.239
diff -u -p -r1.239 jump.c
--- jump.c	2 Feb 2004 00:17:16 -0000	1.239
+++ jump.c	7 Feb 2004 11:42:10 -0000
@@ -637,7 +637,8 @@ reversed_comparison_code_parts (enum rtx
   enum machine_mode mode;
 
   /* If this is not actually a comparison, we can't reverse it.  */
-  if (GET_RTX_CLASS (code) != '<')
+  if (GET_RTX_CLASS (code) != RTX_COMPARE
+      && GET_RTX_CLASS (code) != RTX_COMM_COMPARE)
     return UNKNOWN;
 
   mode = GET_MODE (arg0);
@@ -748,7 +749,7 @@ reversed_comparison_code_parts (enum rtx
 enum rtx_code
 reversed_comparison_code (rtx comparison, rtx insn)
 {
-  if (GET_RTX_CLASS (GET_CODE (comparison)) != '<')
+  if (!COMPARISON_P (comparison))
     return UNKNOWN;
   return reversed_comparison_code_parts (GET_CODE (comparison),
 					 XEXP (comparison, 0),
@@ -1764,24 +1765,24 @@ delete_related_insns (rtx insn)
 
   if (was_code_label && prev && GET_CODE (prev) == BARRIER)
     {
-      RTX_CODE code;
-      while (next != 0
-	     && (GET_RTX_CLASS (code = GET_CODE (next)) == 'i'
-		 || code == NOTE || code == BARRIER
-		 || (code == CODE_LABEL && INSN_DELETED_P (next))))
+      enum rtx_code code;
+      while (next)
 	{
+	  code = GET_CODE (next);
 	  if (code == NOTE
 	      && NOTE_LINE_NUMBER (next) != NOTE_INSN_FUNCTION_END)
 	    next = NEXT_INSN (next);
 	  /* Keep going past other deleted labels to delete what follows.  */
 	  else if (code == CODE_LABEL && INSN_DELETED_P (next))
 	    next = NEXT_INSN (next);
-	  else
+	  else if (code == BARRIER || INSN_P (next))
 	    /* Note: if this deletes a jump, it can cause more
 	       deletion of unreachable code, after a different label.
 	       As long as the value from this recursive call is correct,
 	       this invocation functions correctly.  */
 	    next = delete_related_insns (next);
+	  else
+	    break;
 	}
     }
 
@@ -2186,7 +2187,7 @@ int
 rtx_renumbered_equal_p (rtx x, rtx y)
 {
   int i;
-  RTX_CODE code = GET_CODE (x);
+  enum rtx_code code = GET_CODE (x);
   const char *fmt;
 
   if (x == y)
@@ -2296,16 +2297,15 @@ rtx_renumbered_equal_p (rtx x, rtx y)
      order.  Also handle the simple binary and unary cases without a loop.
 
      ??? Don't consider PLUS a commutative operator; see comments above.  */
-  if ((code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
-      && code != PLUS)
+  if (COMMUTATIVE_P (x) && code != PLUS)
     return ((rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0))
 	     && rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 1)))
 	    || (rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 1))
 		&& rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 0))));
-  else if (GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == '2')
+  else if (NON_COMMUTATIVE_P (x))
     return (rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0))
 	    && rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 1)));
-  else if (GET_RTX_CLASS (code) == '1')
+  else if (UNARY_P (x))
     return rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0));
 
   /* Compare the elements.  If any pair of corresponding elements
Index: local-alloc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/local-alloc.c,v
retrieving revision 1.128
diff -u -p -r1.128 local-alloc.c
--- local-alloc.c	2 Feb 2004 00:17:17 -0000	1.128
+++ local-alloc.c	7 Feb 2004 11:42:10 -0000
@@ -1392,9 +1392,7 @@ block_alloc (int b)
 
 	      /* Here we care if the operation to be computed is
 		 commutative.  */
-	      else if ((GET_CODE (XEXP (note, 0)) == EQ
-			|| GET_CODE (XEXP (note, 0)) == NE
-			|| GET_RTX_CLASS (GET_CODE (XEXP (note, 0))) == 'c')
+	      else if (COMMUTATIVE_P (XEXP (note, 0))
 		       && (r1 = XEXP (XEXP (note, 0), 1),
 			   (GET_CODE (r1) == REG || GET_CODE (r1) == SUBREG))
 		       && no_conflict_p (insn, r0, r1))
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.491
diff -u -p -r1.491 loop.c
--- loop.c	6 Feb 2004 20:10:35 -0000	1.491
+++ loop.c	7 Feb 2004 11:42:10 -0000
@@ -3709,15 +3709,14 @@ rtx_equal_for_prefetch_p (rtx x, rtx y)
   if (code != GET_CODE (y))
     return 0;
 
-  code = GET_CODE (x);
-
-  if (GET_RTX_CLASS (code) == 'c')
+  if (COMMUTATIVE_ARITH_P (x))
     {
       return ((rtx_equal_for_prefetch_p (XEXP (x, 0), XEXP (y, 0))
 	       && rtx_equal_for_prefetch_p (XEXP (x, 1), XEXP (y, 1)))
 	      || (rtx_equal_for_prefetch_p (XEXP (x, 0), XEXP (y, 1))
 	          && rtx_equal_for_prefetch_p (XEXP (x, 1), XEXP (y, 0))));
     }
+
   /* Compare the elements.  If any pair of corresponding elements fails to
      match, return 0 for the whole thing.  */
 
@@ -8637,7 +8636,7 @@ maybe_eliminate_biv (const struct loop *
       rtx note;
 
       /* If this is a libcall that sets a giv, skip ahead to its end.  */
-      if (GET_RTX_CLASS (code) == 'i')
+      if (INSN_P (p))
 	{
 	  note = find_reg_note (p, REG_LIBCALL, NULL_RTX);
 
@@ -9252,7 +9251,8 @@ canonicalize_condition (rtx insn, rtx co
      the same tests as a function of STORE_FLAG_VALUE as find_comparison_args
      in cse.c  */
 
-  while (GET_RTX_CLASS (code) == '<'
+  while ((GET_RTX_CLASS (code) == RTX_COMPARE
+	  || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
 	 && op1 == CONST0_RTX (GET_MODE (op0))
 	 && op0 != want_reg)
     {
@@ -9342,7 +9342,7 @@ canonicalize_condition (rtx insn, rtx co
 			     REAL_VALUE_NEGATIVE (fsfv)))
 #endif
 		     ))
-		   && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
+		   && COMPARISON_P (SET_SRC (set))))
 	      && (((GET_MODE_CLASS (mode) == MODE_CC)
 		   == (GET_MODE_CLASS (inner_mode) == MODE_CC))
 		  || mode == VOIDmode || inner_mode == VOIDmode))
@@ -9362,7 +9362,7 @@ canonicalize_condition (rtx insn, rtx co
 			     REAL_VALUE_NEGATIVE (fsfv)))
 #endif
 		     ))
-		   && GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
+		   && COMPARISON_P (SET_SRC (set))
 		   && (((GET_MODE_CLASS (mode) == MODE_CC)
 			== (GET_MODE_CLASS (inner_mode) == MODE_CC))
 		       || mode == VOIDmode || inner_mode == VOIDmode))
@@ -9381,7 +9381,7 @@ canonicalize_condition (rtx insn, rtx co
 
       if (x)
 	{
-	  if (GET_RTX_CLASS (GET_CODE (x)) == '<')
+	  if (COMPARISON_P (x))
 	    code = GET_CODE (x);
 	  if (reverse_code)
 	    {
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.206
diff -u -p -r1.206 optabs.c
--- optabs.c	3 Feb 2004 05:39:50 -0000	1.206
+++ optabs.c	7 Feb 2004 11:42:11 -0000
@@ -154,8 +154,11 @@ add_equal_note (rtx insns, rtx target, e
       || NEXT_INSN (insns) == NULL_RTX)
     abort ();
 
-  if (GET_RTX_CLASS (code) != '1' && GET_RTX_CLASS (code) != '2'
-      && GET_RTX_CLASS (code) != 'c' && GET_RTX_CLASS (code) != '<')
+  if (GET_RTX_CLASS (code) != RTX_COMM_ARITH
+      && GET_RTX_CLASS (code) != RTX_BIN_ARITH
+      && GET_RTX_CLASS (code) != RTX_COMM_COMPARE
+      && GET_RTX_CLASS (code) != RTX_COMPARE
+      && GET_RTX_CLASS (code) != RTX_UNARY)
     return 1;
 
   if (GET_CODE (target) == ZERO_EXTRACT)
@@ -191,7 +194,7 @@ add_equal_note (rtx insns, rtx target, e
 	}
     }
 
-  if (GET_RTX_CLASS (code) == '1')
+  if (GET_RTX_CLASS (code) == RTX_UNARY)
     note = gen_rtx_fmt_e (code, GET_MODE (target), copy_rtx (op0));
   else
     note = gen_rtx_fmt_ee (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
@@ -719,7 +722,7 @@ expand_binop (enum machine_mode mode, op
      try to make the first operand a register.
      Even better, try to make it the same as the target.
      Also try to make the last operand a constant.  */
-  if (GET_RTX_CLASS (binoptab->code) == 'c'
+  if (GET_RTX_CLASS (binoptab->code) == RTX_COMM_ARITH
       || binoptab == smul_widen_optab
       || binoptab == umul_widen_optab
       || binoptab == smul_highpart_optab
Index: predict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/predict.c,v
retrieving revision 1.99
diff -u -p -r1.99 predict.c
--- predict.c	27 Jan 2004 19:54:42 -0000	1.99
+++ predict.c	7 Feb 2004 11:42:11 -0000
@@ -528,7 +528,7 @@ estimate_probability (struct loops *loop
       /* Try "pointer heuristic."
 	 A comparison ptr == 0 is predicted as false.
 	 Similarly, a comparison ptr1 == ptr2 is predicted as false.  */
-      if (GET_RTX_CLASS (GET_CODE (cond)) == '<'
+      if (COMPARISON_P (cond)
 	  && ((REG_P (XEXP (cond, 0)) && REG_POINTER (XEXP (cond, 0)))
 	      || (REG_P (XEXP (cond, 1)) && REG_POINTER (XEXP (cond, 1)))))
 	{
Index: ra-debug.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-debug.c,v
retrieving revision 1.15
diff -u -p -r1.15 ra-debug.c
--- ra-debug.c	2 Feb 2004 00:17:17 -0000	1.15
+++ ra-debug.c	7 Feb 2004 11:42:11 -0000
@@ -130,9 +130,11 @@ ra_print_rtx_2op (FILE *file, rtx x)
       case AND: opname = "&"; break;
       case IOR: opname = "|"; break;
       case XOR: opname = "^"; break;
-      /* class '<' */
+      /* class '=' */
       case NE: opname = "!="; break;
       case EQ: opname = "=="; break;
+      case LTGT: opname = "<>"; break;
+      /* class '<' */
       case GE: opname = "s>="; break;
       case GT: opname = "s>"; break;
       case LE: opname = "s<="; break;
@@ -196,7 +198,7 @@ ra_print_rtx_3op (FILE *file, rtx x)
     }
 }
 
-/* Print rtx X, which represents an object (class 'o' or some constructs
+/* Print rtx X, which represents an object (class 'o', 'C', or some constructs
    of class 'x' (e.g. subreg)), to FILE.
    (reg XX) rtl is represented as "pXX", of XX was a pseudo,
    as "name" it name is the nonnull hardreg name, or as "hXX", if XX
@@ -340,12 +342,10 @@ void
 ra_print_rtx (FILE *file, rtx x, int with_pn)
 {
   enum rtx_code code;
-  char class;
   int unhandled = 0;
   if (!x)
     return;
   code = GET_CODE (x);
-  class = GET_RTX_CLASS (code);
 
   /* First handle the insn like constructs.  */
   if (INSN_P (x) || code == NOTE || code == CODE_LABEL || code == BARRIER)
@@ -492,16 +492,24 @@ ra_print_rtx (FILE *file, rtx x, int wit
     }
   if (!unhandled)
     return;
-  if (class == '1')
-    ra_print_rtx_1op (file, x);
-  else if (class == '2' || class == 'c' || class == '<')
-    ra_print_rtx_2op (file, x);
-  else if (class == '3' || class == 'b')
-    ra_print_rtx_3op (file, x);
-  else if (class == 'o')
-    ra_print_rtx_object (file, x);
-  else
-    print_inline_rtx (file, x, 0);
+  switch (GET_RTX_CLASS (code))
+    {
+      case RTX_UNARY:
+        ra_print_rtx_1op (file, x);
+      case RTX_BIN_ARITH:
+      case RTX_COMM_ARITH:
+      case RTX_COMPARE:
+      case RTX_COMM_COMPARE:
+        ra_print_rtx_2op (file, x);
+      case RTX_TERNARY:
+      case RTX_BITFIELD_OPS:
+        ra_print_rtx_3op (file, x);
+      case RTX_OBJ:
+      case RTX_CONST_OBJ:
+        ra_print_rtx_object (file, x);
+      default:
+        print_inline_rtx (file, x, 0);
+    }
 }
 
 /* This only calls ra_print_rtx(), but emits a final newline.  */
Index: recog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/recog.c,v
retrieving revision 1.197
diff -u -p -r1.197 recog.c
--- recog.c	6 Feb 2004 13:57:15 -0000	1.197
+++ recog.c	7 Feb 2004 11:42:11 -0000
@@ -521,11 +521,11 @@ validate_replace_rtx_1 (rtx *loc, rtx fr
   /* Do changes needed to keep rtx consistent.  Don't do any other
      simplifications, as it is not our job.  */
 
-  if ((GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == 'c')
+  if (SWAPPABLE_OPERANDS_P (x)
       && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
     {
       validate_change (object, loc,
-		       gen_rtx_fmt_ee (GET_RTX_CLASS (code) == 'c' ? code
+		       gen_rtx_fmt_ee (COMMUTATIVE_ARITH_P (x) ? code
 				       : swap_condition (code),
 				       GET_MODE (x), XEXP (x, 1),
 				       XEXP (x, 0)), 1);
@@ -1379,7 +1379,7 @@ int
 comparison_operator (rtx op, enum machine_mode mode)
 {
   return ((mode == VOIDmode || GET_MODE (op) == mode)
-	  && GET_RTX_CLASS (GET_CODE (op)) == '<');
+	  && COMPARISON_P (op));
 }
 
 /* If BODY is an insn body that uses ASM_OPERANDS,
@@ -1940,7 +1940,7 @@ offsettable_address_p (int strictp, enum
       return good;
     }
 
-  if (GET_RTX_CLASS (ycode) == 'a')
+  if (GET_RTX_CLASS (ycode) == RTX_AUTOINC)
     return 0;
 
   /* The offset added here is chosen as the maximum offset that
@@ -2313,7 +2313,7 @@ constrain_operands (int strict)
 
 	  /* A unary operator may be accepted by the predicate, but it
 	     is irrelevant for matching constraints.  */
-	  if (GET_RTX_CLASS (GET_CODE (op)) == '1')
+	  if (UNARY_P (op))
 	    op = XEXP (op, 0);
 
 	  if (GET_CODE (op) == SUBREG)
@@ -2386,9 +2386,9 @@ constrain_operands (int strict)
 
 		      /* A unary operator may be accepted by the predicate,
 			 but it is irrelevant for matching constraints.  */
-		      if (GET_RTX_CLASS (GET_CODE (op1)) == '1')
+		      if (UNARY_P (op1))
 			op1 = XEXP (op1, 0);
-		      if (GET_RTX_CLASS (GET_CODE (op2)) == '1')
+		      if (UNARY_P (op2))
 			op2 = XEXP (op2, 0);
 
 		      val = operands_match_p (op1, op2);
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-stack.c,v
retrieving revision 1.143
diff -u -p -r1.143 reg-stack.c
--- reg-stack.c	6 Feb 2004 13:57:15 -0000	1.143
+++ reg-stack.c	7 Feb 2004 11:42:11 -0000
@@ -1178,7 +1178,7 @@ swap_rtx_condition_1 (rtx pat)
   const char *fmt;
   int i, r = 0;
 
-  if (GET_RTX_CLASS (GET_CODE (pat)) == '<')
+  if (COMPARISON_P (pat))
     {
       PUT_CODE (pat, swap_condition (GET_CODE (pat)));
       r = 1;
@@ -1654,7 +1654,7 @@ subst_stack_regs_pat (rtx insn, stack re
 	      }
 
 	    /* Keep operand 1 matching with destination.  */
-	    if (GET_RTX_CLASS (GET_CODE (pat_src)) == 'c'
+	    if (COMMUTATIVE_ARITH_P (pat_src)
 		&& REG_P (*src1) && REG_P (*src2)
 		&& REGNO (*src1) != REGNO (*dest))
 	     {
Index: regclass.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regclass.c,v
retrieving revision 1.185
diff -u -p -r1.185 regclass.c
--- regclass.c	4 Feb 2004 19:15:17 -0000	1.185
+++ regclass.c	7 Feb 2004 11:42:11 -0000
@@ -1008,13 +1008,12 @@ record_operand_costs (rtx insn, struct c
 static rtx
 scan_one_insn (rtx insn, int pass)
 {
-  enum rtx_code code = GET_CODE (insn);
   enum rtx_code pat_code;
   rtx set, note;
   int i, j;
   struct costs op_costs[MAX_RECOG_OPERANDS];
 
-  if (GET_RTX_CLASS (code) != 'i')
+  if (!INSN_P (insn))
     return insn;
 
   pat_code = GET_CODE (PATTERN (insn));
Index: regmove.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.155
diff -u -p -r1.155 regmove.c
--- regmove.c	3 Feb 2004 05:39:53 -0000	1.155
+++ regmove.c	7 Feb 2004 11:42:12 -0000
@@ -2046,7 +2046,13 @@ stable_and_no_regs_but_for_p (rtx x, rtx
   RTX_CODE code = GET_CODE (x);
   switch (GET_RTX_CLASS (code))
     {
-    case '<': case '1': case 'c': case '2': case 'b': case '3':
+    case RTX_UNARY:
+    case RTX_BIN_ARITH:
+    case RTX_COMM_ARITH:
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
+    case RTX_TERNARY:
+    case RTX_BITFIELD_OPS:
       {
 	int i;
 	const char *fmt = GET_RTX_FORMAT (code);
@@ -2056,7 +2062,7 @@ stable_and_no_regs_but_for_p (rtx x, rtx
 	      return 0;
 	return 1;
       }
-    case 'o':
+    case RTX_OBJ:
       if (code == REG)
 	return x == src || x == dst;
       /* If this is a MEM, look inside - there might be a register hidden in
Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.75
diff -u -p -r1.75 regrename.c
--- regrename.c	6 Feb 2004 13:57:15 -0000	1.75
+++ regrename.c	7 Feb 2004 11:42:12 -0000
@@ -1173,7 +1173,7 @@ kill_autoinc_value (rtx *px, void *data)
   rtx x = *px;
   struct value_data *vd = data;
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'a')
+  if (GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
     {
       x = XEXP (x, 0);
       kill_value (x, vd);
Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.237
diff -u -p -r1.237 reload.c
--- reload.c	6 Feb 2004 04:28:46 -0000	1.237
+++ reload.c	7 Feb 2004 11:42:12 -0000
@@ -764,10 +764,10 @@ find_reusable_reload (rtx *p_in, rtx out
 				  true_regnum (rld[i].reg_rtx)))
 	&& out == 0 && rld[i].out == 0 && rld[i].in != 0
 	&& ((GET_CODE (in) == REG
-	     && GET_RTX_CLASS (GET_CODE (rld[i].in)) == 'a'
+	     && GET_RTX_CLASS (GET_CODE (rld[i].in)) == RTX_AUTOINC
 	     && MATCHES (XEXP (rld[i].in, 0), in))
 	    || (GET_CODE (rld[i].in) == REG
-		&& GET_RTX_CLASS (GET_CODE (in)) == 'a'
+		&& GET_RTX_CLASS (GET_CODE (in)) == RTX_AUTOINC
 		&& MATCHES (XEXP (in, 0), rld[i].in)))
 	&& (rld[i].out == 0 || ! earlyclobber_operand_p (rld[i].out))
 	&& (reg_class_size[(int) class] == 1 || SMALL_REGISTER_CLASSES)
@@ -2699,7 +2699,7 @@ find_reloads (rtx insn, int replace, int
 
 	  /* If we now have a simple operand where we used to have a
 	     PLUS or MULT, re-recognize and try again.  */
-	  if ((GET_RTX_CLASS (GET_CODE (*recog_data.operand_loc[i])) == 'o'
+	  if ((OBJECT_P (*recog_data.operand_loc[i])
 	       || GET_CODE (*recog_data.operand_loc[i]) == SUBREG)
 	      && (GET_CODE (recog_data.operand[i]) == MULT
 		  || GET_CODE (recog_data.operand[i]) == PLUS))
@@ -2755,7 +2755,7 @@ find_reloads (rtx insn, int replace, int
 
 	  substed_operand[i] = recog_data.operand[i] = op;
 	}
-      else if (code == PLUS || GET_RTX_CLASS (code) == '1')
+      else if (code == PLUS || GET_RTX_CLASS (code) == RTX_UNARY)
 	/* We can get a PLUS as an "operand" as a result of register
 	   elimination.  See eliminate_regs and gen_reload.  We handle
 	   a unary operator by reloading the operand.  */
@@ -2883,7 +2883,7 @@ find_reloads (rtx insn, int replace, int
 	  /* If the predicate accepts a unary operator, it means that
 	     we need to reload the operand, but do not do this for
 	     match_operator and friends.  */
-	  if (GET_RTX_CLASS (GET_CODE (operand)) == '1' && *p != 0)
+	  if (UNARY_P (operand) && *p != 0)
 	    operand = XEXP (operand, 0);
 
 	  /* If the operand is a SUBREG, extract
@@ -3178,6 +3178,7 @@ find_reloads (rtx insn, int replace, int
 			     && offsettable_memref_p (reg_equiv_mem[REGNO (operand)]))
 			    || (reg_equiv_address[REGNO (operand)] != 0))))
 		  win = 1;
+
 		/* force_const_mem does not accept HIGH.  */
 		if ((CONSTANT_P (operand) && GET_CODE (operand) != HIGH)
 		    || GET_CODE (operand) == MEM)
@@ -6271,7 +6272,7 @@ reg_overlap_mentioned_for_reload_p (rtx 
 
   /* Overly conservative.  */
   if (GET_CODE (x) == STRICT_LOW_PART
-      || GET_RTX_CLASS (GET_CODE (x)) == 'a')
+      || GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
     x = XEXP (x, 0);
 
   /* If either argument is a constant, then modifying X can not affect IN.  */
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.427
diff -u -p -r1.427 reload1.c
--- reload1.c	6 Feb 2004 22:10:22 -0000	1.427
+++ reload1.c	7 Feb 2004 11:42:13 -0000
@@ -7509,7 +7509,7 @@ gen_reload (rtx out, rtx in, int opnum, 
 #endif
 
   /* If IN is a simple operand, use gen_move_insn.  */
-  else if (GET_RTX_CLASS (GET_CODE (in)) == 'o' || GET_CODE (in) == SUBREG)
+  else if (OBJECT_P (in) || GET_CODE (in) == SUBREG)
     emit_insn (gen_move_insn (out, in));
 
 #ifdef HAVE_reload_load_address
@@ -7776,7 +7776,7 @@ delete_address_reloads_1 (rtx dead_insn,
       code = GET_CODE (prev);
       if (code == CODE_LABEL || code == JUMP_INSN)
 	return;
-      if (GET_RTX_CLASS (code) != 'i')
+      if (!INSN_P (prev))
 	continue;
       if (reg_set_p (x, PATTERN (prev)))
 	break;
Index: rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.c,v
retrieving revision 1.133
diff -u -p -r1.133 rtl.c
--- rtl.c	6 Feb 2004 20:03:43 -0000	1.133
+++ rtl.c	7 Feb 2004 11:42:13 -0000
@@ -90,7 +90,7 @@ const char * const rtx_format[NUM_RTX_CO
 /* Indexed by rtx code, gives a character representing the "class" of
    that rtx code.  See rtl.def for documentation on the defined classes.  */
 
-const char rtx_class[NUM_RTX_CODE] = {
+const enum rtx_class rtx_class[NUM_RTX_CODE] = {
 #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   CLASS,
 #include "rtl.def"		/* rtl expressions are defined here */
 #undef DEF_RTL_EXPR
@@ -260,7 +260,7 @@ copy_rtx (rtx orig)
   RTX_FLAG (copy, used) = 0;
 
   /* We do not copy FRAME_RELATED for INSNs.  */
-  if (GET_RTX_CLASS (code) == 'i')
+  if (INSN_P (orig))
     RTX_FLAG (copy, frame_related) = 0;
   RTX_FLAG (copy, jump) = RTX_FLAG (orig, jump);
   RTX_FLAG (copy, call) = RTX_FLAG (orig, call);
Index: rtl.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.def,v
retrieving revision 1.79
diff -u -p -r1.79 rtl.def
--- rtl.def	6 Feb 2004 20:03:43 -0000	1.79
+++ rtl.def	7 Feb 2004 11:42:13 -0000
@@ -46,18 +46,33 @@ Software Foundation, 59 Temple Place - S
    4.  The class of the rtx.  These are stored in rtx_class and are accessed
    via the GET_RTX_CLASS macro.  They are defined as follows:
 
-     "o" an rtx code that can be used to represent an object (e.g, REG, MEM)
-     "<" an rtx code for a comparison (e.g, EQ, NE, LT)
-     "1" an rtx code for a unary arithmetic expression (e.g, NEG, NOT)
-     "c" an rtx code for a commutative binary operation (e.g,, PLUS, MULT)
-     "3" an rtx code for a non-bitfield three input operation (IF_THEN_ELSE)
-     "2" an rtx code for a non-commutative binary operation (e.g., MINUS, DIV)
-     "b" an rtx code for a bit-field operation (ZERO_EXTRACT, SIGN_EXTRACT)
-     "i" an rtx code for a machine insn (INSN, JUMP_INSN, CALL_INSN)
-     "m" an rtx code for something that matches in insns (e.g, MATCH_DUP)
-     "g" an rtx code for grouping insns together (e.g, GROUP_PARALLEL)
-     "a" an rtx code for autoincrement addressing modes (e.g. POST_DEC)
-     "x" everything else
+     RTX_CONST_OBJ
+         an rtx code that can be used to represent a constant object
+         (e.g, CONST_INT)
+     RTX_OBJ
+         an rtx code that can be used to represent an object (e.g, REG, MEM)
+     RTX_COMPARE
+         an rtx code for a comparison (e.g, LT, GT)
+     RTX_COMM_COMPARE
+         an rtx code for a commutative comparison (e.g, EQ, NE, ORDERED)
+     RTX_UNARY
+         an rtx code for a unary arithmetic expression (e.g, NEG, NOT)
+     RTX_COMM_ARITH
+         an rtx code for a commutative binary operation (e.g,, PLUS, MULT)
+     RTX_TERNARY
+         an rtx code for a non-bitfield three input operation (IF_THEN_ELSE)
+     RTX_BIN_ARITH
+         an rtx code for a non-commutative binary operation (e.g., MINUS, DIV)
+     RTX_BITFIELD_OPS
+         an rtx code for a bit-field operation (ZERO_EXTRACT, SIGN_EXTRACT)
+     RTX_INSN
+         an rtx code for a machine insn (INSN, JUMP_INSN, CALL_INSN)
+     RTX_MATCH
+         an rtx code for something that matches in insns (e.g, MATCH_DUP)
+     RTX_AUTOINC
+         an rtx code for autoincrement addressing modes (e.g. POST_DEC)
+     RTX_EXTRA
+         everything else
      
    */
 
@@ -67,27 +82,27 @@ Software Foundation, 59 Temple Place - S
    --------------------------------------------------------------------- */
 
 /* an expression code name unknown to the reader */
-DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", 'x')
+DEF_RTL_EXPR(UNKNOWN, "UnKnown", "*", RTX_EXTRA)
 
 /* (NIL) is used by rtl reader and printer to represent a null pointer.  */
 
-DEF_RTL_EXPR(NIL, "nil", "*", 'x')
+DEF_RTL_EXPR(NIL, "nil", "*", RTX_EXTRA)
 
 
 /* include a file */
 
-DEF_RTL_EXPR(INCLUDE, "include", "s", 'x')
+DEF_RTL_EXPR(INCLUDE, "include", "s", RTX_EXTRA)
 
 /* ---------------------------------------------------------------------
    Expressions used in constructing lists.
    --------------------------------------------------------------------- */
 
 /* a linked list of expressions */
-DEF_RTL_EXPR(EXPR_LIST, "expr_list", "ee", 'x')
+DEF_RTL_EXPR(EXPR_LIST, "expr_list", "ee", RTX_EXTRA)
 
 /* a linked list of instructions.
    The insns are represented in print by their uids.  */
-DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", 'x')
+DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Expression types for machine descriptions.
@@ -126,19 +141,19 @@ DEF_RTL_EXPR(INSN_LIST, "insn_list", "ue
    There must be a 1 to 1 correspondence between these sets of classes in
    all operands for an instruction.
    */
-DEF_RTL_EXPR(MATCH_OPERAND, "match_operand", "iss", 'm')
+DEF_RTL_EXPR(MATCH_OPERAND, "match_operand", "iss", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means match a SCRATCH or a register.  When used to generate rtl, a
    SCRATCH is generated.  As for MATCH_OPERAND, the mode specifies
    the desired mode and the first argument is the operand number.
    The second argument is the constraint.  */
-DEF_RTL_EXPR(MATCH_SCRATCH, "match_scratch", "is", 'm')
+DEF_RTL_EXPR(MATCH_SCRATCH, "match_scratch", "is", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means match only something equal to what is stored in the operand table
    at the index specified by the argument.  */
-DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i", 'm')
+DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means apply a predicate, AND match recursively the operands of the rtx.
@@ -146,7 +161,7 @@ DEF_RTL_EXPR(MATCH_DUP, "match_dup", "i"
    Operand 1 is a predicate to apply (as a string, a function name).
    Operand 2 is a vector of expressions, each of which must match
    one subexpression of the rtx this construct is matching.  */
-DEF_RTL_EXPR(MATCH_OPERATOR, "match_operator", "isE", 'm')
+DEF_RTL_EXPR(MATCH_OPERATOR, "match_operator", "isE", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means to match a PARALLEL of arbitrary length.  The predicate is applied
@@ -155,22 +170,22 @@ DEF_RTL_EXPR(MATCH_OPERATOR, "match_oper
    Operand 1 is a predicate to apply to the PARALLEL.
    Operand 2 is a vector of expressions, each of which must match the 
    corresponding element in the PARALLEL.  */
-DEF_RTL_EXPR(MATCH_PARALLEL, "match_parallel", "isE", 'm')
+DEF_RTL_EXPR(MATCH_PARALLEL, "match_parallel", "isE", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means match only something equal to what is stored in the operand table
    at the index specified by the argument.  For MATCH_OPERATOR.  */
-DEF_RTL_EXPR(MATCH_OP_DUP, "match_op_dup", "iE", 'm')
+DEF_RTL_EXPR(MATCH_OP_DUP, "match_op_dup", "iE", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Means match only something equal to what is stored in the operand table
    at the index specified by the argument.  For MATCH_PARALLEL.  */
-DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", 'm')
+DEF_RTL_EXPR(MATCH_PAR_DUP, "match_par_dup", "iE", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Operand 0 is the operand number, as in match_operand.
    Operand 1 is the predicate to apply to the insn.  */
-DEF_RTL_EXPR(MATCH_INSN, "match_insn", "is", 'm')
+DEF_RTL_EXPR(MATCH_INSN, "match_insn", "is", RTX_MATCH)
 
 /* Appears only in machine descriptions.
    Defines the pattern for one kind of instruction.
@@ -189,7 +204,7 @@ DEF_RTL_EXPR(MATCH_INSN, "match_insn", "
       template to use.
    4: optionally, a vector of attributes for this insn.
      */
-DEF_RTL_EXPR(DEFINE_INSN, "define_insn", "sEsTV", 'x')
+DEF_RTL_EXPR(DEFINE_INSN, "define_insn", "sEsTV", RTX_EXTRA)
 
 /* Definition of a peephole optimization.
    1st operand: vector of insn patterns to match
@@ -197,7 +212,7 @@ DEF_RTL_EXPR(DEFINE_INSN, "define_insn",
    3rd operand: template or C code to produce assembler output.
    4: optionally, a vector of attributes for this insn.
      */
-DEF_RTL_EXPR(DEFINE_PEEPHOLE, "define_peephole", "EsTV", 'x')
+DEF_RTL_EXPR(DEFINE_PEEPHOLE, "define_peephole", "EsTV", RTX_EXTRA)
 
 /* Definition of a split operation.
    1st operand: insn pattern to match
@@ -208,7 +223,7 @@ DEF_RTL_EXPR(DEFINE_PEEPHOLE, "define_pe
 	elements of `recog_data.operand' for use by the vector of
 	insn-patterns.
 	(`operands' is an alias here for `recog_data.operand').  */
-DEF_RTL_EXPR(DEFINE_SPLIT, "define_split", "EsES", 'x')
+DEF_RTL_EXPR(DEFINE_SPLIT, "define_split", "EsES", RTX_EXTRA)
 
 /* Definition of an insn and associated split.
    This is the concatenation, with a few modifications, of a define_insn
@@ -236,15 +251,15 @@ DEF_RTL_EXPR(DEFINE_SPLIT, "define_split
 	insn-patterns.
 	(`operands' is an alias here for `recog_data.operand').  
    7: optionally, a vector of attributes for this insn.  */
-DEF_RTL_EXPR(DEFINE_INSN_AND_SPLIT, "define_insn_and_split", "sEsTsESV", 'x')
+DEF_RTL_EXPR(DEFINE_INSN_AND_SPLIT, "define_insn_and_split", "sEsTsESV", RTX_EXTRA)
 
 /* Definition of an RTL peephole operation.
    Follows the same arguments as define_split.  */
-DEF_RTL_EXPR(DEFINE_PEEPHOLE2, "define_peephole2", "EsES", 'x')
+DEF_RTL_EXPR(DEFINE_PEEPHOLE2, "define_peephole2", "EsES", RTX_EXTRA)
 
 /* Definition of a combiner pattern.
    Operands not defined yet.  */
-DEF_RTL_EXPR(DEFINE_COMBINE, "define_combine", "Ess", 'x')
+DEF_RTL_EXPR(DEFINE_COMBINE, "define_combine", "Ess", RTX_EXTRA)
 
 /* Define how to generate multiple insns for a standard insn name.
    1st operand: the insn name.
@@ -257,7 +272,7 @@ DEF_RTL_EXPR(DEFINE_COMBINE, "define_com
 	elements of `recog_data.operand' for use by the vector of
 	insn-patterns.
 	(`operands' is an alias here for `recog_data.operand').  */
-DEF_RTL_EXPR(DEFINE_EXPAND, "define_expand", "sEss", 'x')
+DEF_RTL_EXPR(DEFINE_EXPAND, "define_expand", "sEss", RTX_EXTRA)
    
 /* Define a requirement for delay slots.
    1st operand: Condition involving insn attributes that, if true,
@@ -273,7 +288,7 @@ DEF_RTL_EXPR(DEFINE_EXPAND, "define_expa
 
    Multiple DEFINE_DELAYs may be present.  They indicate differing
    requirements for delay slots.  */
-DEF_RTL_EXPR(DEFINE_DELAY, "define_delay", "eE", 'x')
+DEF_RTL_EXPR(DEFINE_DELAY, "define_delay", "eE", RTX_EXTRA)
 
 /* Define a set of insns that requires a function unit.  This means that
    these insns produce their result after a delay and that there may be
@@ -314,10 +329,10 @@ DEF_RTL_EXPR(DEFINE_DELAY, "define_delay
 		the insn can be immediately scheduled (subject to the limit
 		on the number of simultaneous operations executing on the
 		unit.)  */
-DEF_RTL_EXPR(DEFINE_FUNCTION_UNIT, "define_function_unit", "siieiiV", 'x')
+DEF_RTL_EXPR(DEFINE_FUNCTION_UNIT, "define_function_unit", "siieiiV", RTX_EXTRA)
 
 /* Define attribute computation for `asm' instructions.  */
-DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "define_asm_attributes", "V", 'x' )
+DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "define_asm_attributes", "V", RTX_EXTRA)
 
 /* Definition of a conditional execution meta operation.  Automatically
    generates new instances of DEFINE_INSN, selected by having attribute
@@ -330,16 +345,16 @@ DEF_RTL_EXPR(DEFINE_ASM_ATTRIBUTES, "def
    1: A C expression giving an additional condition for recognizing
       the generated pattern.
    2: A template or C code to produce assembler output.  */
-DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "Ess", 'x')
+DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "Ess", RTX_EXTRA)
 
 /* SEQUENCE appears in the result of a `gen_...' function
    for a DEFINE_EXPAND that wants to make several insns.
    Its elements are the bodies of the insns that should be made.
    `emit_insn' takes the SEQUENCE apart and makes separate insns.  */
-DEF_RTL_EXPR(SEQUENCE, "sequence", "E", 'x')
+DEF_RTL_EXPR(SEQUENCE, "sequence", "E", RTX_EXTRA)
 
 /* Refers to the address of its argument.  This is only used in alias.c.  */
-DEF_RTL_EXPR(ADDRESS, "address", "e", 'm')
+DEF_RTL_EXPR(ADDRESS, "address", "e", RTX_MATCH)
 
 /* ----------------------------------------------------------------------
    Constructions for CPU pipeline description described by NDFAs.
@@ -355,12 +370,12 @@ DEF_RTL_EXPR(ADDRESS, "address", "e", 'm
    All define_reservations, define_cpu_units, and
    define_query_cpu_units should have unique names which may not be
    "nothing".  */
-DEF_RTL_EXPR(DEFINE_CPU_UNIT, "define_cpu_unit", "sS", 'x')
+DEF_RTL_EXPR(DEFINE_CPU_UNIT, "define_cpu_unit", "sS", RTX_EXTRA)
 
 /* (define_query_cpu_unit string [string]) describes cpu functional
    units analogously to define_cpu_unit.  The reservation of such
    units can be queried for automaton state.  */
-DEF_RTL_EXPR(DEFINE_QUERY_CPU_UNIT, "define_query_cpu_unit", "sS", 'x')
+DEF_RTL_EXPR(DEFINE_QUERY_CPU_UNIT, "define_query_cpu_unit", "sS", RTX_EXTRA)
 
 /* (exclusion_set string string) means that each CPU functional unit
    in the first string can not be reserved simultaneously with any
@@ -370,7 +385,7 @@ DEF_RTL_EXPR(DEFINE_QUERY_CPU_UNIT, "def
    unit which can execute simultaneously only single floating point
    insns or only double floating point insns.  All CPU functional
    units in a set should belong to the same automaton.  */
-DEF_RTL_EXPR(EXCLUSION_SET, "exclusion_set", "ss", 'x')
+DEF_RTL_EXPR(EXCLUSION_SET, "exclusion_set", "ss", RTX_EXTRA)
 
 /* (presence_set string string) means that each CPU functional unit in
    the first string can not be reserved unless at least one of pattern
@@ -392,7 +407,7 @@ DEF_RTL_EXPR(EXCLUSION_SET, "exclusion_s
 
    All CPU functional units in a set should belong to the same
    automaton.  */
-DEF_RTL_EXPR(PRESENCE_SET, "presence_set", "ss", 'x')
+DEF_RTL_EXPR(PRESENCE_SET, "presence_set", "ss", RTX_EXTRA)
 
 /* (final_presence_set string string) is analogous to `presence_set'.
    The difference between them is when checking is done.  When an
@@ -413,7 +428,7 @@ DEF_RTL_EXPR(PRESENCE_SET, "presence_set
       (define_reservation "insn_and_nop" "slot0 + slot1")
 
    but it can be issued if we use analogous `final_presence_set'.  */
-DEF_RTL_EXPR(FINAL_PRESENCE_SET, "final_presence_set", "ss", 'x')
+DEF_RTL_EXPR(FINAL_PRESENCE_SET, "final_presence_set", "ss", RTX_EXTRA)
 
 /* (absence_set string string) means that each CPU functional unit in
    the first string can be reserved only if each pattern of units
@@ -436,12 +451,12 @@ DEF_RTL_EXPR(FINAL_PRESENCE_SET, "final_
 
    All CPU functional units in a set should to belong the same
    automaton.  */
-DEF_RTL_EXPR(ABSENCE_SET, "absence_set", "ss", 'x')
+DEF_RTL_EXPR(ABSENCE_SET, "absence_set", "ss", RTX_EXTRA)
 
 /* (final_absence_set string string) is analogous to `absence_set' but
    checking is done on the result (state) reservation.  See comments
    for `final_presence_set'.  */
-DEF_RTL_EXPR(FINAL_ABSENCE_SET, "final_absence_set", "ss", 'x')
+DEF_RTL_EXPR(FINAL_ABSENCE_SET, "final_absence_set", "ss", RTX_EXTRA)
 
 /* (define_bypass number out_insn_names in_insn_names) names bypass
    with given latency (the first number) from insns given by the first
@@ -452,7 +467,7 @@ DEF_RTL_EXPR(FINAL_ABSENCE_SET, "final_a
    parameters.  If the function returns zero the bypass will be
    ignored for this case.  Additional guard is necessary to recognize
    complicated bypasses, e.g. when consumer is load address.  */
-DEF_RTL_EXPR(DEFINE_BYPASS, "define_bypass", "issS", 'x')
+DEF_RTL_EXPR(DEFINE_BYPASS, "define_bypass", "issS", RTX_EXTRA)
 
 /* (define_automaton string) describes names of automata generated and
    used for pipeline hazards recognition.  The names are separated by
@@ -461,7 +476,7 @@ DEF_RTL_EXPR(DEFINE_BYPASS, "define_bypa
    automata, the summary size of the automata usually is less than the
    single one.  The automaton name is used in define_cpu_unit and
    define_query_cpu_unit.  All automata should have unique names.  */
-DEF_RTL_EXPR(DEFINE_AUTOMATON, "define_automaton", "s", 'x')
+DEF_RTL_EXPR(DEFINE_AUTOMATON, "define_automaton", "s", RTX_EXTRA)
 
 /* (automata_option string) describes option for generation of
    automata.  Currently there are the following options:
@@ -484,7 +499,7 @@ DEF_RTL_EXPR(DEFINE_AUTOMATON, "define_a
 
    o "progress" which means output of a progress bar showing how many
      states were generated so far for automaton being processed.  */
-DEF_RTL_EXPR(AUTOMATA_OPTION, "automata_option", "s", 'x')
+DEF_RTL_EXPR(AUTOMATA_OPTION, "automata_option", "s", RTX_EXTRA)
 
 /* (define_reservation string string) names reservation (the first
    string) of cpu functional units (the 2nd string).  Sometimes unit
@@ -493,7 +508,7 @@ DEF_RTL_EXPR(AUTOMATA_OPTION, "automata_
    parameter) in regular expression in define_insn_reservation.  All
    define_reservations, define_cpu_units, and define_query_cpu_units
    should have unique names which may not be "nothing".  */
-DEF_RTL_EXPR(DEFINE_RESERVATION, "define_reservation", "ss", 'x')
+DEF_RTL_EXPR(DEFINE_RESERVATION, "define_reservation", "ss", RTX_EXTRA)
 
 /* (define_insn_reservation name default_latency condition regexpr)
    describes reservation of cpu functional units (the 3nd operand) for
@@ -541,7 +556,7 @@ DEF_RTL_EXPR(DEFINE_RESERVATION, "define
 
        7. string "nothing" means no units reservation.  */
 
-DEF_RTL_EXPR(DEFINE_INSN_RESERVATION, "define_insn_reservation", "sies", 'x')
+DEF_RTL_EXPR(DEFINE_INSN_RESERVATION, "define_insn_reservation", "sies", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Expressions used for insn attributes.  These also do not appear in
@@ -552,10 +567,10 @@ DEF_RTL_EXPR(DEFINE_INSN_RESERVATION, "d
    1st operand: name of the attribute
    2nd operand: comma-separated list of possible attribute values
    3rd operand: expression for the default value of the attribute.  */
-DEF_RTL_EXPR(DEFINE_ATTR, "define_attr", "sse", 'x')
+DEF_RTL_EXPR(DEFINE_ATTR, "define_attr", "sse", RTX_EXTRA)
 
 /* Marker for the name of an attribute.  */
-DEF_RTL_EXPR(ATTR, "attr", "s", 'x')
+DEF_RTL_EXPR(ATTR, "attr", "s", RTX_EXTRA)
 
 /* For use in the last (optional) operand of DEFINE_INSN or DEFINE_PEEPHOLE and
    in DEFINE_ASM_INSN to specify an attribute to assign to insns matching that
@@ -563,7 +578,7 @@ DEF_RTL_EXPR(ATTR, "attr", "s", 'x')
 
    (set_attr "name" "value") is equivalent to
    (set (attr "name") (const_string "value"))  */
-DEF_RTL_EXPR(SET_ATTR, "set_attr", "ss", 'x')
+DEF_RTL_EXPR(SET_ATTR, "set_attr", "ss", RTX_EXTRA)
 
 /* In the last operand of DEFINE_INSN and DEFINE_PEEPHOLE, this can be used to
    specify that attribute values are to be assigned according to the
@@ -578,16 +593,16 @@ DEF_RTL_EXPR(SET_ATTR, "set_attr", "ss",
 				 (const_string "a3")])
    (set_attr "att" "a1,a2,a3")
  */
-DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", 'x')
+DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", RTX_EXTRA)
 
 /* A conditional expression true if the value of the specified attribute of
    the current insn equals the specified value.  The first operand is the
    attribute name and the second is the comparison value.  */
-DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", 'x')
+DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", RTX_EXTRA)
 
 /* A special case of the above representing a set of alternatives.  The first
    operand is bitmap of the set, the second one is the default value.  */
-DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ii", 'x')
+DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ii", RTX_EXTRA)
 
 /* A conditional expression which is true if the specified flag is
    true for the insn being scheduled in reorg.
@@ -597,7 +612,7 @@ DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt",
 
    forward, backward, very_likely, likely, very_unlikely, and unlikely.  */
 
-DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", 'x')
+DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Expression types used for things in the instruction chain.
@@ -610,21 +625,21 @@ DEF_RTL_EXPR (ATTR_FLAG, "attr_flag", "s
    ---------------------------------------------------------------------- */
 
 /* An instruction that cannot jump.  */
-DEF_RTL_EXPR(INSN, "insn", "iuuBieiee", 'i')
+DEF_RTL_EXPR(INSN, "insn", "iuuBieiee", RTX_INSN)
 
 /* An instruction that can possibly jump.
    Fields ( rtx->u.fld[] ) have exact same meaning as INSN's.  */
-DEF_RTL_EXPR(JUMP_INSN, "jump_insn", "iuuBieiee0", 'i')
+DEF_RTL_EXPR(JUMP_INSN, "jump_insn", "iuuBieiee0", RTX_INSN)
 
 /* An instruction that can possibly call a subroutine
    but which will not change which instruction comes next
    in the current function.
    Field ( rtx->u.fld[9] ) is CALL_INSN_FUNCTION_USAGE.
    All other fields ( rtx->u.fld[] ) have exact same meaning as INSN's.  */
-DEF_RTL_EXPR(CALL_INSN, "call_insn", "iuuBieieee", 'i')
+DEF_RTL_EXPR(CALL_INSN, "call_insn", "iuuBieieee", RTX_INSN)
 
 /* A marker that indicates that control will not flow through.  */
-DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", 'x')
+DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", RTX_EXTRA)
 
 /* Holds a label that is followed by instructions.
    Operand:
@@ -632,14 +647,14 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu000
    5: is used in flow.c to point to the chain of label_ref's to this label.
    6: is a number that is unique in the entire compilation.
    7: is the user-given name of the label, if any.  */
-DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", 'x')
+DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", RTX_EXTRA)
 
 /* Say where in the code a source line starts, for symbol table's sake.
    Operand:
    4: filename, if line number > 0, note-specific data otherwise.
    5: line number if > 0, enum note_insn otherwise.
    6: unique number if line number == note_insn_deleted_label.  */
-DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", 'x')
+DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Top level constituents of INSN, JUMP_INSN and CALL_INSN.
@@ -652,10 +667,10 @@ DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", 'x
    Semantics are that there are no side effects if the condition
    is false.  This pattern is created automatically by the if_convert
    pass run after reload or by target-specific splitters.  */
-DEF_RTL_EXPR(COND_EXEC, "cond_exec", "ee", 'x')
+DEF_RTL_EXPR(COND_EXEC, "cond_exec", "ee", RTX_EXTRA)
 
 /* Several operations to be done in parallel (perhaps under COND_EXEC).  */
-DEF_RTL_EXPR(PARALLEL, "parallel", "E", 'x')
+DEF_RTL_EXPR(PARALLEL, "parallel", "E", RTX_EXTRA)
 
 /* A string that is passed through to the assembler as input.
      One can obviously pass comments through by using the
@@ -663,7 +678,7 @@ DEF_RTL_EXPR(PARALLEL, "parallel", "E", 
      These occur in an insn all by themselves as the PATTERN.
      They also appear inside an ASM_OPERANDS
      as a convenient way to hold a string.  */
-DEF_RTL_EXPR(ASM_INPUT, "asm_input", "s", 'x')
+DEF_RTL_EXPR(ASM_INPUT, "asm_input", "s", RTX_EXTRA)
 
 /* An assembler instruction with operands.
    1st operand is the instruction template.
@@ -677,7 +692,7 @@ DEF_RTL_EXPR(ASM_INPUT, "asm_input", "s"
      and whose mode indicates the mode of the input operand.
    6th is the name of the containing source file.
    7th is the source line number.  */
-DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEsi", 'x')
+DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands", "ssiEEsi", RTX_EXTRA)
 
 /* A machine-specific operation.
    1st operand is a vector of operands being used by the operation so that
@@ -688,14 +703,14 @@ DEF_RTL_EXPR(ASM_OPERANDS, "asm_operands
    genrecog.c record positions within an insn.)
    This can occur all by itself in a PATTERN, as a component of a PARALLEL,
    or inside an expression.  */
-DEF_RTL_EXPR(UNSPEC, "unspec", "Ei", 'x')
+DEF_RTL_EXPR(UNSPEC, "unspec", "Ei", RTX_EXTRA)
 
 /* Similar, but a volatile operation and one which may trap.  */
-DEF_RTL_EXPR(UNSPEC_VOLATILE, "unspec_volatile", "Ei", 'x')
+DEF_RTL_EXPR(UNSPEC_VOLATILE, "unspec_volatile", "Ei", RTX_EXTRA)
 
 /* Vector of addresses, stored as full words.  */
 /* Each element is a LABEL_REF to a CODE_LABEL whose address we want.  */
-DEF_RTL_EXPR(ADDR_VEC, "addr_vec", "E", 'x')
+DEF_RTL_EXPR(ADDR_VEC, "addr_vec", "E", RTX_EXTRA)
 
 /* Vector of address differences X0 - BASE, X1 - BASE, ...
    First operand is BASE; the vector contains the X's.
@@ -720,7 +735,7 @@ DEF_RTL_EXPR(ADDR_VEC, "addr_vec", "E", 
    CASE_VECTOR_SHORTEN_MODE is defined, and only in an optimizing
    compilations.  */
      
-DEF_RTL_EXPR(ADDR_DIFF_VEC, "addr_diff_vec", "eEee0", 'x')
+DEF_RTL_EXPR(ADDR_DIFF_VEC, "addr_diff_vec", "eEee0", RTX_EXTRA)
 
 /* Memory prefetch, with attributes supported on some targets.
    Operand 1 is the address of the memory to fetch.
@@ -731,7 +746,7 @@ DEF_RTL_EXPR(ADDR_DIFF_VEC, "addr_diff_v
 
    The attributes specified by operands 2 and 3 are ignored for targets
    whose prefetch instructions do not support them.  */
-DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", 'x')
+DEF_RTL_EXPR(PREFETCH, "prefetch", "eee", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    At the top level of an instruction (perhaps under PARALLEL).
@@ -743,69 +758,69 @@ DEF_RTL_EXPR(PREFETCH, "prefetch", "eee"
    ALL assignment must use SET.
    Instructions that do multiple assignments must use multiple SET,
    under PARALLEL.  */
-DEF_RTL_EXPR(SET, "set", "ee", 'x')
+DEF_RTL_EXPR(SET, "set", "ee", RTX_EXTRA)
 
 /* Indicate something is used in a way that we don't want to explain.
    For example, subroutine calls will use the register
    in which the static chain is passed.  */
-DEF_RTL_EXPR(USE, "use", "e", 'x')
+DEF_RTL_EXPR(USE, "use", "e", RTX_EXTRA)
 
 /* Indicate something is clobbered in a way that we don't want to explain.
    For example, subroutine calls will clobber some physical registers
    (the ones that are by convention not saved).  */
-DEF_RTL_EXPR(CLOBBER, "clobber", "e", 'x')
+DEF_RTL_EXPR(CLOBBER, "clobber", "e", RTX_EXTRA)
 
 /* Call a subroutine.
    Operand 1 is the address to call.
    Operand 2 is the number of arguments.  */
 
-DEF_RTL_EXPR(CALL, "call", "ee", 'x')
+DEF_RTL_EXPR(CALL, "call", "ee", RTX_EXTRA)
 
 /* Return from a subroutine.  */
 
-DEF_RTL_EXPR(RETURN, "return", "", 'x')
+DEF_RTL_EXPR(RETURN, "return", "", RTX_EXTRA)
 
 /* Conditional trap.
    Operand 1 is the condition.
    Operand 2 is the trap code.
    For an unconditional trap, make the condition (const_int 1).  */
-DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", 'x')
+DEF_RTL_EXPR(TRAP_IF, "trap_if", "ee", RTX_EXTRA)
 
 /* Placeholder for _Unwind_Resume before we know if a function call
    or a branch is needed.  Operand 1 is the exception region from
    which control is flowing.  */
-DEF_RTL_EXPR(RESX, "resx", "i", 'x')
+DEF_RTL_EXPR(RESX, "resx", "i", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Primitive values for use in expressions.
    ---------------------------------------------------------------------- */
 
 /* numeric integer constant */
-DEF_RTL_EXPR(CONST_INT, "const_int", "w", 'o')
+DEF_RTL_EXPR(CONST_INT, "const_int", "w", RTX_CONST_OBJ)
 
 /* numeric floating point constant.
    Operands hold the value.  They are all 'w' and there may be from 2 to 6;
    see real.h.  */
-DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, 'o')
+DEF_RTL_EXPR(CONST_DOUBLE, "const_double", CONST_DOUBLE_FORMAT, RTX_CONST_OBJ)
 
 /* Describes a vector constant.  */
-DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", 'x')
+DEF_RTL_EXPR(CONST_VECTOR, "const_vector", "E", RTX_EXTRA)
 
 /* String constant.  Used only for attributes right now.  */
-DEF_RTL_EXPR(CONST_STRING, "const_string", "s", 'o')
+DEF_RTL_EXPR(CONST_STRING, "const_string", "s", RTX_OBJ)
 
 /* This is used to encapsulate an expression whose value is constant
    (such as the sum of a SYMBOL_REF and a CONST_INT) so that it will be
    recognized as a constant operand rather than by arithmetic instructions.  */
 
-DEF_RTL_EXPR(CONST, "const", "e", 'o')
+DEF_RTL_EXPR(CONST, "const", "e", RTX_CONST_OBJ)
 
 /* program counter.  Ordinary jumps are represented
    by a SET whose first operand is (PC).  */
-DEF_RTL_EXPR(PC, "pc", "", 'o')
+DEF_RTL_EXPR(PC, "pc", "", RTX_OBJ)
 
 /* Used in the cselib routines to describe a value.  */
-DEF_RTL_EXPR(VALUE, "value", "0", 'o')
+DEF_RTL_EXPR(VALUE, "value", "0", RTX_OBJ)
 
 /* A register.  The "operand" is the register number, accessed with
    the REGNO macro.  If this number is less than FIRST_PSEUDO_REGISTER
@@ -814,14 +829,14 @@ DEF_RTL_EXPR(VALUE, "value", "0", 'o')
    pseudo register that got turned into a hard register.
    This rtx needs to have as many (or more) fields as a MEM, since we
    can change REG rtx's into MEMs during reload.  */
-DEF_RTL_EXPR(REG, "reg", "i00", 'o')
+DEF_RTL_EXPR(REG, "reg", "i00", RTX_OBJ)
 
 /* A scratch register.  This represents a register used only within a
    single insn.  It will be turned into a REG during register allocation
    or reload unless the constraint indicates that the register won't be
    needed, in which case it can remain a SCRATCH.  This code is
    marked as having one operand so it can be turned into a REG.  */
-DEF_RTL_EXPR(SCRATCH, "scratch", "0", 'o')
+DEF_RTL_EXPR(SCRATCH, "scratch", "0", RTX_OBJ)
 
 /* One word of a multi-word value.
    The first operand is the complete value; the second says which word.
@@ -831,7 +846,7 @@ DEF_RTL_EXPR(SCRATCH, "scratch", "0", 'o
    This is also used to refer to a value in a different machine mode.
    For example, it can be used to refer to a SImode value as if it were
    Qimode, or vice versa.  Then the word number is always 0.  */
-DEF_RTL_EXPR(SUBREG, "subreg", "ei", 'x')
+DEF_RTL_EXPR(SUBREG, "subreg", "ei", RTX_EXTRA)
 
 /* This one-argument rtx is used for move instructions
    that are guaranteed to alter only the low part of a destination.
@@ -844,38 +859,38 @@ DEF_RTL_EXPR(SUBREG, "subreg", "ei", 'x'
    but the register constraints may be tighter when STRICT_LOW_PART
    is in use.  */
 
-DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", 'x')
+DEF_RTL_EXPR(STRICT_LOW_PART, "strict_low_part", "e", RTX_EXTRA)
 
 /* (CONCAT a b) represents the virtual concatenation of a and b
    to make a value that has as many bits as a and b put together.
    This is used for complex values.  Normally it appears only
    in DECL_RTLs and during RTL generation, but not in the insn chain.  */
-DEF_RTL_EXPR(CONCAT, "concat", "ee", 'o')
+DEF_RTL_EXPR(CONCAT, "concat", "ee", RTX_OBJ)
 
 /* A memory location; operand is the address.  The second operand is the
    alias set to which this MEM belongs.  We use `0' instead of `w' for this
    field so that the field need not be specified in machine descriptions.  */
-DEF_RTL_EXPR(MEM, "mem", "e0", 'o')
+DEF_RTL_EXPR(MEM, "mem", "e0", RTX_OBJ)
 
 /* Reference to an assembler label in the code for this function.
    The operand is a CODE_LABEL found in the insn chain.
    The unprinted fields 1 and 2 are used in flow.c for the
    LABEL_NEXTREF and CONTAINING_INSN.  */
-DEF_RTL_EXPR(LABEL_REF, "label_ref", "u00", 'o')
+DEF_RTL_EXPR(LABEL_REF, "label_ref", "u00", RTX_CONST_OBJ)
 
 /* Reference to a named label: 
    Operand 0: label name
    Operand 1: flags (see SYMBOL_FLAG_* in rtl.h)
    Operand 2: tree from which this symbol is derived, or null.
    This is either a DECL node, or some kind of constant.  */
-DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s00", 'o')
+DEF_RTL_EXPR(SYMBOL_REF, "symbol_ref", "s00", RTX_CONST_OBJ)
 
 /* The condition code register is represented, in our imagination,
    as a register holding a value that can be compared to zero.
    In fact, the machine has already compared them and recorded the
    results; but instructions that look at the condition code
    pretend to be looking at the entire value and comparing it.  */
-DEF_RTL_EXPR(CC0, "cc0", "", 'o')
+DEF_RTL_EXPR(CC0, "cc0", "", RTX_OBJ)
 
 /* Reference to the address of a register.  Removed by purge_addressof after
    CSE has elided as many as possible.
@@ -884,7 +899,7 @@ DEF_RTL_EXPR(CC0, "cc0", "", 'o')
    3rd operand: the decl for the object in the register, for
      put_reg_in_stack.  */
 
-DEF_RTL_EXPR(ADDRESSOF, "addressof", "eit", 'o')
+DEF_RTL_EXPR(ADDRESSOF, "addressof", "eit", RTX_OBJ)
 
 /* =====================================================================
    A QUEUED expression really points to a member of the queue of instructions
@@ -902,7 +917,7 @@ DEF_RTL_EXPR(ADDRESSOF, "addressof", "ei
    4. the next QUEUED expression in the queue.
    ====================================================================== */
 
-DEF_RTL_EXPR(QUEUED, "queued", "eeeee", 'x')
+DEF_RTL_EXPR(QUEUED, "queued", "eeeee", RTX_EXTRA)
 
 /* ----------------------------------------------------------------------
    Expressions for operators in an rtl pattern
@@ -914,7 +929,7 @@ DEF_RTL_EXPR(QUEUED, "queued", "eeeee", 
      0:  condition
      1:  then expr
      2:  else expr */
-DEF_RTL_EXPR(IF_THEN_ELSE, "if_then_else", "eee", '3')
+DEF_RTL_EXPR(IF_THEN_ELSE, "if_then_else", "eee", RTX_TERNARY)
 
 /* General conditional. The first operand is a vector composed of pairs of
    expressions.  The first element of each pair is evaluated, in turn.
@@ -923,57 +938,57 @@ DEF_RTL_EXPR(IF_THEN_ELSE, "if_then_else
    true, the second operand will be used as the value of the conditional.
 
    This should be replaced with use of IF_THEN_ELSE.  */
-DEF_RTL_EXPR(COND, "cond", "Ee", 'x')
+DEF_RTL_EXPR(COND, "cond", "Ee", RTX_EXTRA)
 
 /* Comparison, produces a condition code result.  */
-DEF_RTL_EXPR(COMPARE, "compare", "ee", '2')
+DEF_RTL_EXPR(COMPARE, "compare", "ee", RTX_BIN_ARITH)
 
 /* plus */
-DEF_RTL_EXPR(PLUS, "plus", "ee", 'c')
+DEF_RTL_EXPR(PLUS, "plus", "ee", RTX_COMM_ARITH)
 
 /* Operand 0 minus operand 1.  */
-DEF_RTL_EXPR(MINUS, "minus", "ee", '2')
+DEF_RTL_EXPR(MINUS, "minus", "ee", RTX_BIN_ARITH)
 
 /* Minus operand 0.  */
-DEF_RTL_EXPR(NEG, "neg", "e", '1')
+DEF_RTL_EXPR(NEG, "neg", "e", RTX_UNARY)
 
-DEF_RTL_EXPR(MULT, "mult", "ee", 'c')
+DEF_RTL_EXPR(MULT, "mult", "ee", RTX_COMM_ARITH)
 
 /* Operand 0 divided by operand 1.  */
-DEF_RTL_EXPR(DIV, "div", "ee", '2')
+DEF_RTL_EXPR(DIV, "div", "ee", RTX_BIN_ARITH)
 /* Remainder of operand 0 divided by operand 1.  */
-DEF_RTL_EXPR(MOD, "mod", "ee", '2')
+DEF_RTL_EXPR(MOD, "mod", "ee", RTX_BIN_ARITH)
 
 /* Unsigned divide and remainder.  */
-DEF_RTL_EXPR(UDIV, "udiv", "ee", '2')
-DEF_RTL_EXPR(UMOD, "umod", "ee", '2')
+DEF_RTL_EXPR(UDIV, "udiv", "ee", RTX_BIN_ARITH)
+DEF_RTL_EXPR(UMOD, "umod", "ee", RTX_BIN_ARITH)
 
 /* Bitwise operations.  */
-DEF_RTL_EXPR(AND, "and", "ee", 'c')
+DEF_RTL_EXPR(AND, "and", "ee", RTX_COMM_ARITH)
 
-DEF_RTL_EXPR(IOR, "ior", "ee", 'c')
+DEF_RTL_EXPR(IOR, "ior", "ee", RTX_COMM_ARITH)
 
-DEF_RTL_EXPR(XOR, "xor", "ee", 'c')
+DEF_RTL_EXPR(XOR, "xor", "ee", RTX_COMM_ARITH)
 
-DEF_RTL_EXPR(NOT, "not", "e", '1')
+DEF_RTL_EXPR(NOT, "not", "e", RTX_UNARY)
 
 /* Operand:
      0:  value to be shifted.
      1:  number of bits.  */
-DEF_RTL_EXPR(ASHIFT, "ashift", "ee", '2') /* shift left */
-DEF_RTL_EXPR(ROTATE, "rotate", "ee", '2') /* rotate left */
-DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", '2') /* arithmetic shift right */
-DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", '2') /* logical shift right */
-DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", '2') /* rotate right */
+DEF_RTL_EXPR(ASHIFT, "ashift", "ee", RTX_BIN_ARITH) /* shift left */
+DEF_RTL_EXPR(ROTATE, "rotate", "ee", RTX_BIN_ARITH) /* rotate left */
+DEF_RTL_EXPR(ASHIFTRT, "ashiftrt", "ee", RTX_BIN_ARITH) /* arithmetic shift right */
+DEF_RTL_EXPR(LSHIFTRT, "lshiftrt", "ee", RTX_BIN_ARITH) /* logical shift right */
+DEF_RTL_EXPR(ROTATERT, "rotatert", "ee", RTX_BIN_ARITH) /* rotate right */
 
 /* Minimum and maximum values of two operands.  We need both signed and
    unsigned forms.  (We cannot use MIN for SMIN because it conflicts
    with a macro of the same name.) */
 
-DEF_RTL_EXPR(SMIN, "smin", "ee", 'c')
-DEF_RTL_EXPR(SMAX, "smax", "ee", 'c')
-DEF_RTL_EXPR(UMIN, "umin", "ee", 'c')
-DEF_RTL_EXPR(UMAX, "umax", "ee", 'c')
+DEF_RTL_EXPR(SMIN, "smin", "ee", RTX_COMM_ARITH)
+DEF_RTL_EXPR(SMAX, "smax", "ee", RTX_COMM_ARITH)
+DEF_RTL_EXPR(UMIN, "umin", "ee", RTX_COMM_ARITH)
+DEF_RTL_EXPR(UMAX, "umax", "ee", RTX_COMM_ARITH)
 
 /* These unary operations are used to represent incrementation
    and decrementation as they occur in memory addresses.
@@ -982,10 +997,10 @@ DEF_RTL_EXPR(UMAX, "umax", "ee", 'c')
    containing MEM.  These operations exist in only two cases:
    1. pushes onto the stack.
    2. created automatically by the life_analysis pass in flow.c.  */
-DEF_RTL_EXPR(PRE_DEC, "pre_dec", "e", 'a')
-DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", 'a')
-DEF_RTL_EXPR(POST_DEC, "post_dec", "e", 'a')
-DEF_RTL_EXPR(POST_INC, "post_inc", "e", 'a')
+DEF_RTL_EXPR(PRE_DEC, "pre_dec", "e", RTX_AUTOINC)
+DEF_RTL_EXPR(PRE_INC, "pre_inc", "e", RTX_AUTOINC)
+DEF_RTL_EXPR(POST_DEC, "post_dec", "e", RTX_AUTOINC)
+DEF_RTL_EXPR(POST_INC, "post_inc", "e", RTX_AUTOINC)
 
 /* These binary operations are used to represent generic address
    side-effects in memory addresses, except for simple incrementation
@@ -999,53 +1014,53 @@ DEF_RTL_EXPR(POST_INC, "post_inc", "e", 
    form (plus (reg) (reg)) and (plus (reg) (const_int)), where
    the first operand of the PLUS has to be the same register as
    the first operand of the *_MODIFY.  */
-DEF_RTL_EXPR(PRE_MODIFY, "pre_modify", "ee", 'a')
-DEF_RTL_EXPR(POST_MODIFY, "post_modify", "ee", 'a')
+DEF_RTL_EXPR(PRE_MODIFY, "pre_modify", "ee", RTX_AUTOINC)
+DEF_RTL_EXPR(POST_MODIFY, "post_modify", "ee", RTX_AUTOINC)
 
 /* Comparison operations.  The ordered comparisons exist in two
    flavors, signed and unsigned.  */
-DEF_RTL_EXPR(NE, "ne", "ee", '<')
-DEF_RTL_EXPR(EQ, "eq", "ee", '<')
-DEF_RTL_EXPR(GE, "ge", "ee", '<')
-DEF_RTL_EXPR(GT, "gt", "ee", '<')
-DEF_RTL_EXPR(LE, "le", "ee", '<')
-DEF_RTL_EXPR(LT, "lt", "ee", '<')
-DEF_RTL_EXPR(GEU, "geu", "ee", '<')
-DEF_RTL_EXPR(GTU, "gtu", "ee", '<')
-DEF_RTL_EXPR(LEU, "leu", "ee", '<')
-DEF_RTL_EXPR(LTU, "ltu", "ee", '<')
+DEF_RTL_EXPR(NE, "ne", "ee", RTX_COMM_COMPARE)
+DEF_RTL_EXPR(EQ, "eq", "ee", RTX_COMM_COMPARE)
+DEF_RTL_EXPR(GE, "ge", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(GT, "gt", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(LE, "le", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(LT, "lt", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(GEU, "geu", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(GTU, "gtu", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(LEU, "leu", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(LTU, "ltu", "ee", RTX_COMPARE)
 
 /* Additional floating point unordered comparison flavors.  */
-DEF_RTL_EXPR(UNORDERED, "unordered", "ee", '<')
-DEF_RTL_EXPR(ORDERED, "ordered", "ee", '<')
+DEF_RTL_EXPR(UNORDERED, "unordered", "ee", RTX_COMM_COMPARE)
+DEF_RTL_EXPR(ORDERED, "ordered", "ee", RTX_COMM_COMPARE)
 
 /* These are equivalent to unordered or ...  */
-DEF_RTL_EXPR(UNEQ, "uneq", "ee", '<')
-DEF_RTL_EXPR(UNGE, "unge", "ee", '<')
-DEF_RTL_EXPR(UNGT, "ungt", "ee", '<')
-DEF_RTL_EXPR(UNLE, "unle", "ee", '<')
-DEF_RTL_EXPR(UNLT, "unlt", "ee", '<')
+DEF_RTL_EXPR(UNEQ, "uneq", "ee", RTX_COMM_COMPARE)
+DEF_RTL_EXPR(UNGE, "unge", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(UNGT, "ungt", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(UNLE, "unle", "ee", RTX_COMPARE)
+DEF_RTL_EXPR(UNLT, "unlt", "ee", RTX_COMPARE)
 
 /* This is an ordered NE, ie !UNEQ, ie false for NaN.  */
-DEF_RTL_EXPR(LTGT, "ltgt", "ee", '<')
+DEF_RTL_EXPR(LTGT, "ltgt", "ee", RTX_COMM_COMPARE)
 
 /* Represents the result of sign-extending the sole operand.
    The machine modes of the operand and of the SIGN_EXTEND expression
    determine how much sign-extension is going on.  */
-DEF_RTL_EXPR(SIGN_EXTEND, "sign_extend", "e", '1')
+DEF_RTL_EXPR(SIGN_EXTEND, "sign_extend", "e", RTX_UNARY)
 
 /* Similar for zero-extension (such as unsigned short to int).  */
-DEF_RTL_EXPR(ZERO_EXTEND, "zero_extend", "e", '1')
+DEF_RTL_EXPR(ZERO_EXTEND, "zero_extend", "e", RTX_UNARY)
 
 /* Similar but here the operand has a wider mode.  */
-DEF_RTL_EXPR(TRUNCATE, "truncate", "e", '1')
+DEF_RTL_EXPR(TRUNCATE, "truncate", "e", RTX_UNARY)
 
 /* Similar for extending floating-point values (such as SFmode to DFmode).  */
-DEF_RTL_EXPR(FLOAT_EXTEND, "float_extend", "e", '1')
-DEF_RTL_EXPR(FLOAT_TRUNCATE, "float_truncate", "e", '1')
+DEF_RTL_EXPR(FLOAT_EXTEND, "float_extend", "e", RTX_UNARY)
+DEF_RTL_EXPR(FLOAT_TRUNCATE, "float_truncate", "e", RTX_UNARY)
 
 /* Conversion of fixed point operand to floating point value.  */
-DEF_RTL_EXPR(FLOAT, "float", "e", '1')
+DEF_RTL_EXPR(FLOAT, "float", "e", RTX_UNARY)
 
 /* With fixed-point machine mode:
    Conversion of floating point operand to fixed point value.
@@ -1053,38 +1068,38 @@ DEF_RTL_EXPR(FLOAT, "float", "e", '1')
    With floating-point machine mode (and operand with same mode):
    Operand is rounded toward zero to produce an integer value
    represented in floating point.  */
-DEF_RTL_EXPR(FIX, "fix", "e", '1')
+DEF_RTL_EXPR(FIX, "fix", "e", RTX_UNARY)
 
 /* Conversion of unsigned fixed point operand to floating point value.  */
-DEF_RTL_EXPR(UNSIGNED_FLOAT, "unsigned_float", "e", '1')
+DEF_RTL_EXPR(UNSIGNED_FLOAT, "unsigned_float", "e", RTX_UNARY)
 
 /* With fixed-point machine mode:
    Conversion of floating point operand to *unsigned* fixed point value.
    Value is defined only when the operand's value is an integer.  */
-DEF_RTL_EXPR(UNSIGNED_FIX, "unsigned_fix", "e", '1')
+DEF_RTL_EXPR(UNSIGNED_FIX, "unsigned_fix", "e", RTX_UNARY)
 
 /* Absolute value */
-DEF_RTL_EXPR(ABS, "abs", "e", '1')
+DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY)
 
 /* Square root */
-DEF_RTL_EXPR(SQRT, "sqrt", "e", '1')
+DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY)
 
 /* Find first bit that is set.
    Value is 1 + number of trailing zeros in the arg.,
    or 0 if arg is 0.  */
-DEF_RTL_EXPR(FFS, "ffs", "e", '1')
+DEF_RTL_EXPR(FFS, "ffs", "e", RTX_UNARY)
 
 /* Count leading zeros.  */
-DEF_RTL_EXPR(CLZ, "clz", "e", '1')
+DEF_RTL_EXPR(CLZ, "clz", "e", RTX_UNARY)
 
 /* Count trailing zeros.  */
-DEF_RTL_EXPR(CTZ, "ctz", "e", '1')
+DEF_RTL_EXPR(CTZ, "ctz", "e", RTX_UNARY)
 
 /* Population count (number of 1 bits).  */
-DEF_RTL_EXPR(POPCOUNT, "popcount", "e", '1')
+DEF_RTL_EXPR(POPCOUNT, "popcount", "e", RTX_UNARY)
 
 /* Population parity (number of 1 bits modulo 2).  */
-DEF_RTL_EXPR(PARITY, "parity", "e", '1')
+DEF_RTL_EXPR(PARITY, "parity", "e", RTX_UNARY)
 
 /* Reference to a signed bit-field of specified size and position.
    Operand 0 is the memory unit (usually SImode or QImode) which
@@ -1095,19 +1110,19 @@ DEF_RTL_EXPR(PARITY, "parity", "e", '1')
    operand 2 counts from the msb of the memory unit.
    Otherwise, the first bit is the lsb and operand 2 counts from
    the lsb of the memory unit.  */
-DEF_RTL_EXPR(SIGN_EXTRACT, "sign_extract", "eee", 'b')
+DEF_RTL_EXPR(SIGN_EXTRACT, "sign_extract", "eee", RTX_BITFIELD_OPS)
 
 /* Similar for unsigned bit-field.  */
-DEF_RTL_EXPR(ZERO_EXTRACT, "zero_extract", "eee", 'b')
+DEF_RTL_EXPR(ZERO_EXTRACT, "zero_extract", "eee", RTX_BITFIELD_OPS)
 
 /* For RISC machines.  These save memory when splitting insns.  */
 
 /* HIGH are the high-order bits of a constant expression.  */
-DEF_RTL_EXPR(HIGH, "high", "e", 'o')
+DEF_RTL_EXPR(HIGH, "high", "e", RTX_CONST_OBJ)
 
 /* LO_SUM is the sum of a register and the low-order bits
    of a constant expression.  */
-DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", 'o')
+DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", RTX_OBJ)
 
 /* Header for range information.  Operand 0 is the NOTE_INSN_RANGE_BEG insn.
    Operand 1 is the NOTE_INSN_RANGE_END insn.  Operand 2 is a vector of all of
@@ -1120,7 +1135,7 @@ DEF_RTL_EXPR(LO_SUM, "lo_sum", "ee", 'o'
    is a bitmap of the registers live at the end of the range.  Operand 11 is
    marker number for the start of the range.  Operand 12 is the marker number
    for the end of the range.  */
-DEF_RTL_EXPR(RANGE_INFO, "range_info", "uuEiiiiiibbii", 'x')
+DEF_RTL_EXPR(RANGE_INFO, "range_info", "uuEiiiiiibbii", RTX_EXTRA)
 
 /* Registers that can be substituted within the range.  Operand 0 is the
    original pseudo register number.  Operand 1 will be filled in with the
@@ -1135,22 +1150,22 @@ DEF_RTL_EXPR(RANGE_INFO, "range_info", "
    across.  Operand 8 is the symbol node of the variable if the register is a
    user variable.  Operand 9 is the block node that the variable is declared
    in if the register is a user variable.  */
-DEF_RTL_EXPR(RANGE_REG, "range_reg", "iiiiiiiitt", 'x')
+DEF_RTL_EXPR(RANGE_REG, "range_reg", "iiiiiiiitt", RTX_EXTRA)
 
 /* Information about a local variable's ranges.  Operand 0 is an EXPR_LIST of
    the different ranges a variable is in where it is copied to a different
    pseudo register.  Operand 1 is the block that the variable is declared in.
    Operand 2 is the number of distinct ranges.  */
-DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", 'x')
+DEF_RTL_EXPR(RANGE_VAR, "range_var", "eti", RTX_EXTRA)
 
 /* Information about the registers that are live at the current point.  Operand
    0 is the live bitmap.  Operand 1 is the original block number.  */
-DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", 'x')
+DEF_RTL_EXPR(RANGE_LIVE, "range_live", "bi", RTX_EXTRA)
 
 /* A unary `__builtin_constant_p' expression.  These are only emitted
    during RTL generation, and then only if optimize > 0.  They are
    eliminated by the first CSE pass.  */
-DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", 'x')
+DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p_rtx", "e", RTX_EXTRA)
 
 /* A placeholder for a CALL_INSN which may be turned into a normal call,
    a sibling (tail) call or tail recursion.
@@ -1171,49 +1186,49 @@ DEF_RTL_EXPR(CONSTANT_P_RTX, "constant_p
 
    This method of tail-call elimination is intended to be replaced by
    tree-based optimizations once front-end conversions are complete.  */
-DEF_RTL_EXPR(CALL_PLACEHOLDER, "call_placeholder", "uuuu", 'x')
+DEF_RTL_EXPR(CALL_PLACEHOLDER, "call_placeholder", "uuuu", RTX_EXTRA)
 
 /* Describes a merge operation between two vector values.
    Operands 0 and 1 are the vectors to be merged, operand 2 is a bitmask
    that specifies where the parts of the result are taken from.  Set bits
    indicate operand 0, clear bits indicate operand 1.  The parts are defined
    by the mode of the vectors.  */
-DEF_RTL_EXPR(VEC_MERGE, "vec_merge", "eee", '3')
+DEF_RTL_EXPR(VEC_MERGE, "vec_merge", "eee", RTX_TERNARY)
 
 /* Describes an operation that selects parts of a vector.
    Operands 0 is the source vector, operand 1 is a PARALLEL that contains
    a CONST_INT for each of the subparts of the result vector, giving the
    number of the source subpart that should be stored into it.  */
-DEF_RTL_EXPR(VEC_SELECT, "vec_select", "ee", '2')
+DEF_RTL_EXPR(VEC_SELECT, "vec_select", "ee", RTX_BIN_ARITH)
 
 /* Describes a vector concat operation.  Operands 0 and 1 are the source
    vectors, the result is a vector that is as long as operands 0 and 1
    combined and is the concatenation of the two source vectors.  */
-DEF_RTL_EXPR(VEC_CONCAT, "vec_concat", "ee", '2')
+DEF_RTL_EXPR(VEC_CONCAT, "vec_concat", "ee", RTX_BIN_ARITH)
 
 /* Describes an operation that converts a small vector into a larger one by
    duplicating the input values.  The output vector mode must have the same
    submodes as the input vector mode, and the number of output parts must be
    an integer multiple of the number of input parts.  */
-DEF_RTL_EXPR(VEC_DUPLICATE, "vec_duplicate", "e", '1')
+DEF_RTL_EXPR(VEC_DUPLICATE, "vec_duplicate", "e", RTX_UNARY)
      
 /* Addition with signed saturation */
-DEF_RTL_EXPR(SS_PLUS, "ss_plus", "ee", 'c')
+DEF_RTL_EXPR(SS_PLUS, "ss_plus", "ee", RTX_COMM_ARITH)
 
 /* Addition with unsigned saturation */
-DEF_RTL_EXPR(US_PLUS, "us_plus", "ee", 'c')
+DEF_RTL_EXPR(US_PLUS, "us_plus", "ee", RTX_COMM_ARITH)
 
 /* Operand 0 minus operand 1, with signed saturation.  */
-DEF_RTL_EXPR(SS_MINUS, "ss_minus", "ee", '2')
+DEF_RTL_EXPR(SS_MINUS, "ss_minus", "ee", RTX_BIN_ARITH)
 
 /* Operand 0 minus operand 1, with unsigned saturation.  */
-DEF_RTL_EXPR(US_MINUS, "us_minus", "ee", '2')
+DEF_RTL_EXPR(US_MINUS, "us_minus", "ee", RTX_BIN_ARITH)
 
 /* Signed saturating truncate.  */
-DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", '1')
+DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", RTX_UNARY)
 
 /* Unsigned saturating truncate.  */
-DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", '1')
+DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", RTX_UNARY)
 
 /* Information about the variable and its location.  */
 DEF_RTL_EXPR(VAR_LOCATION, "var_location", "te", 'x')
Index: rtlanal.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtlanal.c,v
retrieving revision 1.177
diff -u -p -r1.177 rtlanal.c
--- rtlanal.c	6 Feb 2004 04:28:46 -0000	1.177
+++ rtlanal.c	7 Feb 2004 11:42:13 -0000
@@ -3044,7 +3044,7 @@ commutative_operand_precedence (rtx op)
 
   /* SUBREGs of objects should come second.  */
   if (GET_CODE (op) == SUBREG
-      && GET_RTX_CLASS (GET_CODE (SUBREG_REG (op))) == 'o')
+      && OBJECT_P (SUBREG_REG (op)))
     return -2;
 
   /* If only one operand is a `neg', `not',
@@ -3057,7 +3057,7 @@ commutative_operand_precedence (rtx op)
 
   /* Complex expressions should be the first, so decrease priority
      of objects.  */
-  if (GET_RTX_CLASS (GET_CODE (op)) == 'o')
+  if (OBJECT_P (op))
     return -1;
   return 0;
 }
Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.68
diff -u -p -r1.68 sched-deps.c
--- sched-deps.c	3 Feb 2004 05:39:53 -0000	1.68
+++ sched-deps.c	7 Feb 2004 11:42:13 -0000
@@ -171,8 +171,8 @@ get_condition (rtx insn)
 static int
 conditions_mutex_p (rtx cond1, rtx cond2)
 {
-  if (GET_RTX_CLASS (GET_CODE (cond1)) == '<'
-      && GET_RTX_CLASS (GET_CODE (cond2)) == '<'
+  if (COMPARISON_P (cond1)
+      && COMPARISON_P (cond1)
       && GET_CODE (cond1) == reverse_condition (GET_CODE (cond2))
       && XEXP (cond1, 0) == XEXP (cond2, 0)
       && XEXP (cond1, 1) == XEXP (cond2, 1))
Index: sched-rgn.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-rgn.c,v
retrieving revision 1.70
diff -u -p -r1.70 sched-rgn.c
--- sched-rgn.c	4 Feb 2004 19:15:22 -0000	1.70
+++ sched-rgn.c	7 Feb 2004 11:42:14 -0000
@@ -346,7 +346,7 @@ is_cfg_nonregular (void)
     for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn))
       {
 	code = GET_CODE (insn);
-	if (GET_RTX_CLASS (code) == 'i' && code != JUMP_INSN)
+	if (INSN_P (insn) && code != JUMP_INSN)
 	  {
 	    rtx note = find_reg_note (insn, REG_LABEL, NULL_RTX);
 
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.176
diff -u -p -r1.176 simplify-rtx.c
--- simplify-rtx.c	24 Jan 2004 11:01:25 -0000	1.176
+++ simplify-rtx.c	7 Feb 2004 11:42:14 -0000
@@ -77,7 +77,7 @@ simplify_gen_binary (enum rtx_code code,
   rtx tem;
 
   /* Put complex operands first and constants second if commutative.  */
-  if (GET_RTX_CLASS (code) == 'c'
+  if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
       && swap_commutative_operands_p (op0, op1))
     tem = op0, op0 = op1, op1 = tem;
 
@@ -236,7 +236,7 @@ simplify_gen_relational (enum rtx_code c
 				    XEXP (op0, 0), XEXP (op0, 1));
 
   /* If op0 is a comparison, extract the comparison arguments form it.  */
-  if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && op1 == const0_rtx)
+  if (COMPARISON_P (op0) && op1 == const0_rtx)
     {
       if (code == NE)
 	{
@@ -277,7 +277,7 @@ simplify_replace_rtx (rtx x, rtx old, rt
 
   switch (GET_RTX_CLASS (code))
     {
-    case '1':
+    case RTX_UNARY:
       op0 = XEXP (x, 0);
       op_mode = GET_MODE (op0);
       op0 = simplify_replace_rtx (op0, old, new);
@@ -285,15 +285,16 @@ simplify_replace_rtx (rtx x, rtx old, rt
 	return x;
       return simplify_gen_unary (code, mode, op0, op_mode);
 
-    case '2':
-    case 'c':
+    case RTX_BIN_ARITH:
+    case RTX_COMM_ARITH:
       op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
       op1 = simplify_replace_rtx (XEXP (x, 1), old, new);
       if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
 	return x;
       return simplify_gen_binary (code, mode, op0, op1);
 
-    case '<':
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
       op0 = XEXP (x, 0);
       op1 = XEXP (x, 1);
       op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
@@ -303,8 +304,8 @@ simplify_replace_rtx (rtx x, rtx old, rt
 	return x;
       return simplify_gen_relational (code, mode, op_mode, op0, op1);
 
-    case '3':
-    case 'b':
+    case RTX_TERNARY:
+    case RTX_BITFIELD_OPS:
       op0 = XEXP (x, 0);
       op_mode = GET_MODE (op0);
       op0 = simplify_replace_rtx (op0, old, new);
@@ -316,7 +317,7 @@ simplify_replace_rtx (rtx x, rtx old, rt
 	op_mode = GET_MODE (op0);
       return simplify_gen_ternary (code, mode, op_mode, op0, op1, op2);
 
-    case 'x':
+    case RTX_EXTRA:
       /* The only case we try to handle is a SUBREG.  */
       if (code == SUBREG)
 	{
@@ -330,7 +331,7 @@ simplify_replace_rtx (rtx x, rtx old, rt
 	}
       break;
 
-    case 'o':
+    case RTX_OBJ:
       if (code == MEM)
 	{
 	  op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
@@ -893,7 +894,7 @@ simplify_unary_operation (enum rtx_code 
 	    return XEXP (op, 0);
 
 	  /* (not (eq X Y)) == (ne X Y), etc.  */
-	  if (GET_RTX_CLASS (GET_CODE (op)) == '<'
+	  if (COMPARISON_P (op)
 	      && (mode == BImode || STORE_FLAG_VALUE == -1)
 	      && ((reversed = reversed_comparison_code (op, NULL_RTX))
 		  != UNKNOWN))
@@ -933,7 +934,7 @@ simplify_unary_operation (enum rtx_code 
 	  /* If STORE_FLAG_VALUE is -1, (not (comparison X Y)) can be done
 	     by reversing the comparison code if valid.  */
 	  if (STORE_FLAG_VALUE == -1
-	      && GET_RTX_CLASS (GET_CODE (op)) == '<'
+	      && COMPARISON_P (op)
 	      && (reversed = reversed_comparison_code (op, NULL_RTX))
 		 != UNKNOWN)
 	    return simplify_gen_relational (reversed, mode, VOIDmode,
@@ -1156,16 +1157,19 @@ simplify_binary_operation (enum rtx_code
   rtx trueop0, trueop1;
   rtx tem;
 
+#ifdef ENABLE_CHECKING
   /* Relational operations don't work here.  We must know the mode
      of the operands in order to do the comparison correctly.
      Assuming a full word can give incorrect results.
      Consider comparing 128 with -128 in QImode.  */
 
-  if (GET_RTX_CLASS (code) == '<')
+  if (GET_RTX_CLASS (code) == RTX_COMPARE
+      || GET_RTX_CLASS (code) == RTX_COMM_COMPARE)
     abort ();
+#endif
 
   /* Make sure the constant is second.  */
-  if (GET_RTX_CLASS (code) == 'c'
+  if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
       && swap_commutative_operands_p (op0, op1))
     {
       tem = op0, op0 = op1, op1 = tem;
@@ -2854,7 +2858,7 @@ simplify_ternary_operation (enum rtx_cod
 		  && rtx_equal_p (XEXP (op0, 1), op1))))
 	return op2;
 
-      if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0))
+      if (COMPARISON_P (op0) && ! side_effects_p (op0))
 	{
 	  enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode
 					? GET_MODE (XEXP (op0, 1))
@@ -3505,25 +3509,26 @@ simplify_rtx (rtx x)
 
   switch (GET_RTX_CLASS (code))
     {
-    case '1':
+    case RTX_UNARY:
       return simplify_unary_operation (code, mode,
 				       XEXP (x, 0), GET_MODE (XEXP (x, 0)));
-    case 'c':
+    case RTX_COMM_ARITH:
       if (swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
 	return simplify_gen_binary (code, mode, XEXP (x, 1), XEXP (x, 0));
 
       /* Fall through....  */
 
-    case '2':
+    case RTX_BIN_ARITH:
       return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
 
-    case '3':
-    case 'b':
+    case RTX_TERNARY:
+    case RTX_BITFIELD_OPS:
       return simplify_ternary_operation (code, mode, GET_MODE (XEXP (x, 0)),
 					 XEXP (x, 0), XEXP (x, 1),
 					 XEXP (x, 2));
 
-    case '<':
+    case RTX_COMPARE:
+    case RTX_COMM_COMPARE:
       temp = simplify_relational_operation (code,
 					    ((GET_MODE (XEXP (x, 0))
 					      != VOIDmode)
@@ -3542,7 +3547,7 @@ simplify_rtx (rtx x)
 #endif
       return temp;
 
-    case 'x':
+    case RTX_EXTRA:
       if (code == SUBREG)
 	return simplify_gen_subreg (mode, SUBREG_REG (x),
 				    GET_MODE (SUBREG_REG (x)),
@@ -3554,7 +3559,7 @@ simplify_rtx (rtx x)
 	}
       break;
 
-    case 'o':
+    case RTX_OBJ:
       if (code == LO_SUM)
 	{
 	  /* Convert (lo_sum (high FOO) FOO) to FOO.  */
Index: unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.205
diff -u -p -r1.205 unroll.c
--- unroll.c	1 Dec 2003 21:57:07 -0000	1.205
+++ unroll.c	7 Feb 2004 11:42:14 -0000
@@ -2872,7 +2872,6 @@ static int
 reg_dead_after_loop (const struct loop *loop, rtx reg)
 {
   rtx insn, label;
-  enum rtx_code code;
   int jump_count = 0;
   int label_count = 0;
 
@@ -2902,8 +2901,7 @@ reg_dead_after_loop (const struct loop *
       insn = NEXT_INSN (XEXP (label, 0));
       while (insn)
 	{
-	  code = GET_CODE (insn);
-	  if (GET_RTX_CLASS (code) == 'i')
+	  if (INSN_P (insn))
 	    {
 	      rtx set, note;
 
@@ -2917,18 +2915,18 @@ reg_dead_after_loop (const struct loop *
 	      set = single_set (insn);
 	      if (set && rtx_equal_p (SET_DEST (set), reg))
 		break;
-	    }
 
-	  if (code == JUMP_INSN)
-	    {
-	      if (GET_CODE (PATTERN (insn)) == RETURN)
-		break;
-	      else if (!any_uncondjump_p (insn)
-		       /* Prevent infinite loop following infinite loops.  */
-		       || jump_count++ > 20)
-		return 0;
-	      else
-		insn = JUMP_LABEL (insn);
+	      if (GET_CODE (insn) == JUMP_INSN)
+		{
+		  if (GET_CODE (PATTERN (insn)) == RETURN)
+		    break;
+		  else if (!any_uncondjump_p (insn)
+		           /* Prevent infinite loop following infinite loops.  */
+		           || jump_count++ > 20)
+		    return 0;
+		  else
+		    insn = JUMP_LABEL (insn);
+		}
 	    }
 
 	  insn = NEXT_INSN (insn);
Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.351
diff -u -p -r1.351 alpha.c
--- config/alpha/alpha.c	4 Feb 2004 20:26:58 -0000	1.351
+++ config/alpha/alpha.c	7 Feb 2004 11:42:15 -0000
@@ -1134,13 +1134,13 @@ alpha_zero_comparison_operator (rtx op, 
 int
 alpha_swapped_comparison_operator (rtx op, enum machine_mode mode)
 {
-  enum rtx_code code = GET_CODE (op);
+  enum rtx_code code;
 
   if ((mode != GET_MODE (op) && mode != VOIDmode)
-      || GET_RTX_CLASS (code) != '<')
+      || COMPARISON_P (op));
     return 0;
 
-  code = swap_condition (code);
+  code = swap_condition (GET_CODE (op));
   return (code == EQ || code == LE || code == LT
 	  || code == LEU || code == LTU);
 }
@@ -5631,7 +5631,7 @@ print_operand (FILE *file, rtx x, int co
       {
 	enum rtx_code c = GET_CODE (x);
 
-        if (GET_RTX_CLASS (c) != '<')
+        if (!COMPARISON_P (x))
 	  output_operand_lossage ("invalid %%C value");
 
 	else if (code == 'D')
Index: config/arc/arc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.c,v
retrieving revision 1.52
diff -u -p -r1.52 arc.c
--- config/arc/arc.c	6 Feb 2004 05:55:03 -0000	1.52
+++ config/arc/arc.c	7 Feb 2004 11:42:16 -0000
@@ -711,11 +711,11 @@ const_uint32_operand (rtx op, enum machi
 int
 proper_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  enum rtx_code code = GET_CODE (op);
-
-  if (GET_RTX_CLASS (code) != '<')
+  enum rtx_code code;
+  if (!COMPARISON_P (op))
     return 0;
 
+  code = GET_CODE (op);
   if (GET_MODE (XEXP (op, 0)) == CCZNmode)
     return (code == EQ || code == NE);
   if (GET_MODE (XEXP (op, 0)) == CCZNCmode)
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.329
diff -u -p -r1.329 arm.c
--- config/arm/arm.c	4 Feb 2004 20:00:52 -0000	1.329
+++ config/arm/arm.c	7 Feb 2004 11:42:16 -0000
@@ -3868,13 +3868,10 @@ arm_arm_address_cost (rtx x)
 
   if (c == PLUS || c == MINUS)
     {
-      char cl0 = GET_RTX_CLASS (GET_CODE (XEXP (x, 0)));
-      char cl1 = GET_RTX_CLASS (GET_CODE (XEXP (x, 1)));
-
       if (GET_CODE (XEXP (x, 0)) == CONST_INT)
 	return 2;
 
-      if (cl0 == '2' || cl0 == 'c' || cl1 == '2' || cl1 == 'c')
+      if (ARITHMETIC_P (XEXP (x, 0)) || ARITHMETIC_P (XEXP (x, 1)))
 	return 3;
 
       return 4;
@@ -6107,21 +6104,21 @@ arm_select_cc_mode (enum rtx_code op, rt
   if (GET_CODE (x) == IF_THEN_ELSE
       && (XEXP (x, 2) == const0_rtx
 	  || XEXP (x, 2) == const1_rtx)
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<')
+      && COMPARISON_P (XEXP (x, 0))
+      && COMPARISON_P (XEXP (x, 1)))
     return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1), 
 					 INTVAL (XEXP (x, 2)));
 
   /* Alternate canonicalizations of the above.  These are somewhat cleaner.  */
   if (GET_CODE (x) == AND
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<')
+      && COMPARISON_P (XEXP (x, 0))
+      && COMPARISON_P (XEXP (x, 1)))
     return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1),
 					 DOM_CC_X_AND_Y);
 
   if (GET_CODE (x) == IOR
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 0))) == '<'
-      && GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == '<')
+      && COMPARISON_P (XEXP (x, 0))
+      && COMPARISON_P (XEXP (x, 1)))
     return arm_select_dominance_cc_mode (XEXP (x, 0), XEXP (x, 1),
 					 DOM_CC_X_OR_Y);
 
Index: config/avr/avr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.c,v
retrieving revision 1.115
diff -u -p -r1.115 avr.c
--- config/avr/avr.c	6 Feb 2004 05:55:05 -0000	1.115
+++ config/avr/avr.c	7 Feb 2004 11:42:17 -0000
@@ -4253,6 +4253,7 @@ _reg_unused_after (rtx insn, rtx reg)
 
   while ((insn = NEXT_INSN (insn)))
     {
+      rtx set;
       code = GET_CODE (insn);
 
 #if 0
@@ -4265,6 +4266,9 @@ _reg_unused_after (rtx insn, rtx reg)
       /* else */
 #endif
 
+      if (!INSN_P (insn))
+	continue;
+
       if (code == JUMP_INSN)
 	return 0;
 
@@ -4322,17 +4326,14 @@ _reg_unused_after (rtx insn, rtx reg)
 	    return 1;
 	}
 
-      if (GET_RTX_CLASS (code) == 'i')
-	{
-	  rtx set = single_set (insn);
+      set = single_set (insn);
 
-	  if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
-	    return 0;
-	  if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
-	    return GET_CODE (SET_DEST (set)) != MEM;
-	  if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
-	    return 0;
-	}
+      if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
+	return 0;
+      if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
+	return GET_CODE (SET_DEST (set)) != MEM;
+      if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
+	return 0;
     }
   return 1;
 }
Index: config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.50
diff -u -p -r1.50 frv.c
--- config/frv/frv.c	6 Feb 2004 05:52:01 -0000	1.50
+++ config/frv/frv.c	7 Feb 2004 11:42:17 -0000
@@ -6407,7 +6407,7 @@ frv_ifcvt_modify_tests (ce_if_block_t *c
 
 		      else if (CR_P (regno)
 			       && (src_code == IF_THEN_ELSE
-				   || GET_RTX_CLASS (src_code) == '<'))
+				   || COMPARISON_P (src)))
 			skip_nested_if = TRUE;
 		    }
 		}
@@ -6950,9 +6950,7 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce
       enum machine_mode mode = GET_MODE (dest);
 
       /* Check for normal binary operators.  */
-      if (mode == SImode
-	  && (GET_RTX_CLASS (GET_CODE (src)) == '2'
-	      || GET_RTX_CLASS (GET_CODE (src)) == 'c'))
+      if (mode == SImode && ARITHMETIC_P (src))
 	{
 	  op0 = XEXP (src, 0);
 	  op1 = XEXP (src, 1);
@@ -7076,7 +7074,7 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce
       /* Rewrite a nested set cccr in terms of IF_THEN_ELSE.  Also deal with
          rewriting the CC register to be the same as the paired CC/CR register
          for nested ifs.  */
-      else if (mode == CC_CCRmode && GET_RTX_CLASS (GET_CODE (src)) == '<')
+      else if (mode == CC_CCRmode && COMPARISON_P (src))
 	{
 	  int regno = REGNO (XEXP (src, 0));
 	  rtx if_else;
@@ -8389,7 +8387,7 @@ frv_pack_insns (void)
 	}
 
       /* Things like labels reset everything.  */
-      if (GET_RTX_CLASS (code) != 'i')
+      if (!INSN_P (insn))
 	{
 	  next_start_vliw_p = TRUE;
 	  continue;
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.645
diff -u -p -r1.645 i386.c
--- config/i386/i386.c	4 Feb 2004 20:27:02 -0000	1.645
+++ config/i386/i386.c	7 Feb 2004 11:42:18 -0000
@@ -3990,7 +3990,7 @@ ix86_comparison_operator (rtx op, enum m
   enum rtx_code code = GET_CODE (op);
   if (mode != VOIDmode && GET_MODE (op) != mode)
     return 0;
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
   inmode = GET_MODE (XEXP (op, 0));
 
@@ -4032,7 +4032,7 @@ ix86_carry_flag_operator (rtx op, enum m
 
   if (mode != VOIDmode && GET_MODE (op) != mode)
     return 0;
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
   inmode = GET_MODE (XEXP (op, 0));
   if (GET_CODE (XEXP (op, 0)) != REG
@@ -4064,7 +4064,7 @@ fcmov_comparison_operator (rtx op, enum 
 
   if (mode != VOIDmode && GET_MODE (op) != mode)
     return 0;
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
   inmode = GET_MODE (XEXP (op, 0));
   if (inmode == CCFPmode || inmode == CCFPUmode)
@@ -4183,8 +4183,7 @@ int
 arith_or_logical_operator (rtx op, enum machine_mode mode)
 {
   return ((mode == VOIDmode || GET_MODE (op) == mode)
-          && (GET_RTX_CLASS (GET_CODE (op)) == 'c'
-              || GET_RTX_CLASS (GET_CODE (op)) == '2'));
+          && ARITHMETIC_P (op));
 }
 
 /* Returns 1 if OP is memory operand with a displacement.  */
@@ -7400,7 +7399,7 @@ print_operand (FILE *file, rtx x, int co
 	case 'c':
 	  /* Check to see if argument to %c is really a constant
 	     and not a condition code which needs to be reversed.  */
-	  if (GET_RTX_CLASS (GET_CODE (x)) != '<')
+	  if (!COMPARISON_P (x))
 	  {
 	    output_operand_lossage ("operand is neither a constant nor a condition code, invalid operand code 'c'");
 	     return;
@@ -8423,7 +8422,7 @@ ix86_expand_binary_operator (enum rtx_co
   src2 = operands[2];
 
   /* Recognize <var1> = <value> <op> <var1> for commutative operators */
-  if (GET_RTX_CLASS (code) == 'c'
+  if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
       && (rtx_equal_p (dst, src2)
 	  || immediate_operand (src1, mode)))
     {
@@ -8439,7 +8438,7 @@ ix86_expand_binary_operator (enum rtx_co
     {
       if (rtx_equal_p (dst, src1))
 	matching_memory = 1;
-      else if (GET_RTX_CLASS (code) == 'c'
+      else if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
 	       && rtx_equal_p (dst, src2))
 	matching_memory = 2;
       else
@@ -8459,7 +8458,7 @@ ix86_expand_binary_operator (enum rtx_co
      or non-matching memory.  */
   if ((CONSTANT_P (src1)
        || (!matching_memory && GET_CODE (src1) == MEM))
-      && GET_RTX_CLASS (code) != 'c')
+      && GET_RTX_CLASS (code) != RTX_COMM_ARITH)
     src1 = force_reg (mode, src1);
 
   /* If optimizing, copy to regs to improve CSE */
@@ -8507,18 +8506,18 @@ ix86_binary_operator_ok (enum rtx_code c
   if (GET_CODE (operands[1]) == MEM && GET_CODE (operands[2]) == MEM)
     return 0;
   /* If the operation is not commutable, source 1 cannot be a constant.  */
-  if (CONSTANT_P (operands[1]) && GET_RTX_CLASS (code) != 'c')
+  if (CONSTANT_P (operands[1]) && GET_RTX_CLASS (code) != RTX_COMM_ARITH)
     return 0;
   /* If the destination is memory, we must have a matching source operand.  */
   if (GET_CODE (operands[0]) == MEM
       && ! (rtx_equal_p (operands[0], operands[1])
-	    || (GET_RTX_CLASS (code) == 'c'
+	    || (GET_RTX_CLASS (code) == RTX_COMM_ARITH
 		&& rtx_equal_p (operands[0], operands[2]))))
     return 0;
   /* If the operation is not commutable and the source 1 is memory, we must
      have a matching destination.  */
   if (GET_CODE (operands[1]) == MEM
-      && GET_RTX_CLASS (code) != 'c'
+      && GET_RTX_CLASS (code) != RTX_COMM_ARITH
       && ! rtx_equal_p (operands[0], operands[1]))
     return 0;
   return 1;
Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.509
diff -u -p -r1.509 i386.md
--- config/i386/i386.md	4 Feb 2004 20:27:03 -0000	1.509
+++ config/i386/i386.md	7 Feb 2004 11:42:20 -0000
@@ -14300,7 +14300,7 @@
 			[(match_operand:SF 1 "nonimmediate_operand" "%0")
 			 (match_operand:SF 2 "nonimmediate_operand" "fm")]))]
   "TARGET_80387 && !TARGET_SSE_MATH
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+   && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14315,7 +14315,7 @@
 			[(match_operand:SF 1 "nonimmediate_operand" "%0,0")
 			 (match_operand:SF 2 "nonimmediate_operand" "fm#x,xm#f")]))]
   "TARGET_80387 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+   && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14333,7 +14333,7 @@
 	(match_operator:SF 3 "binary_fp_operator"
 			[(match_operand:SF 1 "nonimmediate_operand" "%0")
 			 (match_operand:SF 2 "nonimmediate_operand" "xm")]))]
-  "TARGET_SSE_MATH && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+  "TARGET_SSE_MATH && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14348,7 +14348,7 @@
 			[(match_operand:DF 1 "nonimmediate_operand" "%0")
 			 (match_operand:DF 2 "nonimmediate_operand" "fm")]))]
   "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH)
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+   && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14363,7 +14363,7 @@
 			[(match_operand:DF 1 "nonimmediate_operand" "%0,0")
 			 (match_operand:DF 2 "nonimmediate_operand" "fm#Y,Ym#f")]))]
   "TARGET_80387 && TARGET_SSE_MATH && TARGET_SSE2 && TARGET_MIX_SSE_I387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+   && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14382,7 +14382,7 @@
 			[(match_operand:DF 1 "nonimmediate_operand" "%0")
 			 (match_operand:DF 2 "nonimmediate_operand" "Ym")]))]
   "TARGET_SSE2 && TARGET_SSE_MATH
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'
+   && COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14397,7 +14397,7 @@
 			[(match_operand:XF 1 "register_operand" "%0")
 			 (match_operand:XF 2 "register_operand" "f")]))]
   "TARGET_80387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'"
+   && COMMUTATIVE_ARITH_P (operands[3])"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (if_then_else (match_operand:XF 3 "mult_operator" "") 
@@ -14411,7 +14411,7 @@
 			[(match_operand:SF 1 "nonimmediate_operand" "0,fm")
 			 (match_operand:SF 2 "nonimmediate_operand" "fm,0")]))]
   "TARGET_80387 && !TARGET_SSE_MATH
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'
+   && !COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14429,7 +14429,7 @@
 			[(match_operand:SF 1 "nonimmediate_operand" "0,fm,0")
 			 (match_operand:SF 2 "nonimmediate_operand" "fm,0,xm#f")]))]
   "TARGET_80387 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'
+   && !COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14455,7 +14455,7 @@
 			[(match_operand:SF 1 "register_operand" "0")
 			 (match_operand:SF 2 "nonimmediate_operand" "xm")]))]
   "TARGET_SSE_MATH
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'"
+   && !COMMUTATIVE_ARITH_P (operands[3])"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (cond [(match_operand:SF 3 "mult_operator" "")
@@ -14509,7 +14509,7 @@
 			[(match_operand:DF 1 "nonimmediate_operand" "0,fm")
 			 (match_operand:DF 2 "nonimmediate_operand" "fm,0")]))]
   "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH)
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'
+   && !COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14528,7 +14528,7 @@
 			[(match_operand:DF 1 "nonimmediate_operand" "0,fm,0")
 			 (match_operand:DF 2 "nonimmediate_operand" "fm,0,Ym#f")]))]
   "TARGET_80387 && TARGET_SSE2 && TARGET_SSE_MATH && TARGET_MIX_SSE_I387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'
+   && !COMMUTATIVE_ARITH_P (operands[3])
    && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
@@ -14554,7 +14554,7 @@
 			[(match_operand:DF 1 "register_operand" "0")
 			 (match_operand:DF 2 "nonimmediate_operand" "Ym")]))]
   "TARGET_SSE2 && TARGET_SSE_MATH
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'"
+   && !COMMUTATIVE_ARITH_P (operands[3])"
   "* return output_387_binary_op (insn, operands);"
   [(set_attr "mode" "DF")
    (set (attr "type") 
@@ -14660,7 +14660,7 @@
 			[(match_operand:XF 1 "register_operand" "0,f")
 			 (match_operand:XF 2 "register_operand" "f,0")]))]
   "TARGET_80387
-   && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'"
+   && !COMMUTATIVE_ARITH_P (operands[3])"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (cond [(match_operand:XF 3 "mult_operator" "") 
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.274
diff -u -p -r1.274 ia64.c
--- config/ia64/ia64.c	6 Feb 2004 20:03:45 -0000	1.274
+++ config/ia64/ia64.c	7 Feb 2004 11:42:21 -0000
@@ -863,7 +863,7 @@ int
 not_postinc_memory_operand (rtx op, enum machine_mode mode)
 {
   return (memory_operand (op, mode)
-	  && GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != 'a');
+	  && GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC);
 }
 
 /* Return 1 if this is a comparison operator, which accepts a normal 8-bit
@@ -4343,7 +4343,7 @@ ia64_print_operand (FILE * file, rtx x, 
     case MEM:
       {
 	rtx addr = XEXP (x, 0);
-	if (GET_RTX_CLASS (GET_CODE (addr)) == 'a')
+	if (GET_RTX_CLASS (GET_CODE (addr)) == RTX_AUTOINC)
 	  addr = XEXP (addr, 0);
 	fprintf (file, "[%s]", reg_names [REGNO (addr)]);
 	break;
@@ -5113,7 +5113,7 @@ update_set_flags (rtx x, struct reg_flag
       /* ... fall through ...  */
 
     default:
-      if (GET_RTX_CLASS (GET_CODE (src)) == '<'
+      if (COMPARISON_P (src)
 	  && GET_MODE_CLASS (GET_MODE (XEXP (src, 0))) == MODE_FLOAT)
 	/* Set pflags->is_fp to 1 so that we know we're dealing
 	   with a floating point comparison when processing the
@@ -5837,8 +5837,8 @@ errata_emit_nops (rtx insn)
 	  || GET_CODE (XEXP (SET_SRC (set), 0)) != POST_MODIFY)
       && GENERAL_REGNO_P (REGNO (SET_DEST (set))))
     {
-      if (GET_RTX_CLASS (GET_CODE (cond)) != '<'
-	  || ! REG_P (XEXP (cond, 0)))
+      if (!COMPARISON_P (cond)
+	  || !REG_P (XEXP (cond, 0)))
 	abort ();
 
       if (TEST_HARD_REG_BIT (prev_group->p_reg_set, REGNO (XEXP (cond, 0))))
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.168
diff -u -p -r1.168 ia64.h
--- config/ia64/ia64.h	6 Feb 2004 06:18:29 -0000	1.168
+++ config/ia64/ia64.h	7 Feb 2004 11:42:21 -0000
@@ -1009,7 +1009,7 @@ enum reg_class
 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
   (CLASS == FR_REGS && GET_CODE (X) == MEM && MEM_VOLATILE_P (X) ? NO_REGS   \
    : CLASS == FR_REGS && GET_CODE (X) == CONST_DOUBLE ? NO_REGS		     \
-   : GET_RTX_CLASS (GET_CODE (X)) != 'o'				     \
+   : !OBJECT_P (X)							     \
      && (CLASS == AR_M_REGS || CLASS == AR_I_REGS) ? NO_REGS		     \
    : CLASS)
 
@@ -1112,9 +1112,9 @@ enum reg_class
 #define CONSTRAINT_OK_FOR_R(VALUE) \
   (GET_CODE (VALUE) == CONST_INT && INTVAL (VALUE) >= 1 && INTVAL (VALUE) <= 4)
 /* Non-post-inc memory for asms and other unsavory creatures.  */
-#define CONSTRAINT_OK_FOR_S(VALUE)				\
-  (GET_CODE (VALUE) == MEM					\
-   && GET_RTX_CLASS (GET_CODE (XEXP ((VALUE), 0))) != 'a'	\
+#define CONSTRAINT_OK_FOR_S(VALUE)					\
+  (GET_CODE (VALUE) == MEM						\
+   && GET_RTX_CLASS (GET_CODE (XEXP ((VALUE), 0))) != RTX_AUTOINC	\
    && (reload_in_progress || memory_operand ((VALUE), VOIDmode)))
 /* Symbol ref to small-address-area: */
 #define CONSTRAINT_OK_FOR_T(VALUE)						\
Index: config/ip2k/ip2k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ip2k/ip2k.c,v
retrieving revision 1.34
diff -u -p -r1.34 ip2k.c
--- config/ip2k/ip2k.c	6 Feb 2004 05:55:06 -0000	1.34
+++ config/ip2k/ip2k.c	7 Feb 2004 11:42:21 -0000
@@ -3430,7 +3430,7 @@ mdr_resequence_xy_yx (first_insn)
 	     appropriate, try to do the same thing with the second operand.
 	     Of course there are fewer operations that can match here
 	     because they must be commutative.  */
-          if (GET_RTX_CLASS (GET_CODE (XEXP (set, 1))) == 'c'
+          if (GET_RTX_CLASS (GET_CODE (XEXP (set, 1))) == RTX_COMM_ARITH
 	      && (GET_CODE (XEXP (XEXP (set, 1), 1)) == REG
 	          || GET_CODE (XEXP (XEXP (set, 1), 1)) == MEM)
 	      && rtx_equal_p (XEXP (set2, 0), XEXP (XEXP (set, 1), 1))
@@ -4106,12 +4106,11 @@ mdr_try_move_dp_reload (first_insn)
 static int
 ip2k_check_can_adjust_stack_ref (rtx x, int offset)
 {
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c')
+  if (ARITHMETIC_P (x))
     return (ip2k_check_can_adjust_stack_ref (XEXP (x, 0), offset)
 	    && ip2k_check_can_adjust_stack_ref (XEXP (x, 1), offset));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1')
+  if (UNARY_P (x))
     return ip2k_check_can_adjust_stack_ref (XEXP (x, 0), offset);
 
   switch (GET_CODE (x))
@@ -4152,15 +4151,14 @@ ip2k_check_can_adjust_stack_ref (rtx x, 
 static void
 ip2k_adjust_stack_ref (rtx *x, int offset)
 {
-  if (GET_RTX_CLASS (GET_CODE (*x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (*x)) == 'c')
+  if (ARITHMETIC_P (*x))
     {
       ip2k_adjust_stack_ref (&XEXP (*x, 0), offset);
       ip2k_adjust_stack_ref (&XEXP (*x, 1), offset);
       return;
     }
 
-  if (GET_RTX_CLASS (GET_CODE (*x)) == '1')
+  if (UNARY_P (*x))
     {
       ip2k_adjust_stack_ref (&XEXP (*x, 0), offset);
       return;
@@ -4644,21 +4642,6 @@ ip2k_xexp_not_uses_reg_for_mem (rtx x, u
   if (regno & 1)
     regno &= 0xfffffffe;
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
-    return (ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno)
-	    && ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 1), regno)
-	    && ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 2), regno));
-
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c'
-      || GET_RTX_CLASS (GET_CODE (x)) == '<')
-    return (ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno)
-	    && ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 1), regno));
-
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1'
-      || GET_RTX_CLASS (GET_CODE (x)) == '3')
-    return ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno);
-
   switch (GET_CODE (x))
     {
     case REG:
@@ -4684,6 +4667,19 @@ ip2k_xexp_not_uses_reg_for_mem (rtx x, u
       return 1;
 
     default:
+      if (GET_RTX_CLASS (GET_CODE (x)) == RTX_BITFIELD_OPS)
+	return (ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno)
+		&& ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 1), regno)
+		&& ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 2), regno));
+
+      if (BINARY_P (x))
+	return (ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno)
+		&& ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 1), regno));
+
+      if (UNARY_P (x)
+	  || GET_RTX_CLASS (GET_CODE (x)) == '3')
+	return ip2k_xexp_not_uses_reg_for_mem (XEXP (x, 0), regno);
+
       return 0;
     }
 }
@@ -5974,19 +5970,17 @@ ip2k_xexp_not_uses_reg_p (rtx x, unsigne
 int
 ip2k_composite_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
 {
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
+  if (GET_RTX_CLASS (GET_CODE (x)) == RTX_BITFIELD_OPS)
     return (ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz)
 	    && ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 1), r, rsz)
 	    && ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 2), r, rsz));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c'
-      || GET_RTX_CLASS (GET_CODE (x)) == '<')
+  if (BINARY_P (x)
     return (ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz)
 	    && ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 1), r, rsz));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1'
-      || GET_RTX_CLASS (GET_CODE (x)) == '3')
+  if (UNARY_P (x)
+      || GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY)
     return ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz);
 
   return ip2k_xexp_not_uses_reg_p (x, r, rsz);
@@ -5998,19 +5992,17 @@ ip2k_composite_xexp_not_uses_reg_p (rtx 
 int
 ip2k_composite_xexp_not_uses_cc0_p (rtx x)
 {
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
+  if (GET_RTX_CLASS (GET_CODE (x)) == RTX_BITFIELD_OPS)
     return (ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0))
 	    && ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 1))
 	    && ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 2)));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '2'
-      || GET_RTX_CLASS (GET_CODE (x)) == 'c'
-      || GET_RTX_CLASS (GET_CODE (x)) == '<')
+  if (BINARY_P (x))
     return (ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0))
 	    && ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 1)));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1'
-      || GET_RTX_CLASS (GET_CODE (x)) == '3')
+  if (UNARY_P (x)
+      || GET_RTX_CLASS (GET_CODE (x)) == RTX_TERNARY)
     return ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0));
 
   return GET_CODE (x) != CC0;
@@ -6160,15 +6152,14 @@ int
 ip2k_unary_operator (rtx op, enum machine_mode mode)
 {
   return ((mode == VOIDmode || GET_MODE (op) == mode)
-	  && GET_RTX_CLASS (GET_CODE (op)) == '1');
+	  && UNARY_P (op);
 }
 
 int
 ip2k_binary_operator (rtx op, enum machine_mode mode)
 {
   return ((mode == VOIDmode || GET_MODE (op) == mode)
-	  && (GET_RTX_CLASS (GET_CODE (op)) == 'c'
-	      || GET_RTX_CLASS (GET_CODE (op)) == '2'));
+	  && ARITHMETIC_P (op);
 }
 
 int
Index: config/iq2000/iq2000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.c,v
retrieving revision 1.13
diff -u -p -r1.13 iq2000.c
--- config/iq2000/iq2000.c	6 Feb 2004 06:18:30 -0000	1.13
+++ config/iq2000/iq2000.c	7 Feb 2004 11:42:21 -0000
@@ -359,7 +359,7 @@ cmp_op (rtx op, enum machine_mode mode)
   if (mode != GET_MODE (op))
     return 0;
 
-  return GET_RTX_CLASS (GET_CODE (op)) == '<';
+  return COMPARISON_P (op);
 }
 
 /* Return nonzero if the operand is either the PC or a label_ref.  */
@@ -2585,11 +2585,10 @@ symbolic_expression_p (rtx x)
   if (GET_CODE (x) == CONST)
     return symbolic_expression_p (XEXP (x, 0));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1')
+  if (UNARY_P (x))
     return symbolic_expression_p (XEXP (x, 0));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'c'
-      || GET_RTX_CLASS (GET_CODE (x)) == '2')
+  if (ARITHMETIC_P (x))
     return (symbolic_expression_p (XEXP (x, 0))
 	    || symbolic_expression_p (XEXP (x, 1)));
 
Index: config/m32r/m32r.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.c,v
retrieving revision 1.87
diff -u -p -r1.87 m32r.c
--- config/m32r/m32r.c	4 Feb 2004 20:27:08 -0000	1.87
+++ config/m32r/m32r.c	7 Feb 2004 11:42:22 -0000
@@ -910,8 +910,6 @@ eqne_comparison_operator (rtx op, enum m
 {
   enum rtx_code code = GET_CODE (op);
 
-  if (GET_RTX_CLASS (code) != '<')
-    return 0;
   return (code == EQ || code == NE);
 }
 
@@ -922,10 +920,9 @@ signed_comparison_operator (rtx op, enum
 {
   enum rtx_code code = GET_CODE (op);
 
-  if (GET_RTX_CLASS (code) != '<')
-    return 0;
-  return (code == EQ || code == NE
-	  || code == LT || code == LE || code == GT || code == GE);
+  return (COMPARISON_P (op)
+  	  && (code == EQ || code == NE
+	      || code == LT || code == LE || code == GT || code == GE);
 }
 
 /* Return 1 if OP is (mem (reg ...)).
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.377
diff -u -p -r1.377 mips.c
--- config/mips/mips.c	4 Feb 2004 20:01:00 -0000	1.377
+++ config/mips/mips.c	7 Feb 2004 11:42:22 -0000
@@ -1494,7 +1494,7 @@ cmp_op (rtx op, enum machine_mode mode)
   if (mode != GET_MODE (op))
     return 0;
 
-  return GET_RTX_CLASS (GET_CODE (op)) == '<';
+  return COMPARISON_P (op);
 }
 
 /* Return nonzero if the code is a relational operation suitable for a
@@ -7233,11 +7233,10 @@ symbolic_expression_p (rtx x)
   if (GET_CODE (x) == CONST)
     return symbolic_expression_p (XEXP (x, 0));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == '1')
+  if (UNARY_P (x))
     return symbolic_expression_p (XEXP (x, 0));
 
-  if (GET_RTX_CLASS (GET_CODE (x)) == 'c'
-      || GET_RTX_CLASS (GET_CODE (x)) == '2')
+  if (ARITHMETIC_P (x))
     return (symbolic_expression_p (XEXP (x, 0))
 	    || symbolic_expression_p (XEXP (x, 1)));
 
Index: config/mmix/mmix.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.c,v
retrieving revision 1.60
diff -u -p -r1.60 mmix.c
--- config/mmix/mmix.c	4 Feb 2004 20:01:02 -0000	1.60
+++ config/mmix/mmix.c	7 Feb 2004 11:42:22 -0000
@@ -2498,7 +2498,7 @@ mmix_foldable_comparison_operator (rtx o
   if (mode == VOIDmode)
     mode = GET_MODE (op);
 
-  if (mode == VOIDmode && GET_RTX_CLASS (GET_CODE (op)) == '<')
+  if (mode == VOIDmode && COMPARISON_P (op))
     mode = GET_MODE (XEXP (op, 0));
 
   return ((mode == CCmode || mode == DImode)
@@ -2526,13 +2526,13 @@ mmix_comparison_operator (rtx op, enum m
     mode = GET_MODE (op);
 
   /* Get the mode from the first operand if we don't have one.  */
-  if (mode == VOIDmode && GET_RTX_CLASS (GET_CODE (op)) == '<')
+  if (mode == VOIDmode && COMPARISON_P (op))
     mode = GET_MODE (XEXP (op, 0));
 
   /* FIXME: This needs to be kept in sync with the tables in
      mmix_output_condition.  */
   return
-    (mode == VOIDmode && GET_RTX_CLASS (GET_CODE (op)) == '<')
+    (mode == VOIDmode && COMPARISON_P (op))
     || (mode == CC_FUNmode
 	&& (code == ORDERED || code == UNORDERED))
     || (mode == CC_FPmode
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.243
diff -u -p -r1.243 pa.c
--- config/pa/pa.c	5 Feb 2004 14:21:54 -0000	1.243
+++ config/pa/pa.c	7 Feb 2004 11:42:23 -0000
@@ -1100,7 +1100,7 @@ hppa_legitimize_address (rtx x, rtx oldx
   if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == MULT
       && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT
       && shadd_constant_p (INTVAL (XEXP (XEXP (x, 0), 1)))
-      && (GET_RTX_CLASS (GET_CODE (XEXP (x, 1))) == 'o'
+      && (OBJECT_P (XEXP (x, 1))
 	  || GET_CODE (XEXP (x, 1)) == SUBREG)
       && GET_CODE (XEXP (x, 1)) != CONST)
     {
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.593
diff -u -p -r1.593 rs6000.c
--- config/rs6000/rs6000.c	7 Feb 2004 03:06:46 -0000	1.593
+++ config/rs6000/rs6000.c	7 Feb 2004 11:42:24 -0000
@@ -8009,7 +8009,8 @@ stmw_operation (rtx op, enum machine_mod
 static void
 validate_condition_mode (enum rtx_code code, enum machine_mode mode)
 {
-  if (GET_RTX_CLASS (code) != '<' 
+  if ((GET_RTX_CLASS (code) != RTX_COMPARE
+       && GET_RTX_CLASS (code) != RTX_COMM_COMPARE)
       || GET_MODE_CLASS (mode) != MODE_CC)
     abort ();
 
@@ -8053,7 +8054,7 @@ branch_comparison_operator (rtx op, enum
   enum rtx_code code = GET_CODE (op);
   enum machine_mode cc_mode;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
   cc_mode = GET_MODE (XEXP (op, 0));
@@ -8098,7 +8099,7 @@ trap_comparison_operator (rtx op, enum m
 {
   if (mode != VOIDmode && mode != GET_MODE (op))
     return 0;
-  return GET_RTX_CLASS (GET_CODE (op)) == '<';
+  return COMPARISON_P (op);
 }
 
 int
@@ -8478,7 +8479,7 @@ ccr_bit (rtx op, int scc_p)
   int base_bit;
   rtx reg;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return -1;
 
   reg = XEXP (op, 0);
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.311
diff -u -p -r1.311 rs6000.h
--- config/rs6000/rs6000.h	6 Feb 2004 06:18:20 -0000	1.311
+++ config/rs6000/rs6000.h	7 Feb 2004 11:42:24 -0000
@@ -2285,7 +2285,7 @@ do {								\
 #define SELECT_CC_MODE(OP,X,Y) \
   (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT ? CCFPmode	\
    : (OP) == GTU || (OP) == LTU || (OP) == GEU || (OP) == LEU ? CCUNSmode \
-   : (((OP) == EQ || (OP) == NE) && GET_RTX_CLASS (GET_CODE (X)) == '<'   \
+   : (((OP) == EQ || (OP) == NE) && COMPARISON_P (X)			  \
       ? CCEQmode : CCmode))
 
 /* Can the condition code MODE be safely reversed?  This is safe in
Index: config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.133
diff -u -p -r1.133 s390.c
--- config/s390/s390.c	4 Feb 2004 23:46:29 -0000	1.133
+++ config/s390/s390.c	7 Feb 2004 11:42:25 -0000
@@ -473,7 +473,7 @@ s390_alc_comparison (rtx op, enum machin
   if (mode != VOIDmode && mode != GET_MODE (op))
     return 0;
 
-  if (GET_RTX_CLASS (GET_CODE (op)) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
   if (GET_CODE (XEXP (op, 0)) != REG
@@ -515,7 +515,7 @@ s390_slb_comparison (rtx op, enum machin
   if (mode != VOIDmode && mode != GET_MODE (op))
     return 0;
 
-  if (GET_RTX_CLASS (GET_CODE (op)) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
   if (GET_CODE (XEXP (op, 0)) != REG
Index: config/sh/sh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v
retrieving revision 1.257
diff -u -p -r1.257 sh.c
--- config/sh/sh.c	6 Feb 2004 06:18:20 -0000	1.257
+++ config/sh/sh.c	7 Feb 2004 11:42:25 -0000
@@ -3421,7 +3421,7 @@ gen_block_redirect (rtx jump, int addr, 
 	  if (INSN_DELETED_P (scan))
 	    continue;
 	  code = GET_CODE (scan);
-	  if (GET_RTX_CLASS (code) == 'i')
+	  if (INSN_P (scan))
 	    {
 	      used |= regs_used (PATTERN (scan), 0);
 	      if (code == CALL_INSN)
@@ -7572,6 +7572,10 @@ reg_unused_after (rtx reg, rtx insn)
 
   while ((insn = NEXT_INSN (insn)))
     {
+      rtx set;
+      if (!INSN_P (insn))
+	continue;
+
       code = GET_CODE (insn);
 
 #if 0
@@ -7628,17 +7632,14 @@ reg_unused_after (rtx reg, rtx insn)
 	  else if (code == JUMP_INSN)
 	    return 0;
 	}
-      else if (GET_RTX_CLASS (code) == 'i')
-	{
-	  rtx set = single_set (insn);
 
-	  if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
-	    return 0;
-	  if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
-	    return GET_CODE (SET_DEST (set)) != MEM;
-	  if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
-	    return 0;
-	}
+      set = single_set (insn);
+      if (set && reg_overlap_mentioned_p (reg, SET_SRC (set)))
+	return 0;
+      if (set && reg_overlap_mentioned_p (reg, SET_DEST (set)))
+	return GET_CODE (SET_DEST (set)) != MEM;
+      if (set == 0 && reg_overlap_mentioned_p (reg, PATTERN (insn)))
+	return 0;
 
       if (code == CALL_INSN && call_used_regs[REGNO (reg)])
 	return 1;
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.289
diff -u -p -r1.289 sparc.c
--- config/sparc/sparc.c	4 Feb 2004 20:27:11 -0000	1.289
+++ config/sparc/sparc.c	7 Feb 2004 11:42:26 -0000
@@ -958,15 +958,16 @@ eq_or_neq (rtx op, enum machine_mode mod
 int
 normal_comp_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  enum rtx_code code = GET_CODE (op);
+  enum rtx_code code;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
   if (GET_MODE (XEXP (op, 0)) == CCFPmode
       || GET_MODE (XEXP (op, 0)) == CCFPEmode)
     return 1;
 
+  code = GET_CODE (op);
   return (code != NE && code != EQ && code != GEU && code != LTU);
 }
 
@@ -974,13 +975,14 @@ normal_comp_operator (rtx op, enum machi
    MATCH_OPERATOR to recognize all the branch insns.  */
 
 int
-noov_compare_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+noov_compare_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  enum rtx_code code = GET_CODE (op);
+  enum rtx_code code;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
+  code = GET_CODE (op);
   if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode
       || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode)
     /* These are the only branches which work with CC_NOOVmode.  */
@@ -994,14 +996,15 @@ noov_compare_op (register rtx op, enum m
 int
 noov_compare64_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  enum rtx_code code = GET_CODE (op);
+  enum rtx_code code;
 
   if (! TARGET_V9)
     return 0;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op));
     return 0;
 
+  code = GET_CODE (op);
   if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode)
     /* These are the only branches which work with CCX_NOOVmode.  */
     return (code == EQ || code == NE || code == GE || code == LT);
@@ -1012,13 +1015,14 @@ noov_compare64_op (register rtx op, enum
    conditional move or branch on register contents instructions.  */
 
 int
-v9_regcmp_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+v9_regcmp_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
 {
-  enum rtx_code code = GET_CODE (op);
+  enum rtx_code code;
 
-  if (GET_RTX_CLASS (code) != '<')
+  if (!COMPARISON_P (op))
     return 0;
 
+  code = GET_CODE (op);
   return v9_regcmp_p (code);
 }
 
@@ -2687,7 +2691,7 @@ emit_hard_tfmode_operation (enum rtx_cod
 {
   rtx op, dest;
 
-  if (GET_RTX_CLASS (code) == '1')
+  if (GET_RTX_CLASS (code) == RTX_UNARY)
     {
       operands[1] = force_reg (GET_MODE (operands[1]), operands[1]);
       op = gen_rtx_fmt_e (code, GET_MODE (operands[0]), operands[1]);
@@ -3073,7 +3077,7 @@ reg_unused_after (rtx reg, rtx insn)
       if (GET_CODE (insn) == CODE_LABEL)
 	return 1;
 
-      if (GET_RTX_CLASS (code) == 'i')
+      if (INSN_P (insn))
 	{
 	  rtx set = single_set (insn);
 	  int in_src = set && reg_overlap_mentioned_p (reg, SET_SRC (set));
Index: doc/md.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/md.texi,v
retrieving revision 1.89
diff -u -p -r1.89 md.texi
--- doc/md.texi	4 Feb 2004 06:12:54 -0000	1.89
+++ doc/md.texi	7 Feb 2004 11:42:26 -0000
@@ -367,14 +367,14 @@ commutative arithmetic operators of RTL 
 
 @smallexample
 int
-commutative_operator (x, mode)
+commutative_integer_operator (x, mode)
      rtx x;
      enum machine_mode mode;
 @{
   enum rtx_code code = GET_CODE (x);
   if (GET_MODE (x) != mode)
     return 0;
-  return (GET_RTX_CLASS (code) == 'c'
+  return (GET_RTX_CLASS (code) == RTX_COMM_ARITH
           || code == EQ || code == NE);
 @}
 @end smallexample
Index: doc/rtl.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/rtl.texi,v
retrieving revision 1.64
diff -u -p -r1.64 rtl.texi
--- doc/rtl.texi	27 Jan 2004 18:03:17 -0000	1.64
+++ doc/rtl.texi	7 Feb 2004 11:42:27 -0000
@@ -140,58 +140,67 @@ of an RTX code with the macro @code{GET_
 Currently, @file{rtx.def} defines these classes:
 
 @table @code
-@item o
+@item RTX_OBJ
 An RTX code that represents an actual object, such as a register
 (@code{REG}) or a memory location (@code{MEM}, @code{SYMBOL_REF}).
-Constants and basic transforms on objects (@code{ADDRESSOF},
-@code{HIGH}, @code{LO_SUM}) are also included.  Note that @code{SUBREG}
-and @code{STRICT_LOW_PART} are not in this class, but in class @code{x}.
+@code{LO_SUM}) is also included; instead, @code{SUBREG} and
+@code{STRICT_LOW_PART} are not in this class, but in class @code{x}.
 
-@item <
-An RTX code for a comparison, such as @code{NE} or @code{LT}.
+@item RTX_CONST_OBJ
+An RTX code that represents a constant object.  @code{HIGH} is also
+included in this class.
+
+@item RTX_COMPARE
+An RTX code for a non-symmetric comparison, such as @code{GEU} or
+@code{LT}.
+
+@item RTX_COMM_COMPARE
+An RTX code for a symmetric (commutative) comparison, such as @code{EQ}
+or @code{ORDERED}.
 
-@item 1
+@item RTX_UNARY
 An RTX code for a unary arithmetic operation, such as @code{NEG},
 @code{NOT}, or @code{ABS}.  This category also includes value extension
 (sign or zero) and conversions between integer and floating point.
 
-@item c
+@item RTX_COMM_ARITH
 An RTX code for a commutative binary operation, such as @code{PLUS} or
 @code{AND}.  @code{NE} and @code{EQ} are comparisons, so they have class
 @code{<}.
 
-@item 2
+@item RTX_BIN_ARITH
 An RTX code for a non-commutative binary operation, such as @code{MINUS},
 @code{DIV}, or @code{ASHIFTRT}.
 
-@item b
+@item RTX_BITFIELD_OPS
 An RTX code for a bit-field operation.  Currently only
 @code{ZERO_EXTRACT} and @code{SIGN_EXTRACT}.  These have three inputs
 and are lvalues (so they can be used for insertion as well).
 @xref{Bit-Fields}.
 
-@item 3
+@item RTX_TERNARY
 An RTX code for other three input operations.  Currently only
-@code{IF_THEN_ELSE}.
+@code{IF_THEN_ELSE} and @code{VEC_MERGE}.
 
-@item i
+@item RTX_INSN
 An RTX code for an entire instruction:  @code{INSN}, @code{JUMP_INSN}, and
 @code{CALL_INSN}.  @xref{Insns}.
 
-@item m
+@item RTX_MATCH
 An RTX code for something that matches in insns, such as
 @code{MATCH_DUP}.  These only occur in machine descriptions.
 
-@item a
+@item RTX_AUTOINC
 An RTX code for an auto-increment addressing mode, such as
 @code{POST_INC}.
 
-@item x
+@item RTX_EXTRA
 All other RTX codes.  This category includes the remaining codes used
 only in machine descriptions (@code{DEFINE_*}, etc.).  It also includes
 all the codes describing side effects (@code{SET}, @code{USE},
 @code{CLOBBER}, etc.) and the non-insns that may appear on an insn
 chain, such as @code{NOTE}, @code{BARRIER}, and @code{CODE_LABEL}.
+@code{SUBREG} is also part of this class.
 @end table
 
 @cindex RTL format
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.455
diff -u -r1.455 rtl.h
--- rtl.h	6 Feb 2004 20:03:43 -0000	1.455
+++ rtl.h	7 Feb 2004 13:03:09 -0000
@@ -52,6 +52,48 @@
 #define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
 				/* The cast here, saves many elsewhere.  */
 
+/* Register Transfer Language EXPRESSIONS CODE CLASSES */
+
+enum rtx_class  {
+  /* We check bit 0-1 of some rtx class codes in the predicates below.  */
+
+  /* Bit 0 = comparison if 0, arithmetic is 1
+     Bit 1 = 1 if commutative.  */
+  RTX_COMPARE,		/* 0 */
+  RTX_COMM_COMPARE,
+  RTX_BIN_ARITH,
+  RTX_COMM_ARITH,
+
+  /* Must follow the four preceding values.  */
+  RTX_UNARY,		/* 4 */
+
+  RTX_EXTRA,
+  RTX_MATCH,
+  RTX_INSN,
+
+  /* Bit 0 = 1 if constant.  */
+  RTX_OBJ,		/* 8 */
+  RTX_CONST_OBJ,
+
+  RTX_TERNARY,
+  RTX_BITFIELD_OPS,
+  RTX_AUTOINC
+};
+
+#define RTX_OBJ_MASK (~1)
+#define RTX_OBJ_RESULT (RTX_OBJ & RTX_OBJ_MASK)
+#define RTX_COMPARE_MASK (~1)
+#define RTX_COMPARE_RESULT (RTX_COMPARE & RTX_COMPARE_MASK)
+#define RTX_ARITHMETIC_MASK (~1)
+#define RTX_ARITHMETIC_RESULT (RTX_COMM_ARITH & RTX_ARITHMETIC_MASK)
+#define RTX_BINARY_MASK (~3)
+#define RTX_BINARY_RESULT (RTX_COMPARE & RTX_BINARY_MASK)
+#define RTX_COMMUTATIVE_MASK (~2)
+#define RTX_COMMUTATIVE_RESULT (RTX_COMM_COMPARE & RTX_COMMUTATIVE_MASK)
+#define RTX_NON_COMMUTATIVE_RESULT (RTX_COMPARE & RTX_COMMUTATIVE_MASK)
+#define RTX_EXPR_FIRST (RTX_COMPARE)
+#define RTX_EXPR_LAST (RTX_UNARY)
+
 extern const unsigned char rtx_length[NUM_RTX_CODE];
 #define GET_RTX_LENGTH(CODE)		(rtx_length[(int) (CODE)])
 
@@ -61,7 +103,7 @@
 extern const char * const rtx_format[NUM_RTX_CODE];
 #define GET_RTX_FORMAT(CODE)		(rtx_format[(int) (CODE)])
 
-extern const char rtx_class[NUM_RTX_CODE];
+extern const enum rtx_class rtx_class[NUM_RTX_CODE];
 #define GET_RTX_CLASS(CODE)		(rtx_class[(int) (CODE)])
 
 extern const unsigned char rtx_size[NUM_RTX_CODE];
@@ -288,15 +330,69 @@
   (JUMP_P (INSN) && (GET_CODE (PATTERN (INSN)) == ADDR_VEC || \
 		     GET_CODE (PATTERN (INSN)) == ADDR_DIFF_VEC))
 
+
+/* 1 if X is an insn.  */
+#define INSN_P(X)    \
+  (GET_RTX_CLASS (GET_CODE(X)) == RTX_INSN)
+
+/* 1 if X is a unary operator.  */
+
+#define UNARY_P(X)   \
+  (GET_RTX_CLASS (GET_CODE (X)) == RTX_UNARY)
+
+/* 1 if X is a binary operator.  */
+
+#define BINARY_P(X)   \
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_BINARY_MASK) == RTX_BINARY_RESULT)
+
+/* 1 if X is an arithmetic operator.  */
+
+#define ARITHMETIC_P(X)   \
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_ARITHMETIC_MASK)			\
+    == RTX_ARITHMETIC_RESULT)
+
+/* 1 if X is an arithmetic operator.  */
+
+#define COMMUTATIVE_ARITH_P(X)   \
+  (GET_RTX_CLASS (GET_CODE (X)) == RTX_COMM_ARITH)
+
+/* 1 if X is a commutative arithmetic operator or a comparison operator.
+   These two are sometimes selected together because it is possible to
+   swap the two operands.  */
+
+#define SWAPPABLE_OPERANDS_P(X)   \
+  ((1 << GET_RTX_CLASS (GET_CODE (X)))					\
+    & ((1 << RTX_COMM_ARITH) | (1 << RTX_COMM_COMPARE)			\
+       | (1 << RTX_COMPARE)))
+
+/* 1 if X is a non-commutative operator.  */
+
+#define NON_COMMUTATIVE_P(X)   \
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK)		\
+    == RTX_NON_COMMUTATIVE_RESULT)
+
+/* 1 if X is a commutative operator on integers.  */
+
+#define COMMUTATIVE_P(X)   \
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMMUTATIVE_MASK)		\
+    == RTX_COMMUTATIVE_RESULT)
+
+/* 1 if X is a relational operator.  */
+
+#define COMPARISON_P(X)   \
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_COMPARE_MASK) == RTX_COMPARE_RESULT)
+
 /* 1 if X is a constant value that is an integer.  */
 
 #define CONSTANT_P(X)   \
-  (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF		\
-   || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE		\
-   || GET_CODE (X) == CONST || GET_CODE (X) == HIGH			\
+  (GET_RTX_CLASS (GET_CODE (X)) == RTX_CONST_OBJ			\
    || GET_CODE (X) == CONST_VECTOR	                                \
    || GET_CODE (X) == CONSTANT_P_RTX)
 
+/* 1 if X can be used to represent an object.  */
+#define OBJECT_P(X)							\
+  ((GET_RTX_CLASS (GET_CODE (X)) & RTX_OBJ_MASK) == RTX_OBJ_RESULT)
+
 /* General accessor macros for accessing the fields of an rtx.  */
 
 #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
@@ -554,9 +650,6 @@
 #define XC2EXP(RTX, N, C1, C2)      (RTL_CHECKC2 (RTX, N, C1, C2).rtx)
 
 /* ACCESS MACROS for particular fields of insns.  */
-
-/* Determines whether X is an insn.  */
-#define INSN_P(X)       (GET_RTX_CLASS (GET_CODE(X)) == 'i')
 
 /* Holds a unique number for each insn.
    These are not necessarily sequentially increasing.  */



More information about the Gcc-patches mailing list