public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] Remove Thumb-2 iordi_not patterns
@ 2017-01-17 18:01 Wilco Dijkstra
  2017-02-02 14:44 ` Wilco Dijkstra
  2017-04-20 16:02 ` Wilco Dijkstra
  0 siblings, 2 replies; 12+ messages in thread
From: Wilco Dijkstra @ 2017-01-17 18:01 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd, Kyrylo Tkachov, Richard Earnshaw

After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-	(ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-		(match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-	(ior:DI (not:DI (zero_extend:DI
-			 (match_operand:SI 2 "s_register_operand" "r,r")))
-		(match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-	(ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-		(zero_extend:DI
-		 (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-	(ior:DI (not:DI (sign_extend:DI
-			 (match_operand:SI 2 "s_register_operand" "r,r")))
-		(match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-				(ashiftrt:SI (match_dup 2) (const_int 31)))
-			       (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
 	(ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-01-17 18:01 [PATCH][ARM] Remove Thumb-2 iordi_not patterns Wilco Dijkstra
@ 2017-02-02 14:44 ` Wilco Dijkstra
  2017-02-23 18:07   ` Wilco Dijkstra
  2017-04-20 16:02 ` Wilco Dijkstra
  1 sibling, 1 reply; 12+ messages in thread
From: Wilco Dijkstra @ 2017-02-02 14:44 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd, Kyrylo Tkachov, Richard Earnshaw


ping

From: Wilco Dijkstra
Sent: 17 January 2017 18:00
To: GCC Patches
Cc: nd; Kyrylo Tkachov; Richard Earnshaw
Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
    
After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-               (match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (zero_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-               (zero_extend:DI
-                (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (sign_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-                               (ashiftrt:SI (match_dup 2) (const_int 31)))
-                              (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
         (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))
    

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-02-02 14:44 ` Wilco Dijkstra
@ 2017-02-23 18:07   ` Wilco Dijkstra
  0 siblings, 0 replies; 12+ messages in thread
From: Wilco Dijkstra @ 2017-02-23 18:07 UTC (permalink / raw)
  To: GCC Patches; +Cc: nd, Kyrylo Tkachov, Richard Earnshaw


    

ping

From: Wilco Dijkstra
Sent: 17 January 2017 18:00
To: GCC Patches
Cc: nd; Kyrylo Tkachov; Richard Earnshaw
Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
    
After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-               (match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (zero_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-               (zero_extend:DI
-                (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (sign_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-                               (ashiftrt:SI (match_dup 2) (const_int 31)))
-                              (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
         (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))
        

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-01-17 18:01 [PATCH][ARM] Remove Thumb-2 iordi_not patterns Wilco Dijkstra
  2017-02-02 14:44 ` Wilco Dijkstra
@ 2017-04-20 16:02 ` Wilco Dijkstra
  2017-06-13 14:00   ` Wilco Dijkstra
  1 sibling, 1 reply; 12+ messages in thread
From: Wilco Dijkstra @ 2017-04-20 16:02 UTC (permalink / raw)
  To: GCC Patches, Kyrylo Tkachov; +Cc: nd, Richard Earnshaw


ping


From: Wilco Dijkstra
Sent: 17 January 2017 18:00
To: GCC Patches
Cc: nd; Kyrylo Tkachov; Richard Earnshaw
Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
    
After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-               (match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (zero_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-               (zero_extend:DI
-                (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (sign_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-                               (ashiftrt:SI (match_dup 2) (const_int 31)))
-                              (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
         (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))
    

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-04-20 16:02 ` Wilco Dijkstra
@ 2017-06-13 14:00   ` Wilco Dijkstra
  2017-06-27 15:38     ` Wilco Dijkstra
  0 siblings, 1 reply; 12+ messages in thread
From: Wilco Dijkstra @ 2017-06-13 14:00 UTC (permalink / raw)
  To: GCC Patches, Kyrylo Tkachov; +Cc: nd, Richard Earnshaw


ping


From: Wilco Dijkstra
Sent: 17 January 2017 18:00
To: GCC Patches
Cc: nd; Kyrylo Tkachov; Richard Earnshaw
Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
    
After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-               (match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (zero_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-               (zero_extend:DI
-                (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (sign_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-                               (ashiftrt:SI (match_dup 2) (const_int 31)))
-                              (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
         (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))
        

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-06-13 14:00   ` Wilco Dijkstra
@ 2017-06-27 15:38     ` Wilco Dijkstra
  2017-09-04 16:43       ` Kyrill Tkachov
  0 siblings, 1 reply; 12+ messages in thread
From: Wilco Dijkstra @ 2017-06-27 15:38 UTC (permalink / raw)
  To: GCC Patches, Kyrylo Tkachov; +Cc: nd, Richard Earnshaw

    

ping


From: Wilco Dijkstra
Sent: 17 January 2017 18:00
To: GCC Patches
Cc: nd; Kyrylo Tkachov; Richard Earnshaw
Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
    
After Bernd's DImode patch [1] almost all DImode operations are expanded
early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
patterns are no longer used - the split ORR and NOT instructions are merged
into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
on Thumb-2, and after this patch the orndi3_neon pattern matches instead
(which still emits ORN).  After this there are no Thumb-2 specific DImode patterns.

[1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html

ChangeLog:
2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>

        * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
        (iordi_notzesidi_di): Likewise.
        (iordi_notdi_zesidi): Likewise.
        (iordi_notsesidi_di): Likewise.

--

diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -1434,103 +1434,6 @@
    (set_attr "type" "alu_sreg")]
 )
 
-; Constants for op 2 will never be given to these patterns.
-(define_insn_and_split "*iordi_notdi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
-               (match_operand:DI 2 "s_register_operand" "r,0")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
-   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[5] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notzesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (zero_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,?r")))]
-  "TARGET_THUMB2"
-  "#"
-  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (const_int -1))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "4,8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notdi_zesidi"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
-               (zero_extend:DI
-                (match_operand:SI 1 "s_register_operand" "r,r"))))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (not:SI (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-    operands[4] = gen_highpart (SImode, operands[2]);
-    operands[2] = gen_lowpart (SImode, operands[2]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
-(define_insn_and_split "*iordi_notsesidi_di"
-  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
-       (ior:DI (not:DI (sign_extend:DI
-                        (match_operand:SI 2 "s_register_operand" "r,r")))
-               (match_operand:DI 1 "s_register_operand" "0,r")))]
-  "TARGET_THUMB2"
-  "#"
-  "TARGET_THUMB2 && reload_completed"
-  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
-   (set (match_dup 3) (ior:SI (not:SI
-                               (ashiftrt:SI (match_dup 2) (const_int 31)))
-                              (match_dup 4)))]
-  "
-  {
-    operands[3] = gen_highpart (SImode, operands[0]);
-    operands[0] = gen_lowpart (SImode, operands[0]);
-    operands[4] = gen_highpart (SImode, operands[1]);
-    operands[1] = gen_lowpart (SImode, operands[1]);
-  }"
-  [(set_attr "length" "8")
-   (set_attr "predicable" "yes")
-   (set_attr "predicable_short_it" "no")
-   (set_attr "type" "multiple")]
-)
-
 (define_insn "*orsi_notsi_si"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
         (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))
            

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-06-27 15:38     ` Wilco Dijkstra
@ 2017-09-04 16:43       ` Kyrill Tkachov
  2017-09-04 17:07         ` Wilco Dijkstra
  0 siblings, 1 reply; 12+ messages in thread
From: Kyrill Tkachov @ 2017-09-04 16:43 UTC (permalink / raw)
  To: Wilco Dijkstra, GCC Patches; +Cc: nd, Richard Earnshaw

Hi Wilco,

Sorry for the delay...

On 27/06/17 16:38, Wilco Dijkstra wrote:
>
>
> ping
>
>
> From: Wilco Dijkstra
> Sent: 17 January 2017 18:00
> To: GCC Patches
> Cc: nd; Kyrylo Tkachov; Richard Earnshaw
> Subject: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
>
> After Bernd's DImode patch [1] almost all DImode operations are expanded
> early (except for -mfpu=neon). This means the Thumb-2 iordi_notdi_di
> patterns are no longer used - the split ORR and NOT instructions are 
> merged
> into ORN by Combine.  With -mfpu=neon the iordi_notdi_di patterns are used
> on Thumb-2, and after this patch the orndi3_neon pattern matches instead
> (which still emits ORN).  After this there are no Thumb-2 specific 
> DImode patterns.
>
> [1] https://gcc.gnu.org/ml/gcc-patches/2016-11/msg02796.html
>
> ChangeLog:
> 2017-01-17  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         * config/arm/thumb2.md (iordi_notdi_di): Remove pattern.
>         (iordi_notzesidi_di): Likewise.
>         (iordi_notdi_zesidi): Likewise.
>         (iordi_notsesidi_di): Likewise.
>
> --
>
> diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
> index 
> 2e7580f220eae1524fef69719b1796f50f5cf27c..91471d4650ecae4f4e87b549d84d11adf3014ad2 
> 100644
> --- a/gcc/config/arm/thumb2.md
> +++ b/gcc/config/arm/thumb2.md
> @@ -1434,103 +1434,6 @@
>     (set_attr "type" "alu_sreg")]
>  )
>
> -; Constants for op 2 will never be given to these patterns.
> -(define_insn_and_split "*iordi_notdi_di"
> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
> -       (ior:DI (not:DI (match_operand:DI 1 "s_register_operand" "0,r"))
> -               (match_operand:DI 2 "s_register_operand" "r,0")))]
> -  "TARGET_THUMB2"
> -  "#"
> -  "TARGET_THUMB2 && reload_completed"
> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 1)) (match_dup 2)))
> -   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
> -  "
> -  {
> -    operands[3] = gen_highpart (SImode, operands[0]);
> -    operands[0] = gen_lowpart (SImode, operands[0]);
> -    operands[4] = gen_highpart (SImode, operands[1]);
> -    operands[1] = gen_lowpart (SImode, operands[1]);
> -    operands[5] = gen_highpart (SImode, operands[2]);
> -    operands[2] = gen_lowpart (SImode, operands[2]);
> -  }"
> -  [(set_attr "length" "8")
> -   (set_attr "predicable" "yes")
> -   (set_attr "predicable_short_it" "no")
> -   (set_attr "type" "multiple")]
> -)

So I get why we delete this, since we have orndi3_neon in neon.md for 
the NEON version anyway...

> -
> -(define_insn_and_split "*iordi_notzesidi_di"
> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
> -       (ior:DI (not:DI (zero_extend:DI
> -                        (match_operand:SI 2 "s_register_operand" "r,r")))
> -               (match_operand:DI 1 "s_register_operand" "0,?r")))]
> -  "TARGET_THUMB2"
> -  "#"
> -  ; (not (zero_extend...)) means operand0 will always be 0xffffffff
> -  "TARGET_THUMB2 && reload_completed"
> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
> -   (set (match_dup 3) (const_int -1))]
> -  "
> -  {
> -    operands[3] = gen_highpart (SImode, operands[0]);
> -    operands[0] = gen_lowpart (SImode, operands[0]);
> -    operands[1] = gen_lowpart (SImode, operands[1]);
> -  }"
> -  [(set_attr "length" "4,8")
> -   (set_attr "predicable" "yes")
> -   (set_attr "predicable_short_it" "no")
> -   (set_attr "type" "multiple")]
> -)
> -
> -(define_insn_and_split "*iordi_notdi_zesidi"
> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
> -       (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "0,?r"))
> -               (zero_extend:DI
> -                (match_operand:SI 1 "s_register_operand" "r,r"))))]
> -  "TARGET_THUMB2"
> -  "#"
> -  "TARGET_THUMB2 && reload_completed"
> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
> -   (set (match_dup 3) (not:SI (match_dup 4)))]
> -  "
> -  {
> -    operands[3] = gen_highpart (SImode, operands[0]);
> -    operands[0] = gen_lowpart (SImode, operands[0]);
> -    operands[1] = gen_lowpart (SImode, operands[1]);
> -    operands[4] = gen_highpart (SImode, operands[2]);
> -    operands[2] = gen_lowpart (SImode, operands[2]);
> -  }"
> -  [(set_attr "length" "8")
> -   (set_attr "predicable" "yes")
> -   (set_attr "predicable_short_it" "no")
> -   (set_attr "type" "multiple")]
> -)
> -
> -(define_insn_and_split "*iordi_notsesidi_di"
> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
> -       (ior:DI (not:DI (sign_extend:DI
> -                        (match_operand:SI 2 "s_register_operand" "r,r")))
> -               (match_operand:DI 1 "s_register_operand" "0,r")))]
> -  "TARGET_THUMB2"
> -  "#"
> -  "TARGET_THUMB2 && reload_completed"
> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
> -   (set (match_dup 3) (ior:SI (not:SI
> -                               (ashiftrt:SI (match_dup 2) (const_int 
> 31)))
> -                              (match_dup 4)))]
> -  "
> -  {
> -    operands[3] = gen_highpart (SImode, operands[0]);
> -    operands[0] = gen_lowpart (SImode, operands[0]);
> -    operands[4] = gen_highpart (SImode, operands[1]);
> -    operands[1] = gen_lowpart (SImode, operands[1]);
> -  }"
> -  [(set_attr "length" "8")
> -   (set_attr "predicable" "yes")
> -   (set_attr "predicable_short_it" "no")
> -   (set_attr "type" "multiple")]
> -)
> -

... but why can we delete all these? As far as I can see they still 
perform useful
splitting and don't have a NEON-specific pattern.
Am I missing something?

Thanks,
Kyrill


>  (define_insn "*orsi_notsi_si"
>    [(set (match_operand:SI 0 "s_register_operand" "=r")
>          (ior:SI (not:SI (match_operand:SI 2 "s_register_operand" "r"))

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-09-04 16:43       ` Kyrill Tkachov
@ 2017-09-04 17:07         ` Wilco Dijkstra
  2017-09-04 17:12           ` Kyrill Tkachov
  0 siblings, 1 reply; 12+ messages in thread
From: Wilco Dijkstra @ 2017-09-04 17:07 UTC (permalink / raw)
  To: Kyrill Tkachov, GCC Patches; +Cc: nd, Richard Earnshaw

Kyrill Tkachov wrote:


> -(define_insn_and_split "*iordi_notsesidi_di"
> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
> -       (ior:DI (not:DI (sign_extend:DI
> -                        (match_operand:SI 2 "s_register_operand" "r,r")))
> -               (match_operand:DI 1 "s_register_operand" "0,r")))]
> -  "TARGET_THUMB2"
> -  "#"
> -  "TARGET_THUMB2 && reload_completed"
> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
> -   (set (match_dup 3) (ior:SI (not:SI
> -                               (ashiftrt:SI (match_dup 2) (const_int 
> 31)))
> -                              (match_dup 4)))]
> -  "
> -  {
> -    operands[3] = gen_highpart (SImode, operands[0]);
> -    operands[0] = gen_lowpart (SImode, operands[0]);
> -    operands[4] = gen_highpart (SImode, operands[1]);
> -    operands[1] = gen_lowpart (SImode, operands[1]);
> -  }"
> -  [(set_attr "length" "8")
> -   (set_attr "predicable" "yes")
> -   (set_attr "predicable_short_it" "no")
> -   (set_attr "type" "multiple")]
> -)
> -

> ... but why can we delete all these? As far as I can see they still 
> perform useful
> splitting and don't have a NEON-specific pattern.
> Am I missing something?

After Bernd's change almost all DI mode instructions are split before register
allocation. So instructions using DI mode no longer exist and thus these
extend variants can never be matched and are thus redundant.

Note that the SI mode instructions have zero/sign extend optimized after
being split from DI mode using existing patterns.

Wilco

    

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-09-04 17:07         ` Wilco Dijkstra
@ 2017-09-04 17:12           ` Kyrill Tkachov
  2017-09-04 19:56             ` Wilco Dijkstra
  0 siblings, 1 reply; 12+ messages in thread
From: Kyrill Tkachov @ 2017-09-04 17:12 UTC (permalink / raw)
  To: Wilco Dijkstra, GCC Patches; +Cc: nd, Richard Earnshaw


On 04/09/17 18:07, Wilco Dijkstra wrote:
> Kyrill Tkachov wrote:
>
>
>> -(define_insn_and_split "*iordi_notsesidi_di"
>> -  [(set (match_operand:DI 0 "s_register_operand" "=&r,&r")
>> -       (ior:DI (not:DI (sign_extend:DI
>> -                        (match_operand:SI 2 "s_register_operand" "r,r")))
>> -               (match_operand:DI 1 "s_register_operand" "0,r")))]
>> -  "TARGET_THUMB2"
>> -  "#"
>> -  "TARGET_THUMB2 && reload_completed"
>> -  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
>> -   (set (match_dup 3) (ior:SI (not:SI
>> -                               (ashiftrt:SI (match_dup 2) (const_int
>> 31)))
>> -                              (match_dup 4)))]
>> -  "
>> -  {
>> -    operands[3] = gen_highpart (SImode, operands[0]);
>> -    operands[0] = gen_lowpart (SImode, operands[0]);
>> -    operands[4] = gen_highpart (SImode, operands[1]);
>> -    operands[1] = gen_lowpart (SImode, operands[1]);
>> -  }"
>> -  [(set_attr "length" "8")
>> -   (set_attr "predicable" "yes")
>> -   (set_attr "predicable_short_it" "no")
>> -   (set_attr "type" "multiple")]
>> -)
>> -
>> ... but why can we delete all these? As far as I can see they still
>> perform useful
>> splitting and don't have a NEON-specific pattern.
>> Am I missing something?
> After Bernd's change almost all DI mode instructions are split before register
> allocation. So instructions using DI mode no longer exist and thus these
> extend variants can never be matched and are thus redundant.

Bernd's patch splits them when we don't have NEON. When NEON is 
available though
they still maintain the DImode so we'd still benefit from these 
transformations, no?

Kyrill

> Note that the SI mode instructions have zero/sign extend optimized after
> being split from DI mode using existing patterns.
>
> Wilco
>
>      

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-09-04 17:12           ` Kyrill Tkachov
@ 2017-09-04 19:56             ` Wilco Dijkstra
  2017-09-11 15:37               ` Wilco Dijkstra
  2017-09-13 10:58               ` Kyrill Tkachov
  0 siblings, 2 replies; 12+ messages in thread
From: Wilco Dijkstra @ 2017-09-04 19:56 UTC (permalink / raw)
  To: Kyrill Tkachov, GCC Patches; +Cc: nd, Richard Earnshaw

Kyrill Tkachov wrote:

> > After Bernd's change almost all DI mode instructions are split before register
> > allocation. So instructions using DI mode no longer exist and thus these
> > extend variants can never be matched and are thus redundant.
>
> Bernd's patch splits them when we don't have NEON. When NEON is 
> available though
> they still maintain the DImode so we'd still benefit from these 
> transformations, no?

While you're right it may be possible to trigger these instructions, ORN is already
so rare that it is hardly beneficial to have an instruction for it, and ORN of an extended
value never ever happens. So there is absolutely no benefit in keeping these versions
temporarily until we fix Neon too.

For the Neon case my proposal is to use the VFP early expansion (so you get an efficient
expansion by default in all cases). You can then use -mneon-for-64bits to enable the use
of Neon instructions (which may be even better in some cases). There are quite a few
patches in this series already and more to come soon!

Wilco

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-09-04 19:56             ` Wilco Dijkstra
@ 2017-09-11 15:37               ` Wilco Dijkstra
  2017-09-13 10:58               ` Kyrill Tkachov
  1 sibling, 0 replies; 12+ messages in thread
From: Wilco Dijkstra @ 2017-09-11 15:37 UTC (permalink / raw)
  To: Kyrill Tkachov, GCC Patches; +Cc: nd, Richard Earnshaw

Any further comments?

    
Kyrill Tkachov wrote:

> > After Bernd's change almost all DI mode instructions are split before register
> > allocation. So instructions using DI mode no longer exist and thus these
> > extend variants can never be matched and are thus redundant.
>
> Bernd's patch splits them when we don't have NEON. When NEON is 
> available though
> they still maintain the DImode so we'd still benefit from these 
> transformations, no?

While you're right it may be possible to trigger these instructions, ORN is already
so rare that it is hardly beneficial to have an instruction for it, and ORN of an extended
value never ever happens. So there is absolutely no benefit in keeping these versions
temporarily until we fix Neon too.

For the Neon case my proposal is to use the VFP early expansion (so you get an efficient
expansion by default in all cases). You can then use -mneon-for-64bits to enable the use
of Neon instructions (which may be even better in some cases). There are quite a few
patches in this series already and more to come soon!

Wilco    

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH][ARM] Remove Thumb-2 iordi_not patterns
  2017-09-04 19:56             ` Wilco Dijkstra
  2017-09-11 15:37               ` Wilco Dijkstra
@ 2017-09-13 10:58               ` Kyrill Tkachov
  1 sibling, 0 replies; 12+ messages in thread
From: Kyrill Tkachov @ 2017-09-13 10:58 UTC (permalink / raw)
  To: Wilco Dijkstra, GCC Patches; +Cc: nd, Richard Earnshaw

Hi Wilco,

On 04/09/17 20:56, Wilco Dijkstra wrote:
> Kyrill Tkachov wrote:
>
>>> After Bernd's change almost all DI mode instructions are split before register
>>> allocation. So instructions using DI mode no longer exist and thus these
>>> extend variants can never be matched and are thus redundant.
>> Bernd's patch splits them when we don't have NEON. When NEON is
>> available though
>> they still maintain the DImode so we'd still benefit from these
>> transformations, no?
> While you're right it may be possible to trigger these instructions, ORN is already
> so rare that it is hardly beneficial to have an instruction for it, and ORN of an extended
> value never ever happens. So there is absolutely no benefit in keeping these versions
> temporarily until we fix Neon too.

Well, it was deemed useful enough to be added in the first place. I'd 
rather not remove it
if it can still be used. For the extended value I use the testcase:

unsigned long long
foo (unsigned long long a, unsigned long b)
{
   return a | ~(unsigned long long) b;
}

I compile with -O2 -S -mthumb -mcpu=cortex-a57 and I get:
         orn     r0, r0, r2
         mov     r1, #-1
         bx      lr

with the *iordi_notzesidi_di pattern being present in the postreload RTL 
dump.
Bernd's patches don't split DImode operations for NEON so I think we 
should still get the same
codegen without them. So this shows an example where the pattern can be 
used.


>
> For the Neon case my proposal is to use the VFP early expansion (so you get an efficient
> expansion by default in all cases). You can then use -mneon-for-64bits to enable the use
> of Neon instructions (which may be even better in some cases). There are quite a few
> patches in this series already and more to come soon!

So I think we should first move the NEON expansion to use the early VFP 
expansion
(with proper evaluation) and then once that's in and we can guarantee 
that these patterns
can indeed never match (due to having been expanded as SImode operations 
early on) we can remove
these patterns.

So I think this is overall ok, but we need to enable the early expansion 
everywhere first before going ahead
with this patch.

Thanks,
Kyrill

>
> Wilco

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-09-13 10:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-17 18:01 [PATCH][ARM] Remove Thumb-2 iordi_not patterns Wilco Dijkstra
2017-02-02 14:44 ` Wilco Dijkstra
2017-02-23 18:07   ` Wilco Dijkstra
2017-04-20 16:02 ` Wilco Dijkstra
2017-06-13 14:00   ` Wilco Dijkstra
2017-06-27 15:38     ` Wilco Dijkstra
2017-09-04 16:43       ` Kyrill Tkachov
2017-09-04 17:07         ` Wilco Dijkstra
2017-09-04 17:12           ` Kyrill Tkachov
2017-09-04 19:56             ` Wilco Dijkstra
2017-09-11 15:37               ` Wilco Dijkstra
2017-09-13 10:58               ` Kyrill Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).