Hello all,<div><br></div><div>I am adding a new target into LLVM. However there is a assembler for that target and I just want LLVM to generate assembly. I read the document "Writing an LLVM Backend". I am wondering to know whether I can ignore the Inst field in the following example:</div>
<div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre; font-size: medium;"><font class="Apple-style-span" face="arial"><span class="Apple-style-span" style="white-space: normal; font-size: small;"><br>
</span></font></span></font></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre; ">class InstSP<dag outs, dag ins, string asmstr, list<dag> pattern> : Instruction {</span></div>
<span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre>  field bits<32> Inst;
  let Namespace = "SP";
  bits<2> op;
  let Inst{31-30} = op;       
  dag OutOperandList = outs;
  dag InOperandList = ins;
  let AsmString   = asmstr;
  let Pattern = pattern;
}</pre><pre>And define the instruction class of ported target as:</pre><pre><span class="Apple-style-span" style="font-family: arial; white-space: normal; font-size: small; "><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre; ">class Instxxx<dag outs, dag ins, string asmstr, list<dag> pattern> : Instruction {</span></div>
<span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre>  let Namespace = "xxx";      
  dag OutOperandList = outs;
  dag InOperandList = ins;
  let AsmString   = asmstr;
  let Pattern = pattern;
}</pre></span></span></pre><pre>Second, I have read the documentation of "TableGen Fundamentals" and "The LLVM Target Independent Code Generator". But I don't know how to fill the dag filed of instruction. like <span class="Apple-style-span" style="font-size: small; ">[(store IntRegs:$src, ADDRrr:$addr)] of the following example:</span></pre>
<pre><span class="Apple-style-span" style="font-size: small; ">def STrr  : F3_1< 3, 0b000100, (outs), (ins MEMrr:$addr, IntRegs:$src),</span></pre></span><pre>               "st $src, [$addr]", [(store IntRegs:$src, ADDRrr:$addr)]>;</pre>
<pre><br></pre><pre><span class="Apple-style-span" style="font-size: medium; ">Would anyone mind to tell me where to find the documentation of the dag in</span> <span class="Apple-style-span" style="font-size: medium; ">Independent Code Generator??</span></pre>
<pre><span class="Apple-style-span" style="font-size: medium;"><br></span></pre><pre><span class="Apple-style-span" style="font-size: medium;">thanks a lot</span></pre><pre><span class="Apple-style-span" style="font-size: medium;"><br>
</span></pre><pre><span class="Apple-style-span" style="font-size: medium;">yi-hong</span></pre>