<div dir="ltr"><div><div>Hi Johnny,<br><br></div><div>Thank you for your help. <span id="result_box" class="" lang="en"><span class="">I guess the</span> pseudo <span class="">instruction does not</span> <span class="">interfere</span> <span class="">in the generated</span> <span class="">assembly code</span><span class="">.</span></span><br></div><div><div id="gt-src-tools"><div id="gt-src-tools-l"><div style="display:inline-block" id="gt-input-tool"><div style id="itamenu"><span class=""></span></div></div></div></div> <div id="gt-res-content" class=""><div dir="ltr" style="zoom:1"><span id="result_box" class="" lang="en"><span class="">I'll check</span> <span class="">the file that</span> <span class="">describes</span> <span class="">the registers</span> <span class="">and I hope</span> <span class="">understand why the</span> <span class="">assembly code</span> <span class="">is printed</span> <span class="">wrong</span></span> (<span id="result_box" class="" lang="en"><span class="">now</span> <span class="">is printed</span> <span class="">things like</span></span> add r1, r0, -40).<br></div></div></div><br></div>Cheers,<br>Carlos<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Carlos Almeida Jr<br></div></div>
<br><div class="gmail_quote">On Thu, Nov 27, 2014 at 7:56 AM, Johnny Val <span dir="ltr"><<a href="mailto:johnnydval@gmail.com" target="_blank">johnnydval@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Carlos,<br><br></div>LLVM will do this automatically for you! There is no need for a pseudo instruction in this case. As long as you have a way of adding two i32s (or any other type) using registers then LLVM will automatically do what you described when immediates are involved.<br><br></div>Cheers,<br><br>Johnny<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Nov 26, 2014 at 11:50 PM, Carlos Almeida Jr. <span dir="ltr"><<a href="mailto:almeidajr@gmail.com" target="_blank">almeidajr@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi,<br><br>I'm a beginner user using LLVM, and I'm trying to create a new backend using CPU0 Tutorial as reference.<br>I have two instructions for add: add and addi (this is a pseudo instruction, but imediate operations is not available in architecture).<br>That is my idea: When the LLVM instruction selection find addi r3 = r2 + value<br><br>must convert to this:<br><br>- load r1, value<br>- add r3 = r2 + r1<br><br>In archInstrInfo.td I declared the instructions of the architecture, but I dont know how to "split" addi instruction. I tryed understand the LLVM and CPU0 documentation for solve this but I not found anything. :(<br><br>Could anyone help me?<br><br>Thanks<span><font color="#888888"><br></font></span></div><span><font color="#888888">Carlos<br></font></span></div>
<br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">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></blockquote></div><br></div>
</blockquote></div><br></div>