<div dir="ltr">Having your function prologue call malloc() and epilogue call free() (or similar functions) instead of bumping a stack pointer is not a problem. That stuff is generated explicitly by ISA-specific code anyway.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 14, 2018 at 9:05 AM JD Jones <<a href="mailto:jjones@prc-hsv.com">jjones@prc-hsv.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-3141170930077545297WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks for your response. Please see below.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Bruce Hoult [mailto:<a href="mailto:brucehoult@sifive.com" target="_blank">brucehoult@sifive.com</a>] <br><b>Sent:</b> Thursday, December 13, 2018 5:58 PM<br><b>To:</b> <a href="mailto:jjones@prc-hsv.com" target="_blank">jjones@prc-hsv.com</a><br><b>Cc:</b> LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Subject:</b> Re: [llvm-dev] LLVM Backend for a platform with no (normal) stack<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Do you have a register that you can store a memory address<span style="color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">>> yes<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"> in and an addressing mode that allows you to add (or subtract) a constant to that register<span style="color:rgb(31,73,125)"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">>> Sometimes<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"> and use the address calculated to load//store from memory? Do you have enough registers that you can keep one of them permanently pointed to a particular memory region?<u></u><u></u></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">>> No<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The platform intentionally does not allow use of some large chunk of memory for shared use by function calls. I can allocate memory (so long as I know the necessary size before-hand). I can work around this issue, but if someone has already addressed it, I’d like to learn from their experiences before rolling my own.<u></u><u></u></span></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">If yes, then you have a stack to exactly the same extent as RISC-V or MIPS do.<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Thu, Dec 13, 2018 at 12:53 PM JD Jones via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<u></u><u></u></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Dear Sir or Ma’am;<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I have found a wealth of help and information on writing an LLVM backend. And, my platform has no stack.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Can you point me to any information that would specifically address creating a backend for this kind of platform?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">In previous wanderings, I thought I ran across a phrase “platforms with no stack such as FPGAs”, but I can’t find that mention, now.<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">More thanks than I can type,<u></u><u></u></p><p class="MsoNormal">JD Jones<u></u><u></u></p><p class="MsoNormal">Software Engineer<u></u><u></u></p></div></div><p class="MsoNormal"><br><span style="font-size:10pt;font-family:Arial,sans-serif">This message is intended for the addressee only and may contain Paragon Research Corporation (PRC) confidential or privileged information. Use or distribution of such confidential information is strictly prohibited without the prior written permission of PRC. If you have received this message in error, please contact the sender immediately and delete the message and attachments from your computer.</span>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><u></u><u></u></p></blockquote></div></div></div>
<br>
<font face="Arial, Helvetica, sans-serif"><span style="font-size:13px">This message is intended for the addressee only and may contain Paragon Research Corporation (PRC) confidential or privileged information. Use or distribution of such confidential information is strictly prohibited without the prior written permission of PRC. If you have received this message in error, please contact the sender immediately and delete the message and attachments from your computer.</span></font></blockquote></div>