X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTableGenFundamentals.html;h=5be11624ced305d1c411fd5ad5cfe106a9b17f0d;hb=b2b31a6f93f5329c86e41c04ec8c33799d012f9e;hp=48fdd2a2018fe0ef2f4606784739a4c77007134b;hpb=e6c27de069225e1122c78385ad22a2ff656db8e6;p=oota-llvm.git diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html index 48fdd2a2018..5be11624ced 100644 --- a/docs/TableGenFundamentals.html +++ b/docs/TableGenFundamentals.html @@ -151,11 +151,10 @@ file prints this (at the time of this writing):

bit isReMaterializable = 0; bit isPredicable = 0; bit hasDelaySlot = 0; - bit usesCustomDAGSchedInserter = 0; + bit usesCustomInserter = 0; bit hasCtrlDep = 0; bit isNotDuplicable = 0; bit hasSideEffects = 0; - bit mayHaveSideEffects = 0; bit neverHasSideEffects = 0; InstrItinClass Itinerary = NoItinerary; string Constraints = ""; @@ -189,7 +188,7 @@ backend, and is only shown as an example.

As you can see, a lot of information is needed for every instruction supported by the code generator, and specifying it all manually would be -unmaintainble, prone to bugs, and tiring to do in the first place. Because we +unmaintainable, prone to bugs, and tiring to do in the first place. Because we are using TableGen, all of the information was derived from the following definition:

@@ -334,8 +333,9 @@ The TableGen types are:

This type represents a nestable directed graph of elements.
code
-
This represents a big hunk of text. NOTE: I don't remember why this is - distinct from string!
+
This represents a big hunk of text. This is lexically distinct from + string values because it doesn't require escapeing double quotes and other + common characters that occur in code.

To date, these types have been sufficient for describing things that @@ -371,8 +371,11 @@ supported include:

string value
[{ ... }]
code fragment
-
[ X, Y, Z ]
-
list value.
+
[ X, Y, Z ]<type>
+
list value. <type> is the type of the list +element and is usually optional. In rare cases, +TableGen is unable to deduce the element type in +which case the user must specify it explicitly.
{ a, b, c }
initializer for a "bits<3>" value
value
@@ -398,12 +401,32 @@ supported include:

!strconcat(a, b)
A string value that is the result of concatenating the 'a' and 'b' strings.
-
!cast(a)
+
!cast<type>(a)
A symbol of type type obtained by looking up the string 'a' in the symbol table. If the type of 'a' does not match type, TableGen -aborts with an error.
+aborts with an error. !cast<string> is a special case in that the argument must +be an object defined by a 'def' construct.
!nameconcat<type>(a, b)
-
Shorthand for !cast(!strconcat(a, b))
+
Shorthand for !cast<type>(!strconcat(a, b))
+
!subst(a, b, c)
+
If 'a' and 'b' are of string type or are symbol references, substitute +'b' for 'a' in 'c.' This operation is analogous to $(subst) in GNU make.
+
!foreach(a, b, c)
+
For each member 'b' of dag or list 'a' apply operator 'c.' 'b' is a +dummy variable that should be declared as a member variable of an instantiated +class. This operation is analogous to $(foreach) in GNU make.
+
!car(a)
+
The first element of list 'a.'
+
!cdr(a)
+
The 2nd-N elements of list 'a.'
+
!null(a)
+
An integer {0,1} indicating whether list 'a' is empty.
+
!if(a,b,c)
+
'b' if the result of integer operator 'a' is nonzero, 'c' otherwise.
+
!eq(a,b)
+
Integer one if string a is equal to string b, zero otherwise. This + only operates on string objects. Use !cast to compare other + types of objects.

Note that all of the values have rules specifying how they convert to values @@ -733,6 +756,22 @@ opened, as in the case with the CALL* instructions above.

+ +
Code Generator backend info
+ + +

Expressions used by code generator to describe instructions and isel +patterns:

+ +
+ +
(implicit a)
+
an implicitly defined physical register. This tells the dag instruction + selection emitter the input pattern's extra definitions matches implicit + physical register definitions.
+ +
+
TableGen backends