X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTableGenFundamentals.html;h=5be11624ced305d1c411fd5ad5cfe106a9b17f0d;hb=b2b31a6f93f5329c86e41c04ec8c33799d012f9e;hp=aaa5551196611732246004b676517ba26ab7f388;hpb=0602df7403182526995419e6384e89d87329605a;p=oota-llvm.git diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html index aaa55511966..5be11624ced 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; @@ -149,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 = ""; @@ -187,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:
@@ -332,8 +333,9 @@ The TableGen types are:To date, these types have been sufficient for describing things that @@ -369,8 +371,11 @@ supported include:
Note that all of the values have rules specifying how they convert to values @@ -625,8 +656,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 +727,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:
@@ -707,12 +740,12 @@ examples: let Defs = [EAX, ECX, EDX, FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, EFLAGS] in { - def CALLpcrel32 : Ii32<0xE8, RawFrm, (outs), (ins i32imm:$dst,variable_ops), - "call\t${dst:call}", []>; - def CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst, variable_ops), - "call\t{*}$dst", [(X86call GR32:$dst)]>; - def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops), - "call\t{*}$dst", []>; + def CALLpcrel32 : Ii32<0xE8, RawFrm, (outs), (ins i32imm:$dst,variable_ops), + "call\t${dst:call}", []>; + def CALL32r : I<0xFF, MRM2r, (outs), (ins GR32:$dst, variable_ops), + "call\t{*}$dst", [(X86call GR32:$dst)]>; + def CALL32m : I<0xFF, MRM2m, (outs), (ins i32mem:$dst, variable_ops), + "call\t{*}$dst", []>; }@@ -723,6 +756,22 @@ opened, as in the case with the CALL* instructions above.
Expressions used by code generator to describe instructions and isel +patterns:
+ +