Commit 7ddcf3d2 by Bernd Schmidt Committed by Bernd Schmidt

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
parent 3fb192d2
2005-07-11 Bernd Schmidt <bernd.schmidt@analog.com> 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". * config/bfin/bfin.md (define_attr "type"): Add "sync".
(define_insn_reservation "alu"): Likewise. (define_insn_reservation "alu"): Likewise.
(csync, ssync): Now of type sync. (csync, ssync): Now of type sync.
......
...@@ -1451,7 +1451,7 @@ ...@@ -1451,7 +1451,7 @@
(define_expand "cmpsi" (define_expand "cmpsi"
[(set (cc0) (compare (match_operand:SI 0 "register_operand" "") [(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]; bfin_compare_op0 = operands[0];
...@@ -1462,7 +1462,7 @@ ...@@ -1462,7 +1462,7 @@
(define_insn "compare_eq" (define_insn "compare_eq"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(eq:BI (match_operand:SI 1 "register_operand" "d,a") (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;" "cc =%1==%2;"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
...@@ -1470,7 +1470,7 @@ ...@@ -1470,7 +1470,7 @@
(define_insn "compare_ne" (define_insn "compare_ne"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(ne:BI (match_operand:SI 1 "register_operand" "d,a") (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" "0"
"cc =%1!=%2;" "cc =%1!=%2;"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
...@@ -1478,7 +1478,7 @@ ...@@ -1478,7 +1478,7 @@
(define_insn "compare_lt" (define_insn "compare_lt"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(lt:BI (match_operand:SI 1 "register_operand" "d,a") (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;" "cc =%1<%2;"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
...@@ -1486,7 +1486,7 @@ ...@@ -1486,7 +1486,7 @@
(define_insn "compare_le" (define_insn "compare_le"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(le:BI (match_operand:SI 1 "register_operand" "d,a") (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;" "cc =%1<=%2;"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
...@@ -1494,7 +1494,7 @@ ...@@ -1494,7 +1494,7 @@
(define_insn "compare_leu" (define_insn "compare_leu"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(leu:BI (match_operand:SI 1 "register_operand" "d,a") (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);" "cc =%1<=%2 (iu);"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
...@@ -1502,7 +1502,7 @@ ...@@ -1502,7 +1502,7 @@
(define_insn "compare_ltu" (define_insn "compare_ltu"
[(set (match_operand:BI 0 "cc_operand" "=C,C") [(set (match_operand:BI 0 "cc_operand" "=C,C")
(ltu:BI (match_operand:SI 1 "register_operand" "d,a") (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);" "cc =%1<%2 (iu);"
[(set_attr "type" "compare")]) [(set_attr "type" "compare")])
......
...@@ -49,6 +49,11 @@ ...@@ -49,6 +49,11 @@
(and (match_code "const_int") (and (match_code "const_int")
(match_test "log2constp (INTVAL (op))")))) (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. ;; Like register_operand, but make sure that hard regs have a valid mode.
(define_predicate "valid_reg_operand" (define_predicate "valid_reg_operand"
(match_operand 0 "register_operand") (match_operand 0 "register_operand")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment