aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/TableGen/ProgRef.rst
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/docs/TableGen/ProgRef.rst')
-rw-r--r--llvm/docs/TableGen/ProgRef.rst39
1 files changed, 25 insertions, 14 deletions
diff --git a/llvm/docs/TableGen/ProgRef.rst b/llvm/docs/TableGen/ProgRef.rst
index 7b30698..2b1af05 100644
--- a/llvm/docs/TableGen/ProgRef.rst
+++ b/llvm/docs/TableGen/ProgRef.rst
@@ -219,17 +219,17 @@ TableGen provides "bang operators" that have a wide variety of uses:
.. productionlist::
BangOperator: one of
- : !add !and !cast !con !dag
- : !div !empty !eq !exists !filter
- : !find !foldl !foreach !ge !getdagarg
- : !getdagname !getdagop !gt !head !if
- : !initialized !instances !interleave !isa !le
- : !listconcat !listflatten !listremove !listsplat !logtwo
- : !lt !match !mul !ne !not
- : !or !range !repr !setdagarg !setdagname
- : !setdagop !shl !size !sra !srl
- : !strconcat !sub !subst !substr !tail
- : !tolower !toupper !xor
+ : !add !and !cast !con !dag
+ : !div !empty !eq !exists !filter
+ : !find !foldl !foreach !ge !getdagarg
+ : !getdagname !getdagop !getdagopname !gt !head
+ : !if !initialized !instances !interleave !isa
+ : !le !listconcat !listflatten !listremove !listsplat
+ : !logtwo !lt !match !mul !ne
+ : !not !or !range !repr !setdagarg
+ : !setdagname !setdagop !setdagopname !shl !size
+ : !sra !srl !strconcat !sub !subst
+ : !substr !tail !tolower !toupper !xor
The ``!cond`` operator has a slightly different
syntax compared to other bang operators, so it is defined separately:
@@ -1443,7 +1443,8 @@ DAG.
The following bang operators are useful for working with DAGs:
``!con``, ``!dag``, ``!empty``, ``!foreach``, ``!getdagarg``, ``!getdagname``,
-``!getdagop``, ``!setdagarg``, ``!setdagname``, ``!setdagop``, ``!size``.
+``!getdagop``, ``!getdagopname``, ``!setdagarg``, ``!setdagname``, ``!setdagop``,
+``!setdagopname``, ``!size``.
Defvar in a record body
-----------------------
@@ -1695,9 +1696,11 @@ and non-0 as true.
This operator concatenates the DAG nodes *a*, *b*, etc. Their operations
must equal.
- ``!con((op a1:$name1, a2:$name2), (op b1:$name3))``
+ ``!con((op:$lhs a1:$name1, a2:$name2), (op:$rhs b1:$name3))``
- results in the DAG node ``(op a1:$name1, a2:$name2, b1:$name3)``.
+ results in the DAG node ``(op:$lhs a1:$name1, a2:$name2, b1:$name3)``.
+ The name of the dag operator is derived from the LHS DAG node if it is
+ set, otherwise from the RHS DAG node.
``!cond(``\ *cond1* ``:`` *val1*\ ``,`` *cond2* ``:`` *val2*\ ``, ...,`` *condn* ``:`` *valn*\ ``)``
This operator tests *cond1* and returns *val1* if the result is true.
@@ -1819,6 +1822,10 @@ and non-0 as true.
dag d = !dag(!getdagop(someDag), args, names);
+``!getdagopname(``\ *dag*\ ``)``
+ This operator retrieves the name of the given *dag* operator. If the operator
+ has no name associated, ``?`` is returned.
+
``!gt(``\ *a*\ `,` *b*\ ``)``
This operator produces 1 if *a* is greater than *b*; 0 otherwise.
The arguments must be ``bit``, ``bits``, ``int``, or ``string`` values.
@@ -1949,6 +1956,10 @@ and non-0 as true.
Example: ``!setdagop((foo 1, 2), bar)`` results in ``(bar 1, 2)``.
+``!setdagopname(``\ *dag*\ ``,``\ *name*\ ``)``
+ This operator produces a DAG node with the same operator and arguments as
+ *dag*, but replacing the name of the operator with *name*.
+
``!shl(``\ *a*\ ``,`` *count*\ ``)``
This operator shifts *a* left logically by *count* bits and produces the resulting
value. The operation is performed on a 64-bit integer; the result