Commit d9c50233 by Claudiu Zissulescu Committed by Claudiu Zissulescu

[ARC] Fix failing pr77309 for ARC700

The patterns neg_scc_insn and not_scc_insn are not correct, leading to
failing pr77309 test for ARC700. Add two new bic compare with zero
patterns to improve output code.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (bic_f): Use cc_set_register predicate.
	(bic_cmp0_noout): New pattern.
	(bic_cmp0): Likewise.
	(neg_scc_insn): Remove pattern.
	(not_scc_insn): Likewise.

From-SVN: r278610
parent 713877cb
2019-11-22 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (bic_f): Use cc_set_register predicate.
(bic_cmp0_noout): New pattern.
(bic_cmp0): Likewise.
(neg_scc_insn): Remove pattern.
(not_scc_insn): Likewise.
2019-11-21 Harald van Dijk <harald@gigawatt.nl> 2019-11-21 Harald van Dijk <harald@gigawatt.nl>
* doc/invoke.texi (-fcommon): Remove claim about ISO C. * doc/invoke.texi (-fcommon): Remove claim about ISO C.
...@@ -1263,7 +1263,7 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -1263,7 +1263,7 @@ core_3, archs4x, archs4xd, archs4xd_slow"
"") "")
(define_insn "*bic_f" (define_insn "*bic_f"
[(set (match_operand 3 "cc_register" "=Rcc,Rcc,Rcc") [(set (match_operand 3 "cc_set_register" "")
(match_operator 4 "zn_compare_operator" (match_operator 4 "zn_compare_operator"
[(and:SI (match_operand:SI 1 "register_operand" "c,0,c") [(and:SI (match_operand:SI 1 "register_operand" "c,0,c")
(not:SI (not:SI
...@@ -1277,6 +1277,34 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -1277,6 +1277,34 @@ core_3, archs4x, archs4xd, archs4xd_slow"
(set_attr "cond" "set_zn,set_zn,set_zn") (set_attr "cond" "set_zn,set_zn,set_zn")
(set_attr "length" "4,4,8")]) (set_attr "length" "4,4,8")])
(define_insn "*bic_cmp0_noout"
[(set (match_operand 0 "cc_set_register" "")
(compare:CC_ZN
(and:SI (not:SI (match_operand:SI 1 "nonmemory_operand" "Lr,Cal,r"))
(match_operand:SI 2 "nonmemory_operand" "r,r,Cal"))
(const_int 0)))]
"register_operand (operands[1], SImode)
|| register_operand (operands[2], SImode)"
"bic.f\\t0,%2,%1"
[(set_attr "type" "unary")
(set_attr "cond" "set_zn")
(set_attr "length" "4,8,8")])
(define_insn "*bic_cmp0"
[(set (match_operand 0 "cc_set_register" "")
(compare:CC_ZN
(and:SI (not:SI (match_operand:SI 1 "nonmemory_operand" "Lr,Cal,r"))
(match_operand:SI 2 "nonmemory_operand" "r,r,Cal"))
(const_int 0)))
(set (match_operand:SI 3 "register_operand" "=r,r,r")
(and:SI (not:SI (match_dup 1)) (match_dup 2)))]
"register_operand (operands[1], SImode)
|| register_operand (operands[2], SImode)"
"bic.f\\t%3,%2,%1"
[(set_attr "type" "unary")
(set_attr "cond" "set_zn")
(set_attr "length" "4,8,8")])
(define_expand "movdi" (define_expand "movdi"
[(set (match_operand:DI 0 "move_dest_operand" "") [(set (match_operand:DI 0 "move_dest_operand" "")
(match_operand:DI 1 "general_operand" ""))] (match_operand:DI 1 "general_operand" ""))]
...@@ -3762,28 +3790,6 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -3762,28 +3790,6 @@ core_3, archs4x, archs4xd, archs4xd_slow"
} }
[(set_attr "type" "unary")]) [(set_attr "type" "unary")])
;; ??? At least for ARC600, we should use sbc b,b,s12 if we want a value
;; that is one lower if the carry flag is set.
;; ??? Look up negscc insn. See pa.md for example.
(define_insn "*neg_scc_insn"
[(set (match_operand:SI 0 "dest_reg_operand" "=w")
(neg:SI (match_operator:SI 1 "proper_comparison_operator"
[(reg CC_REG) (const_int 0)])))]
""
"mov %0,-1\;sub.%D1 %0,%0,%0"
[(set_attr "type" "unary")
(set_attr "length" "8")])
(define_insn "*not_scc_insn"
[(set (match_operand:SI 0 "dest_reg_operand" "=w")
(not:SI (match_operator:SI 1 "proper_comparison_operator"
[(reg CC_REG) (const_int 0)])))]
""
"mov %0,1\;sub.%d1 %0,%0,%0"
[(set_attr "type" "unary")
(set_attr "length" "8")])
; cond_exec patterns ; cond_exec patterns
(define_insn "*movsi_ne" (define_insn "*movsi_ne"
[(cond_exec [(cond_exec
......
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