<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 29, 2007, at 12:48 PM, Sanjiv Gupta wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>thanks Evan,</div> <div>I have just started writing td files.</div> <div> </div> <div>Any ideas how do I describe instructions for an accumulator based machine.</div></blockquote><div><br class="webkit-block-placeholder"></div>That is tricky. It doesn't really fit the LLVM codegen model. One thing you can do is to add pseudo registers to allow "normal" register allocation. Then you can add a post pass to convert everything to stack operation. That's how we handle x87 floating point math. The model is not an exact match to an accumulator based model, but it's an idea.</div><div><br class="webkit-block-placeholder"></div><div>You will probably also need to tweak the instruction scheduler to get better code later.</div><div><br><blockquote type="cite"> <div>The other pecularity is that we do not want to have any software stack.</div> <div>So the instructions like load and store have no meanings.</div></blockquote><div><br class="webkit-block-placeholder"></div>Not sure what you mean by load and store have no meanings?</div><div><br><blockquote type="cite"> <div> </div> <div>In that case,   how do I lower instructions that operate on stack frame?</div></blockquote><div><br class="webkit-block-placeholder"></div>LLVM codegen has a frame index representation. They are created during lowering pass and during register allocation. The prologue and epilogue elimination pass will then translate them using explicit stack pointer, etc.</div><div><br class="webkit-block-placeholder"></div><div>Evan</div><div><br><blockquote type="cite"> <div> </div> <div>TIA,</div> <div>Sanjiv<br> </div> <div><span class="gmail_quote">On 11/26/07, <b class="gmail_sendername">Evan Cheng</b> <<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>> wrote:</span> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On Nov 24, 2007, at 7:28 PM, Sanjiv Gupta wrote:<br><br>> Could anybody guide me what information do I need to know about my <br>> target in order to provide the target lowering info to the llvm DAG<br>> generator? We do not have any fixed registers for argument passing.<br>> Everything including the formal and actual arguments will take part in <br>> a global interprocedural regalloc.<br><br>You don't have to formally specify calling convention. For example,<br>ARM backend does not have a ARMCallingConv.td file, all the argument<br>passing info are implicitly defined in the lowering code. <br><br>To start, you should specify legal register files, legal operations,<br>etc. See XXXISelLowering.cpp for examples.<br><br>Evan<br><br>><br>><br>> Any pointers to learn about this will be a great help.<br> > Sanjiv<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">http://llvm.cs.uiuc.edu </a><br>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br><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">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote> </div><br> _______________________________________________<br>LLVM Developers mailing list<br>LLVMdev@cs.uiuc.edu         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>