<b>bit</b> mayLoad = 0;
<b>bit</b> mayStore = 0;
<b>bit</b> isImplicitDef = 0;
- <b>bit</b> isTwoAddress = 1;
<b>bit</b> isConvertibleToThreeAddress = 1;
<b>bit</b> isCommutable = 1;
<b>bit</b> isTerminator = 0;
the symbol table. If the type of 'a' does not match <em>type</em>, TableGen
aborts with an error. !cast<string> is a special case in that the argument must
be an object defined by a 'def' construct.</dd>
-<dt><tt>!nameconcat<type>(a, b)</tt></dt>
- <dd>Shorthand for !cast<type>(!strconcat(a, b))</dd>
<dt><tt>!subst(a, b, c)</tt></dt>
<dd>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.</dd>
<dd>'b' if the result of 'int' or 'bit' operator 'a' is nonzero,
'c' otherwise.</dd>
<dt><tt>!eq(a,b)</tt></dt>
- <dd>Integer one if string a is equal to string b, zero otherwise. This
- only operates on string, int and bit objects. Use !cast<string> to
+ <dd>'bit 1' if string a is equal to string b, 0 otherwise. This
+ only operates on string, int and bit objects. Use !cast<string> to
compare other types of objects.</dd>
</dl>
</pre>
</div>
+<p>
+defm declarations can inherit from classes too, the
+rule to follow is that the class list must start after the
+last multiclass, and there must be at least one multiclass
+before them.
+</p>
+
+<div class="doc_code">
+<pre>
+<b>class</b> XD { bits<4> Prefix = 11; }
+<b>class</b> XS { bits<4> Prefix = 12; }
+
+<b>class</b> I<bits<4> op> {
+ bits<4> opcode = op;
+}
+
+<b>multiclass</b> R {
+ <b>def</b> rr : I<4>;
+ <b>def</b> rm : I<2>;
+}
+
+<b>multiclass</b> Y {
+ <b>defm</b> SS : R, XD;
+ <b>defm</b> SD : R, XS;
+}
+
+<b>defm</b> Instr : Y;
+
+<i>// Results</i>
+<b>def</b> InstrSDrm {
+ bits<4> opcode = { 0, 0, 1, 0 };
+ bits<4> Prefix = { 1, 1, 0, 0 };
+}
+...
+<b>def</b> InstrSSrr {
+ bits<4> opcode = { 0, 1, 0, 0 };
+ bits<4> Prefix = { 1, 0, 1, 1 };
+}
+</pre>
+</div>
+
</div>
<!-- ======================================================================= -->
apply, and one or more records to bind the values in. Here are some
examples:</p>
-<div class="doc_code">
-<pre>
+<pre class="doc_code">
<b>let</b> isTerminator = 1, isReturn = 1, isBarrier = 1, hasCtrlDep = 1 <b>in</b>
<b>def</b> RET : I<0xC3, RawFrm, (outs), (ins), "ret", [(X86retflag 0)]>;
"call\t{*}$dst", []>;
}
</pre>
-</div>
<p>File-scope "let" expressions are often useful when a couple of definitions
need to be added to several records, and the records do not otherwise need to be
several levels of multiclass instanciations. This also avoids the need of using
"let" expressions within subsequent records inside a multiclass.</p>
-<div class="doc_code">
-<pre>
+<pre class="doc_code">
<b>multiclass </b>basic_r<bits<4> opc> {
<b>let </b>Predicates = [HasSSE2] in {
<b>def </b>rr : Instruction<opc, "rr">;
<div class="doc_section"><a name="codegen">Code Generator backend info</a></div>
<!-- *********************************************************************** -->
+<div class="doc_text">
+
<p>Expressions used by code generator to describe instructions and isel
patterns:</p>
-<div class="doc_text">
-
+<dl>
<dt><tt>(implicit a)</tt></dt>
<dd>an implicitly defined physical register. This tells the dag instruction
selection emitter the input pattern's extra definitions matches implicit
physical register definitions.</dd>
-
+</dl>
</div>
<!-- *********************************************************************** -->