<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I could live with that. You’re right that “newstack" is probably more use-case-dependant. A “preserve_none” calling convention would be more general than swapstack, which is perhaps more preferred for LLVM. I don’t think that would be a big deal for swapstack-seekers, because I think the stack pointer swapping could be achieved using @llvm.read_register() and @llvm.write_register().</div><div class=""><br class=""></div><div class="">I’m glad to know other people are in support of this functionality.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 27, 2020, at 2:20 PM, Jon Chesterfield via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I propose that the LLVM devs consider adding “swapstack” and “newstack” into the LLVM project officially.<br class=""></blockquote><div class=""><br class=""></div><div class="">Thanks for the reference. I was going to suggest the 'preserve_none' calling convention, applied to asm which does the stack pointer swapping, would be equivalent to swapstack. However that calling convention doesn't appear to exist - it would be one where the caller is required to save all live values to the stack before jumping.<br class=""><br class=""></div><div class="">'preserve_none' may be a useful calling convention independent of green threads. Functions which will always use all the available registers benefit from not having to save/restore any of them, if the caller knew to preserve any live values. A green thread context switch is roughly a call that preserved nothing.<br class=""><br class=""></div><div class="">Newstack I'm not as sure about. Green thread libraries are likely to put a lot of effort into how stacks are sized, allocated, reused. That seems better as a runtime call.<br class=""></div><div class=""><br class=""></div><div class="">Thanks<br class=""><br class=""></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>