public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5775] VAX: Use an int iterator to produce individual interlocked branches
@ 2020-12-05 18:28 Maciej W. Rozycki
  0 siblings, 0 replies; only message in thread
From: Maciej W. Rozycki @ 2020-12-05 18:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2500add25bd3258a66cc7ae199ab7eae53cc3202

commit r11-5775-g2500add25bd3258a66cc7ae199ab7eae53cc3202
Author: Maciej W. Rozycki <macro@linux-mips.org>
Date:   Sat Dec 5 18:26:25 2020 +0000

    VAX: Use an int iterator to produce individual interlocked branches
    
    With mode-specific interlocked branch insns already folded into iterated
    templates now fold the two templates into one too, observing that the
    only difference between them is the value of the bit branched on, which
    is of course reflected both in the RTL expression and the instruction
    produced.  Use an int iterator to iterate over the bit value, making use
    of the newly-added wide integer support, and substituting patterns as
    necessary to produce equivalent individual insns.  No functional change.
    
            gcc/
            * config/vax/builtins.md (bit): New int iterator.
            (ccss): New int attribute.
            (jbbssi<mode>, jbbcci<mode>): Fold insns into...
            (jbb<ccss>i<mode>): ... this.

Diff:
---
 gcc/config/vax/builtins.md | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/gcc/config/vax/builtins.md b/gcc/config/vax/builtins.md
index 473b44f489f..8bbcd603d13 100644
--- a/gcc/config/vax/builtins.md
+++ b/gcc/config/vax/builtins.md
@@ -26,6 +26,9 @@
 
 (define_mode_attr bb_mem [(QI "m") (HI "Q") (SI "Q")])
 
+(define_int_iterator bit [0 1])
+(define_int_attr ccss [(0 "cc") (1 "ss")])
+
 (define_expand "ffssi2"
   [(set (match_operand:SI 0 "nonimmediate_operand" "")
 	(ffs:SI (match_operand:SI 1 "general_operand" "")))]
@@ -75,24 +78,6 @@
   DONE;
 }")
 
-(define_insn "jbbssi<mode>"
-  [(parallel
-    [(set (pc)
-	  (if_then_else
-	    (eq (zero_extract:SI
-		  (match_operand:VAXint 0 "memory_operand" "<bb_mem>")
-		  (const_int 1)
-		  (match_operand:SI 1 "general_operand" "nrmT"))
-		(const_int 1))
-	    (label_ref (match_operand 2 "" ""))
-	    (pc)))
-     (set (zero_extract:SI (match_operand:VAXint 3 "memory_operand" "+0")
-			   (const_int 1)
-			   (match_dup 1))
-	  (const_int 1))])]
-  ""
-  "jbssi %1,%0,%l2")
-
 (define_expand "sync_lock_release<mode>"
   [(set (match_operand:VAXint 0 "memory_operand" "+m")
 	(unspec:VAXint [(match_operand:VAXint 1 "const_int_operand" "n")
@@ -113,7 +98,7 @@
   DONE;
 }")
 
-(define_insn "jbbcci<mode>"
+(define_insn "jbb<ccss>i<mode>"
   [(parallel
     [(set (pc)
 	  (if_then_else
@@ -121,12 +106,12 @@
 		  (match_operand:VAXint 0 "memory_operand" "<bb_mem>")
 		  (const_int 1)
 		  (match_operand:SI 1 "general_operand" "nrmT"))
-		(const_int 0))
+		(const_int bit))
 	    (label_ref (match_operand 2 "" ""))
 	    (pc)))
      (set (zero_extract:SI (match_operand:VAXint 3 "memory_operand" "+0")
 			   (const_int 1)
 			   (match_dup 1))
-	  (const_int 0))])]
+	  (const_int bit))])]
   ""
-  "jbcci %1,%0,%l2")
+  "jb<ccss>i %1,%0,%l2")


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-05 18:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 18:28 [gcc r11-5775] VAX: Use an int iterator to produce individual interlocked branches Maciej W. Rozycki

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).