From 2500add25bd3258a66cc7ae199ab7eae53cc3202 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sat, 5 Dec 2020 18:26:25 +0000 Subject: [PATCH] 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, jbbcci): Fold insns into... (jbbi): ... this. --- 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" - [(parallel - [(set (pc) - (if_then_else - (eq (zero_extract:SI - (match_operand:VAXint 0 "memory_operand" "") - (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" [(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" +(define_insn "jbbi" [(parallel [(set (pc) (if_then_else @@ -121,12 +106,12 @@ (match_operand:VAXint 0 "memory_operand" "") (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") + "jbi %1,%0,%l2") -- 2.30.2