I'm a bit confused as to how some of the values in a Sparc store instruction actually come to be set. The Sparc backend defines a store as:<div><br></div><div><div>def STri : F3_2<3, 0b000100,</div><div> (outs), (ins MEMri:$addr, IntRegs:$src),</div>
<div> "st $src, [$addr]",</div><div> [(store IntRegs:$src, ADDRri:$addr)]>;</div></div><div><br></div><div>F3_2 and it's superclasses are defined as follows:</div><div><br>
</div><div><div><div>class F3_2<bits<2> opVal, bits<6> op3val, dag outs, dag ins,</div><div> string asmstr, list<dag> pattern> : F3<outs, ins, asmstr, pattern> {</div><div> bits<13> simm13;</div>
<div><br></div><div> let op = opVal;</div><div> let op3 = op3val;</div><div><br></div><div> let Inst{13} = 1; // i field = 1</div><div> let Inst{12-0} = simm13;</div><div>}</div></div></div><div>
<br>
</div><div><div>class F3<dag outs, dag ins, string asmstr, list<dag> pattern></div><div> : InstSP<outs, ins, asmstr, pattern> {</div><div> bits<5> rd; </div><div> bits<6> op3;</div><div>
bits<5> rs1;</div><div> let op{1} = 1; // Op = 2 or 3</div><div> let Inst{29-25} = rd; </div><div> let Inst{24-19} = op3;</div><div> let Inst{18-14} = rs1;</div><div>}</div></div><div><br></div><div><div>class InstSP<dag outs, dag ins, string asmstr, list<dag> pattern> : Instruction {</div>
<div> field bits<32> Inst;</div><div><br></div><div> let Namespace = "SP";</div><div><br></div><div> bits<2> op;</div><div> let Inst{31-30} = op;</div><div><br></div><div> dag OutOperandList = outs;</div>
<div> dag InOperandList = ins;</div><div> let AsmString = asmstr;</div><div> let Pattern = pattern;</div><div>}</div></div><div><br></div><div>I cannot see how the values simm13, rd, and rs1 are actually set. While in some places in the .td file there are instructions prefixed with "let rd = ...", the store instructions are not. How do the register numbers/immediates get from $src and $addr to the relevant places in Inst? </div>
<div><br></div><div>Stephen</div>