diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-05 17:20:49 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-05 17:20:49 +0000 |
commit | 48a584222f3a9e71a536c68b5d9e41b833acb054 (patch) | |
tree | 1bfada345814516c5eac0889b2b7e1ecdd0b7e2c /gcc/config/rs6000 | |
parent | a1ac8a5014c9309727bf1482159033106d048c10 (diff) | |
download | gcc-48a584222f3a9e71a536c68b5d9e41b833acb054.tar.gz |
2005-12-05 Paolo Bonzini <bonzini@gnu.org>
* config/rs6000/predicates.md (logical_const_operand): Split
out of logical_operand.
(logical_operand): Use it.
* config/rs6000/rs6000.md (cmp -> xor peephole2): Use
logical_const_operand.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/predicates.md | 17 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 4 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 26f46a0e0fd..7baa401aedc 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -407,16 +407,13 @@ (match_test "!CONST_OK_FOR_LETTER_P (INTVAL (op), 'I') && !CONST_OK_FOR_LETTER_P (INTVAL (op), 'L')"))) -;; Return 1 if the operand is a non-special register or a constant that -;; can be used as the operand of an OR or XOR. -(define_predicate "logical_operand" - (match_code "reg,subreg,const_int,const_double") +;; Return 1 if the operand is a constant that can be used as the operand +;; of an OR or XOR. +(define_predicate "logical_const_operand" + (match_code "const_int,const_double") { HOST_WIDE_INT opl, oph; - if (gpc_reg_operand (op, mode)) - return 1; - if (GET_CODE (op) == CONST_INT) { opl = INTVAL (op) & GET_MODE_MASK (mode); @@ -441,6 +438,12 @@ || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0); }) +;; Return 1 if the operand is a non-special register or a constant that +;; can be used as the operand of an OR or XOR. +(define_predicate "logical_operand" + (ior (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_const_operand"))) + ;; Return 1 if op is a constant that is not a logical operand, but could ;; be split into one. (define_predicate "non_logical_cint_operand" diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 14e1fb80531..17d8ef660ce 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -11283,10 +11283,10 @@ (define_peephole2 [(set (match_operand:SI 0 "register_operand") - (match_operand:SI 1 "logical_operand" "")) + (match_operand:SI 1 "logical_const_operand" "")) (set (match_dup 0) (match_operator:SI 3 "boolean_or_operator" [(match_dup 0) - (match_operand:SI 2 "logical_operand" "")])) + (match_operand:SI 2 "logical_const_operand" "")])) (set (match_operand:CC 4 "cc_reg_operand" "") (compare:CC (match_operand:SI 5 "gpc_reg_operand" "") (match_dup 0))) |