<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">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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">Carlos<br></font></span></div>
<br>_______________________________________________<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></blockquote></div><br></div>