From 9f3fa8ba7e4598547c3bf547478c7a98d7133d38 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 9 Jan 2006 22:49:35 +0000 Subject: [PATCH] * config/sh/predicates.md (binary_float_operator, binary_logical_operator, commutative_float_operator, equality_comparison_operator, greater_comparison_operator, less_comparison_operator, logical_operator, noncommutative_float_operator, shift_operator, symbol_ref_operand, unary_float_operator): Remove redundant conditionals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109512 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 18 +++-- gcc/config/sh/predicates.md | 157 +++++--------------------------------------- 2 files changed, 30 insertions(+), 145 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 020d1a45711..26f62eb810e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,14 @@ -2005-01-09 Jeff Law +2006-01-09 Kazu Hirata + + * config/sh/predicates.md (binary_float_operator, + binary_logical_operator, commutative_float_operator, + equality_comparison_operator, greater_comparison_operator, + less_comparison_operator, logical_operator, + noncommutative_float_operator, shift_operator, + symbol_ref_operand, unary_float_operator): Remove redundant + conditionals. + +2006-01-09 Jeff Law * tree-ssa-dom.c (simplify_cond_and_lookup_avail_expr): Remove code to propagate the RHS of a cast into COND_EXPR_COND. Remove @@ -94,7 +104,7 @@ * config/darwin.c (darwin_emit_except_table_label): Define. * config/darwin.h (TARGET_ASM_EMIT_EXCEPT_TABLE): Ditto. -2005-01-06 Zdenek Dvorak +2006-01-06 Zdenek Dvorak PR tree-optimization/18527 * tree-ssa-loop-niter.c (number_of_iterations_cond, @@ -114,7 +124,7 @@ * tree-ssa-loop-ivopts.c (determine_biv_step, find_givs_in_stmt_scev, find_givs_in_stmt): Changed due to simple_iv change. -2005-01-06 Jeff Law +2006-01-06 Jeff Law PR ada/24994 * tree-cfg.c (bsi_replace): Rename final argument from @@ -302,7 +312,7 @@ (c_parser_new): Merge into ... (c_parse_file): ... here. Call c_parser_pragma_pch_preprocess. -2005-01-04 Jeff Law +2006-01-04 Jeff Law PR ada/24994 * tree-cfg.c (bsi_replace): Remove the original statement diff --git a/gcc/config/sh/predicates.md b/gcc/config/sh/predicates.md index 2934d445651..10367dd92a9 100644 --- a/gcc/config/sh/predicates.md +++ b/gcc/config/sh/predicates.md @@ -207,41 +207,14 @@ ;; TODO: Add a comment here. (define_predicate "binary_float_operator" - (match_code "plus,minus,mult,div") -{ - if (GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case PLUS: - case MINUS: - case MULT: - case DIV: - return 1; - default: - break; - } - return 0; -}) + (and (match_code "plus,minus,mult,div") + (match_test "GET_MODE (op) == mode"))) ;; TODO: Add a comment here. (define_predicate "binary_logical_operator" - (match_code "and,ior,xor") -{ - if (GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case IOR: - case AND: - case XOR: - return 1; - default: - break; - } - return 0; -}) + (and (match_code "and,ior,xor") + (match_test "GET_MODE (op) == mode"))) ;; TODO: Add a comment here. @@ -290,29 +263,13 @@ ;; TODO: Add a comment here. (define_predicate "commutative_float_operator" - (match_code "plus,mult") -{ - if (GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case PLUS: - case MULT: - return 1; - default: - break; - } - return 0; -}) + (and (match_code "plus,mult") + (match_test "GET_MODE (op) == mode"))) ;; TODO: Add a comment here. (define_predicate "equality_comparison_operator" - (match_code "eq,ne") -{ - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (GET_CODE (op) == EQ || GET_CODE (op) == NE)); -}) + (match_code "eq,ne")) ;; TODO: Add a comment here. @@ -494,21 +451,7 @@ ;; TODO: Add a comment here. (define_predicate "greater_comparison_operator" - (match_code "gt,ge,gtu,geu") -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case GT: - case GE: - case GTU: - case GEU: - return 1; - default: - return 0; - } -}) + (match_code "gt,ge,gtu,geu")) ;; TODO: Add a comment here. @@ -541,21 +484,7 @@ ;; TODO: Add a comment here. (define_predicate "less_comparison_operator" - (match_code "lt,le,ltu,leu") -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case LT: - case LE: - case LTU: - case LEU: - return 1; - default: - return 0; - } -}) + (match_code "lt,le,ltu,leu")) ;; Returns 1 if OP is a valid source operand for a logical operation. @@ -586,20 +515,7 @@ ;; TODO: Add a comment here. (define_predicate "logical_operator" - (match_code "and,ior,xor") -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case AND: - case IOR: - case XOR: - return 1; - default: - return 0; - } -}) + (match_code "and,ior,xor")) ;; Like arith_reg_operand, but for register source operands of narrow ;; logical SHMEDIA operations: forbid subregs of DImode / TImode regs. @@ -639,20 +555,8 @@ ;; TODO: Add a comment here. (define_predicate "noncommutative_float_operator" - (match_code "minus,div") -{ - if (GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case MINUS: - case DIV: - return 1; - default: - break; - } - return 0; -}) + (and (match_code "minus,div") + (match_test "GET_MODE (op) == mode"))) ;; TODO: Add a comment here. @@ -783,28 +687,12 @@ ;; TODO: Add a comment here. (define_predicate "shift_operator" - (match_code "ashift,ashiftrt,lshiftrt") -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case ASHIFT: - case ASHIFTRT: - case LSHIFTRT: - return 1; - default: - return 0; - } -}) + (match_code "ashift,ashiftrt,lshiftrt")) ;; TODO: Add a comment here. (define_predicate "symbol_ref_operand" - (match_code "symbol_ref") -{ - return (GET_CODE (op) == SYMBOL_REF); -}) + (match_code "symbol_ref")) ;; Same as target_reg_operand, except that label_refs and symbol_refs ;; are accepted before reload. @@ -884,21 +772,8 @@ ;; TODO: Add a comment here. (define_predicate "unary_float_operator" - (match_code "abs,neg,sqrt") -{ - if (GET_MODE (op) != mode) - return 0; - switch (GET_CODE (op)) - { - case ABS: - case NEG: - case SQRT: - return 1; - default: - break; - } - return 0; -}) + (and (match_code "abs,neg,sqrt") + (match_test "GET_MODE (op) == mode"))) ;; Return 1 if OP is a valid source operand for xor. -- 2.11.4.GIT