X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTableGenFundamentals.html;h=ec87f2967cb4c8e135389c01f5e85abff8d63e5e;hb=99a8205ae366d9e6bd3cdc6561a5715a5b665589;hp=a89e60dba9a5d32beb720293f128c7a6774a3532;hpb=364a39fc1ce3e50a062b4646364221b306bc8a56;p=oota-llvm.git diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html index a89e60dba9a..ec87f2967cb 100644 --- a/docs/TableGenFundamentals.html +++ b/docs/TableGenFundamentals.html @@ -104,8 +104,10 @@ definition, so the backend can find all definitions of a particular class, such as "Instruction".

TableGen multiclasses are groups of abstract records that are -instantiated all at once. Each instantiation can result in multiple TableGen -definitions.

+instantiated all at once. Each instantiation can result in multiple +TableGen definitions. If a multiclass inherits from another multiclass, +the definitions in the sub-multiclass become part of the current +multiclass, as if they were declared in the current multiclass.

@@ -138,7 +140,7 @@ file prints this (at the time of this writing):

bit isIndirectBranch = 0; bit isBarrier = 0; bit isCall = 0; - bit isSimpleLoad = 0; + bit canFoldAsLoad = 0; bit mayLoad = 0; bit mayStore = 0; bit isImplicitDef = 0; @@ -369,8 +371,11 @@ supported include:

string value
[{ ... }]
code fragment
-
[ X, Y, Z ]
-
list value.
+
[ X, Y, Z ]
+
list value. 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
@@ -393,9 +398,38 @@ supported include:

a dag value. The first element is required to be a record definition, the remaining elements in the list may be arbitrary other values, including nested `dag' values.
+
(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.
+
(parallel (a), (b))
+
a list of dags specifying parallel operations which map to the same + instruction.
!strconcat(a, b)
A string value that is the result of concatenating the 'a' and 'b' strings.
+
!cast(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. !cast 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))
+
!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.

Note that all of the values have rules specifying how they convert to values @@ -625,8 +659,10 @@ Here is an example TableGen fragment that shows this idea:

The name of the resultant definitions has the multidef fragment names appended to them, so this defines ADD_rr, ADD_ri, - SUB_rr, etc. Using a multiclass this way is exactly equivalent to - instantiating the classes multiple times yourself, e.g. by writing:

+ SUB_rr, etc. A defm may inherit from multiple multiclasses, + instantiating definitions from each multiclass. Using a multiclass + this way is exactly equivalent to instantiating the classes multiple + times yourself, e.g. by writing:

@@ -694,7 +730,7 @@ File-scope let expressions are really just another way that TableGen allows the
 end-user to factor out commonality from the records.

File-scope "let" expressions take a comma-separated list of bindings to -apply, and one of more records to bind the values in. Here are some +apply, and one or more records to bind the values in. Here are some examples:

@@ -740,9 +776,9 @@ This should highlight the APIs in TableGen/Record.h.


Valid CSS! + src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"> Valid HTML 4.01! + src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> Chris Lattner
LLVM Compiler Infrastructure