aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@gcc.gnu.org>2006-01-09 22:49:35 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2006-01-09 22:49:35 +0000
commitf289c6a1cb479433162690699c672d75d83ae4a9 (patch)
tree679e42eebbfd03a9b539b9a0cd103d1174eadb8e
parentcc2804f14fb5443a0ffa668ff8fe89c7a7bb7746 (diff)
downloadgcc-f289c6a1cb479433162690699c672d75d83ae4a9.zip
gcc-f289c6a1cb479433162690699c672d75d83ae4a9.tar.gz
gcc-f289c6a1cb479433162690699c672d75d83ae4a9.tar.bz2
predicates.md (binary_float_operator, [...]): Remove redundant conditionals.
* 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. From-SVN: r109512
-rw-r--r--gcc/ChangeLog18
-rw-r--r--gcc/config/sh/predicates.md157
2 files changed, 30 insertions, 145 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 020d1a4..26f62eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,14 @@
-2005-01-09 Jeff Law <law@redhat.com>
+2006-01-09 Kazu Hirata <kazu@codesourcery.com>
+
+ * 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 <law@redhat.com>
* 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 <dvorakz@suse.cz>
+2006-01-06 Zdenek Dvorak <dvorakz@suse.cz>
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 <law@redhat.com>
+2006-01-06 Jeff Law <law@redhat.com>
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 <law@redhat.com>
+2006-01-04 Jeff Law <law@redhat.com>
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 2934d44..10367dd 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.