Commit 63835b87 by Richard Kenner

(decrement_and_branch_until_zero): Use arithmetic_comparison_operator to decide...

(decrement_and_branch_until_zero): Use arithmetic_comparison_operator
to decide if there is comparison suitable to be expressed by condition
code from an arithmetic op.

From-SVN: r10269
parent d784886d
...@@ -4910,6 +4910,9 @@ ...@@ -4910,6 +4910,9 @@
return AS1 (jmp,%*%0); return AS1 (jmp,%*%0);
}") }")
;; ??? could transform while(--i > 0) S; to if (--i > 0) do S; while(--i);
;; if S does not change i
(define_expand "decrement_and_branch_until_zero" (define_expand "decrement_and_branch_until_zero"
[(parallel [(set (pc) [(parallel [(set (pc)
(if_then_else (ge (plus:SI (match_operand:SI 0 "general_operand" "") (if_then_else (ge (plus:SI (match_operand:SI 0 "general_operand" "")
...@@ -4925,7 +4928,7 @@ ...@@ -4925,7 +4928,7 @@
(define_insn "" (define_insn ""
[(set (pc) [(set (pc)
(if_then_else (match_operator 0 "comparison_operator" (if_then_else (match_operator 0 "arithmetic_comparison_operator"
[(plus:SI (match_operand:SI 1 "general_operand" "+r,m") [(plus:SI (match_operand:SI 1 "general_operand" "+r,m")
(match_operand:SI 2 "general_operand" "rmi,ri")) (match_operand:SI 2 "general_operand" "rmi,ri"))
(const_int 0)]) (const_int 0)])
...@@ -4952,7 +4955,7 @@ ...@@ -4952,7 +4955,7 @@
(define_insn "" (define_insn ""
[(set (pc) [(set (pc)
(if_then_else (match_operator 0 "comparison_operator" (if_then_else (match_operator 0 "arithmetic_comparison_operator"
[(minus:SI (match_operand:SI 1 "general_operand" "+r,m") [(minus:SI (match_operand:SI 1 "general_operand" "+r,m")
(match_operand:SI 2 "general_operand" "rmi,ri")) (match_operand:SI 2 "general_operand" "rmi,ri"))
(const_int 0)]) (const_int 0)])
......
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