aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <bernd.schmidt@analog.com>2005-07-11 16:15:45 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2005-07-11 16:15:45 +0000
commit7ddcf3d26f2966c5fdfccb271c9fe7f535509186 (patch)
tree543f30cc5db1b83d28fac8739d5630d1f48d9672 /gcc
parent3fb192d2c7fd3ac8080d335d62ac9ad6754cd36f (diff)
downloadgcc-7ddcf3d26f2966c5fdfccb271c9fe7f535509186.zip
gcc-7ddcf3d26f2966c5fdfccb271c9fe7f535509186.tar.gz
gcc-7ddcf3d26f2966c5fdfccb271c9fe7f535509186.tar.bz2
bfin.md (cmpsi, [...]): Use reg_or_const_int_operand for second comparison operand.
* config/bfin/bfin.md (cmpsi, compare_eq, compare_ne, compare_lt, compare_le, compare_leu, compare_ltu): Use reg_or_const_int_operand for second comparison operand. * config/bfin/predicates.md (reg_or_const_int_operand): New. From-SVN: r101881
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/bfin/bfin.md14
-rw-r--r--gcc/config/bfin/predicates.md5
3 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b5147ab..e1b5b63 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2005-07-11 Bernd Schmidt <bernd.schmidt@analog.com>
+ * config/bfin/bfin.md (cmpsi, compare_eq, compare_ne, compare_lt,
+ compare_le, compare_leu, compare_ltu): Use reg_or_const_int_operand
+ for second comparison operand.
+ * config/bfin/predicates.md (reg_or_const_int_operand): New.
+
* config/bfin/bfin.md (define_attr "type"): Add "sync".
(define_insn_reservation "alu"): Likewise.
(csync, ssync): Now of type sync.
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index be430c8..207bdd8 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -1451,7 +1451,7 @@
(define_expand "cmpsi"
[(set (cc0) (compare (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "nonmemory_operand" "")))]
+ (match_operand:SI 1 "reg_or_const_int_operand" "")))]
""
{
bfin_compare_op0 = operands[0];
@@ -1462,7 +1462,7 @@
(define_insn "compare_eq"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(eq:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
""
"cc =%1==%2;"
[(set_attr "type" "compare")])
@@ -1470,7 +1470,7 @@
(define_insn "compare_ne"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(ne:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
"0"
"cc =%1!=%2;"
[(set_attr "type" "compare")])
@@ -1478,7 +1478,7 @@
(define_insn "compare_lt"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(lt:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
""
"cc =%1<%2;"
[(set_attr "type" "compare")])
@@ -1486,7 +1486,7 @@
(define_insn "compare_le"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(le:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKs3,aKs3")))]
""
"cc =%1<=%2;"
[(set_attr "type" "compare")])
@@ -1494,7 +1494,7 @@
(define_insn "compare_leu"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(leu:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKu3,aKu3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKu3,aKu3")))]
""
"cc =%1<=%2 (iu);"
[(set_attr "type" "compare")])
@@ -1502,7 +1502,7 @@
(define_insn "compare_ltu"
[(set (match_operand:BI 0 "cc_operand" "=C,C")
(ltu:BI (match_operand:SI 1 "register_operand" "d,a")
- (match_operand:SI 2 "nonmemory_operand" "dKu3,aKu3")))]
+ (match_operand:SI 2 "reg_or_const_int_operand" "dKu3,aKu3")))]
""
"cc =%1<%2 (iu);"
[(set_attr "type" "compare")])
diff --git a/gcc/config/bfin/predicates.md b/gcc/config/bfin/predicates.md
index 139bc73..7abd129 100644
--- a/gcc/config/bfin/predicates.md
+++ b/gcc/config/bfin/predicates.md
@@ -49,6 +49,11 @@
(and (match_code "const_int")
(match_test "log2constp (INTVAL (op))"))))
+;; Return nonzero if OP is a register or an integer constant.
+(define_predicate "reg_or_const_int_operand"
+ (ior (match_operand 0 "register_operand")
+ (match_code "const_int")))
+
;; Like register_operand, but make sure that hard regs have a valid mode.
(define_predicate "valid_reg_operand"
(match_operand 0 "register_operand")