@@ -219,17 +219,17 @@ TableGen provides "bang operators" that have a wide variety of uses:
219219
220220.. productionlist ::
221221 BangOperator: one of
222- : !add !and !cast !con !dag
223- : !div !empty !eq !exists !filter
224- : !find !foldl !foreach !ge !getdagarg
225- : !getdagname !getdagop !gt !head !if
226- : !initialized !instances !interleave !isa !le
227- : !listconcat !listflatten !listremove !listsplat !logtwo
228- : !lt !match !mul !ne !not
229- : !or !range !repr !setdagarg !setdagname
230- : !setdagop !shl !size !sra !srl
231- : !strconcat !sub !subst !substr !tail
232- : !tolower !toupper !xor
222+ : !add !and !cast !con !dag
223+ : !div !empty !eq !exists !filter
224+ : !find !foldl !foreach !ge !getdagarg
225+ : !getdagname !getdagop !getdagopname ! gt !head
226+ : !if !initialized !instances !interleave !isa
227+ : !le ! listconcat !listflatten !listremove !listsplat
228+ : !logtwo !lt !match !mul !ne
229+ : !not ! or !range !repr !setdagarg
230+ : !setdagname !setdagop !setdagopname !shl !size
231+ : !sra !srl !strconcat !sub !subst
232+ : !substr !tail ! tolower !toupper !xor
233233
234234The ``!cond `` operator has a slightly different
235235syntax compared to other bang operators, so it is defined separately:
@@ -1443,7 +1443,8 @@ DAG.
14431443
14441444The following bang operators are useful for working with DAGs:
14451445``!con ``, ``!dag ``, ``!empty ``, ``!foreach ``, ``!getdagarg ``, ``!getdagname ``,
1446- ``!getdagop ``, ``!setdagarg ``, ``!setdagname ``, ``!setdagop ``, ``!size ``.
1446+ ``!getdagop ``, ``!getdagopname ``, ``!setdagarg ``, ``!setdagname ``, ``!setdagop ``,
1447+ ``!setdagopname ``, ``!size ``.
14471448
14481449Defvar in a record body
14491450-----------------------
@@ -1695,9 +1696,11 @@ and non-0 as true.
16951696 This operator concatenates the DAG nodes *a *, *b *, etc. Their operations
16961697 must equal.
16971698
1698- ``!con((op a1:$name1, a2:$name2), (op b1:$name3)) ``
1699+ ``!con((op:$lhs a1:$name1, a2:$name2), (op:$rhs b1:$name3)) ``
16991700
1700- results in the DAG node ``(op a1:$name1, a2:$name2, b1:$name3) ``.
1701+ results in the DAG node ``(op:$lhs a1:$name1, a2:$name2, b1:$name3) ``.
1702+ The name of the dag operator is derived from the LHS DAG node if it is
1703+ set, otherwise from the RHS DAG node.
17011704
17021705``!cond( ``\ *cond1 * ``: `` *val1 *\ ``, `` *cond2 * ``: `` *val2 *\ ``, ..., `` *condn * ``: `` *valn *\ ``) ``
17031706 This operator tests *cond1 * and returns *val1 * if the result is true.
@@ -1819,6 +1822,10 @@ and non-0 as true.
18191822
18201823 dag d = !dag(!getdagop(someDag), args, names);
18211824
1825+ ``!getdagopname( ``\ *dag *\ ``) ``
1826+ This operator retrieves the name of the given *dag * operator. If the operator
1827+ has no name associated, ``? `` is returned.
1828+
18221829``!gt( ``\ *a *\ `, ` *b *\ ``) ``
18231830 This operator produces 1 if *a * is greater than *b *; 0 otherwise.
18241831 The arguments must be ``bit ``, ``bits ``, ``int ``, or ``string `` values.
@@ -1949,6 +1956,10 @@ and non-0 as true.
19491956
19501957 Example: ``!setdagop((foo 1, 2), bar) `` results in ``(bar 1, 2) ``.
19511958
1959+ ``!setdagopname( ``\ *dag *\ ``, ``\ *name *\ ``) ``
1960+ This operator produces a DAG node with the same operator and arguments as
1961+ *dag *, but replacing the name of the operator with *name *.
1962+
19521963``!shl( ``\ *a *\ ``, `` *count *\ ``) ``
19531964 This operator shifts *a * left logically by *count * bits and produces the resulting
19541965 value. The operation is performed on a 64-bit integer; the result
0 commit comments