Hi,<div><br></div><div> I noticed one class in MipsInstrFormats.td:L46 -> Class MipsPseudo. I wonder whether I can use this. If does, I wonder what would be the right way to use. Thanks,</div><div><br></div><div><br>
<br><div class="gmail_quote">On Thu, Oct 6, 2011 at 11:29 AM, Akira Hatanaka <span dir="ltr"><<a href="mailto:ahatanak@gmail.com">ahatanak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Do you want to replace<br>
<br>
lui $2, %hi(g1)<br>
addiu $2, $2, %lo(g1)<br>
<br>
with this?<br>
la $2, g1<br>
<br>
If that is the case, you can add this pattern.<br>
<br>
def op_la : Operand<i32>;<br>
<br>
def LA :<br>
FI<0x09, (outs CPURegs:$dst), (ins op_la:$addr0, op_la:$addr1),<br>
"la $dst, $addr0", [(set CPURegs:$dst,<br>
(add (MipsHi tglobaladdr:$addr0), (MipsLo<br>
tglobaladdr:$addr1)))], IIAlu>;<br>
<br>
Note that you still need to find a way to print "g1" instead of "%hi(g1)".<br>
<div><div></div><div class="h5"><br>
On Wed, Oct 5, 2011 at 4:01 PM, Gang-Ryung Uh <<a href="mailto:guh@boisestate.edu">guh@boisestate.edu</a>> wrote:<br>
> Hi,<br>
> In order to emit "la $4,ADDR" instead of lui followed by addiu to load<br>
> the data address, could you advise what is proper way to revise td files in<br>
> the MIPS target?<br>
> Thanks,<br>
><br>
> --<br>
> Gang-Ryung Uh, Associate Professor<br>
> Department of Computer Science<br>
> College of Engineering, Boise State Univerisity<br>
> tel: <a href="tel:1%20208%20426-5691" value="+12084265691">1 208 426-5691</a> <a href="mailto:e-mail%3Aguh@boisestate.edu">e-mail:guh@boisestate.edu</a><br>
> <a href="http://cs.boisestate.edu/~uh" target="_blank">http://cs.boisestate.edu/~uh</a><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Gang-Ryung Uh, Associate Professor<br>Department of Computer Science<br>College of Engineering, Boise State Univerisity<br>tel: 1 208 426-5691 <a href="mailto:e-mail%3Aguh@boisestate.edu">e-mail:guh@boisestate.edu</a><br>
<a href="http://cs.boisestate.edu/~uh">http://cs.boisestate.edu/~uh</a><br><br><br>
</div>