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
This commit is contained in:
Bernd Schmidt 2005-07-11 16:15:45 +00:00 committed by Bernd Schmidt
parent 3fb192d2c7
commit 7ddcf3d26f
3 changed files with 17 additions and 7 deletions

View File

@ -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.

View File

@ -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")])

View File

@ -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")