[1/3,ARC] Fix failing pr77309 for ARC700
diff mbox series

Message ID 20191119090250.5619-1-claziss@gmail.com
State New
Headers show
Series
  • [1/3,ARC] Fix failing pr77309 for ARC700
Related show

Commit Message

Claudiu Zissulescu Nov. 19, 2019, 9:02 a.m. UTC
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.
---
 gcc/config/arc/arc.md | 52 ++++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 23 deletions(-)

Comments

Jeff Law Nov. 20, 2019, 5:41 p.m. UTC | #1
On 11/19/19 2:02 AM, Claudiu Zissulescu wrote:
> 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.
OK.

FYI between

e00e0f8c391779c8d6cc9ad2fff8056a73c765c2 (good)

fcae029b424f0546ee0efe574dff150be41271ea (bad)

I got the following regression.  I haven't looked into it yet at all,
but figured passing it along might be helpful.

> # Comparing 4 common sum files
> ## /bin/sh gcc/contrib/compare_tests  /tmp/gxx-sum1.60617 /tmp/gxx-sum2.60617
> Tests that now fail, but worked before (1 tests):
> 
> arc-sim: gcc.dg/pr86991.c (test for excess errors)


Jeff
Claudiu Zissulescu Nov. 21, 2019, 4:21 p.m. UTC | #2
Thank you for the feedback.

Regarding the error, it is just spins when it tries to vectorize a
loop in tree-vect-slp.c. Quite strange ... I will look into asap. If
you have any hint please let me know :)

Claudiu

On Wed, Nov 20, 2019 at 7:41 PM Jeff Law <law@redhat.com> wrote:
>
> On 11/19/19 2:02 AM, Claudiu Zissulescu wrote:
> > 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.
> OK.
>
> FYI between
>
> e00e0f8c391779c8d6cc9ad2fff8056a73c765c2 (good)
>
> fcae029b424f0546ee0efe574dff150be41271ea (bad)
>
> I got the following regression.  I haven't looked into it yet at all,
> but figured passing it along might be helpful.
>
> > # Comparing 4 common sum files
> > ## /bin/sh gcc/contrib/compare_tests  /tmp/gxx-sum1.60617 /tmp/gxx-sum2.60617
> > Tests that now fail, but worked before (1 tests):
> >
> > arc-sim: gcc.dg/pr86991.c (test for excess errors)
>
>
> Jeff
>
Jeff Law Nov. 21, 2019, 4:29 p.m. UTC | #3
On 11/21/19 9:21 AM, Claudiu Zissulescu wrote:
> Thank you for the feedback.
> 
> Regarding the error, it is just spins when it tries to vectorize a
> loop in tree-vect-slp.c. Quite strange ... I will look into asap. If
> you have any hint please let me know :)
Nope.  Haven't looked at it at all other than to note its existence.

jeff
Claudiu Zissulescu Nov. 21, 2019, 4:33 p.m. UTC | #4
It seems it leads to this commit
c1760d8b599ddd7253b3a72f5219f0457f8d3130, but I need to double check.

Thank you Jeff,
Claudiu

On Thu, Nov 21, 2019 at 6:30 PM Jeff Law <law@redhat.com> wrote:
>
> On 11/21/19 9:21 AM, Claudiu Zissulescu wrote:
> > Thank you for the feedback.
> >
> > Regarding the error, it is just spins when it tries to vectorize a
> > loop in tree-vect-slp.c. Quite strange ... I will look into asap. If
> > you have any hint please let me know :)
> Nope.  Haven't looked at it at all other than to note its existence.
>
> jeff
>

Patch
diff mbox series

diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index 7da52199415..d2b7a45b6e6 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -1272,7 +1272,7 @@  archs4x, archs4xd"
   "")
 
 (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"
 	  [(and:SI (match_operand:SI 1 "register_operand" "c,0,c")
 		   (not:SI
@@ -1286,6 +1286,34 @@  archs4x, archs4xd"
    (set_attr "cond" "set_zn,set_zn,set_zn")
    (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"
   [(set (match_operand:DI 0 "move_dest_operand" "")
 	(match_operand:DI 1 "general_operand" ""))]
@@ -3763,28 +3791,6 @@  archs4x, archs4xd"
 }
   [(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
 (define_insn "*movsi_ne"
   [(cond_exec