aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2004-03-03 08:35:33 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2004-03-03 08:35:33 +0000
commitec8e098d3d9adeb04512169974fd67acd9b9ca0f (patch)
tree79c63a2ca1f9598f1822ace38905a1fe19aeb364 /gcc/config
parenta841ab8b3ea849b3146285b09ecb60ad81c011bf (diff)
downloadgcc-ec8e098d3d9adeb04512169974fd67acd9b9ca0f.zip
gcc-ec8e098d3d9adeb04512169974fd67acd9b9ca0f.tar.gz
gcc-ec8e098d3d9adeb04512169974fd67acd9b9ca0f.tar.bz2
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes...
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. * function.c (update_epilogue_consts): 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. * loop-iv.c (simplify_using_conditions, iv_number_of_iterations): 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. * ra-debug.c: Add 2004 to list of copyright years. * unroll.c: 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. From-SVN: r78824
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/alpha/alpha.c8
-rw-r--r--gcc/config/arc/arc.c6
-rw-r--r--gcc/config/arm/arm.c17
-rw-r--r--gcc/config/avr/avr.c21
-rw-r--r--gcc/config/frv/frv.c10
-rw-r--r--gcc/config/i386/i386.c23
-rw-r--r--gcc/config/i386/i386.md28
-rw-r--r--gcc/config/ia64/ia64.c10
-rw-r--r--gcc/config/ia64/ia64.h8
-rw-r--r--gcc/config/ip2k/ip2k.c65
-rw-r--r--gcc/config/iq2000/iq2000.c7
-rw-r--r--gcc/config/m32r/m32r.c9
-rw-r--r--gcc/config/mips/mips.c7
-rw-r--r--gcc/config/mmix/mmix.c6
-rw-r--r--gcc/config/pa/pa.c2
-rw-r--r--gcc/config/rs6000/rs6000.c9
-rw-r--r--gcc/config/rs6000/rs6000.h2
-rw-r--r--gcc/config/s390/s390.c4
-rw-r--r--gcc/config/sh/sh.c23
-rw-r--r--gcc/config/sparc/sparc.c28
20 files changed, 140 insertions, 153 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 5b78e62..0e534f3 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1134,13 +1134,13 @@ alpha_zero_comparison_operator (rtx op, enum machine_mode mode)
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);
}
@@ -5637,7 +5637,7 @@ print_operand (FILE *file, rtx x, int code)
{
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')
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 0f4396ac..b50c50f 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -709,11 +709,11 @@ const_uint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
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)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 0a61e1b..aa249ff 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3938,13 +3938,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;
@@ -6175,21 +6172,21 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
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);
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 207f5f3..705e07b 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -4251,6 +4251,7 @@ _reg_unused_after (rtx insn, rtx reg)
while ((insn = NEXT_INSN (insn)))
{
+ rtx set;
code = GET_CODE (insn);
#if 0
@@ -4263,6 +4264,9 @@ _reg_unused_after (rtx insn, rtx reg)
/* else */
#endif
+ if (!INSN_P (insn))
+ continue;
+
if (code == JUMP_INSN)
return 0;
@@ -4320,17 +4324,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;
}
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index c5ea7f3..242dfcd 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -6831,7 +6831,7 @@ frv_ifcvt_modify_tests (ce_if_block_t *ce_info, rtx *p_true, rtx *p_false)
else if (CR_P (regno)
&& (src_code == IF_THEN_ELSE
- || GET_RTX_CLASS (src_code) == '<'))
+ || COMPARISON_P (src)))
skip_nested_if = TRUE;
}
}
@@ -7371,9 +7371,7 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce_info,
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);
@@ -7486,7 +7484,7 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce_info,
/* 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;
@@ -8830,7 +8828,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;
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b545c39..d90d616 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4006,7 +4006,7 @@ ix86_comparison_operator (rtx op, enum machine_mode mode)
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));
@@ -4048,7 +4048,7 @@ ix86_carry_flag_operator (rtx op, enum machine_mode mode)
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
@@ -4080,7 +4080,7 @@ fcmov_comparison_operator (rtx op, enum machine_mode mode)
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)
@@ -4199,8 +4199,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. */
@@ -7416,7 +7415,7 @@ print_operand (FILE *file, rtx x, int code)
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;
@@ -8439,7 +8438,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode,
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)))
{
@@ -8455,7 +8454,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode,
{
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
@@ -8475,7 +8474,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode,
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 */
@@ -8523,18 +8522,18 @@ ix86_binary_operator_ok (enum rtx_code code,
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;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 94a96b6..56c1a8c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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" "")
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 0e61902..d7513ff 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -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
@@ -4356,7 +4356,7 @@ ia64_print_operand (FILE * file, rtx x, int code)
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;
@@ -5159,7 +5159,7 @@ update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond)
/* ... 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
@@ -5883,8 +5883,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))))
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 24e1477..c52c751 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -1021,7 +1021,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)
@@ -1124,9 +1124,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) \
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index 7c3d46f..c6fd0d1 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -3428,7 +3428,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))
@@ -4104,12 +4104,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))
@@ -4150,15 +4149,14 @@ ip2k_check_can_adjust_stack_ref (rtx x, int offset)
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;
@@ -4642,21 +4640,6 @@ ip2k_xexp_not_uses_reg_for_mem (rtx x, unsigned int regno)
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:
@@ -4682,6 +4665,19 @@ ip2k_xexp_not_uses_reg_for_mem (rtx x, unsigned int regno)
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;
}
}
@@ -5972,19 +5968,17 @@ ip2k_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
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);
@@ -5996,19 +5990,17 @@ ip2k_composite_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
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;
@@ -6158,15 +6150,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
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 55bda5f..07934ee 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -357,7 +357,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. */
@@ -2583,11 +2583,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)));
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index dcab504..a6c6994 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -908,8 +908,6 @@ eqne_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
- if (GET_RTX_CLASS (code) != '<')
- return 0;
return (code == EQ || code == NE);
}
@@ -920,10 +918,9 @@ signed_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
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 ...)).
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 336ca99..ee69fa3 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1465,7 +1465,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
@@ -7213,11 +7213,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)));
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index f5f1bd3..4d239dd 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -2498,7 +2498,7 @@ mmix_foldable_comparison_operator (rtx op, enum machine_mode mode)
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 machine_mode mode)
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
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index e2074a1..6c6fe04 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -1100,7 +1100,7 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
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)
{
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 172da41..5648d65 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -8105,7 +8105,8 @@ stmw_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
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 ();
@@ -8149,7 +8150,7 @@ branch_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
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));
@@ -8194,7 +8195,7 @@ trap_comparison_operator (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
- return GET_RTX_CLASS (GET_CODE (op)) == '<';
+ return COMPARISON_P (op);
}
int
@@ -8574,7 +8575,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);
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index ccceb17..641e4bb 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -2287,7 +2287,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
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 0b45351..7e7489a 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -467,7 +467,7 @@ s390_alc_comparison (rtx op, enum machine_mode mode)
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
@@ -509,7 +509,7 @@ s390_slb_comparison (rtx op, enum machine_mode mode)
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
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 2dc1d5c..32c8ef9 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -3514,7 +3514,7 @@ gen_block_redirect (rtx jump, int addr, int need_block)
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)
@@ -7667,6 +7667,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
@@ -7723,17 +7727,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;
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 079ed5d..4f564b1 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -958,15 +958,16 @@ eq_or_neq (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
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 machine_mode mode ATTRIBUTE_UNUSED)
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 machine_mode mode ATTRIBUTE_UNUSED)
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 machine_mode mode ATTRIBUTE_UNUSED)
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_code code, rtx *operands)
{
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));