<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 22, 2016, at 12:06 PM, Bryan Chan <<a href="mailto:bryan.chan@ca.ibm.com" class="">bryan.chan@ca.ibm.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><p class=""><tt class=""><a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a> wrote on 2016-03-22 02:37:47 PM:<br class=""><br class="">> The runtime functions are hacked in various unsavory ways to give <br class="">> them Swift-like calling conventions. Many of them also have <br class="">> important semantics that the compiler needs to be aware of, so if <br class="">> they aren't exported as standard library API in some way, you really<br class="">> shouldn't interact with them directly. <br class="">> (swift_class_getInstanceExtents happens to be OK, but what are you <br class="">> trying to do with it?)</tt><br class=""><br class=""><tt class="">I am trying to build Swift on a different architecture (s390x). This</tt><br class=""><tt class="">function was causing crashes due to the ABI mismatch, and I also</tt><br class=""><tt class="">found that the issue is not 100% fixed on x86 either, so I wondered</tt><br class=""><tt class="">if the community has an opinion on the right way to deal with this</tt><br class=""><tt class="">in the runtime, or if the answer is simply "don't do this for</tt><br class=""><tt class="">3-scalar returns".</tt><br class=""></p></div></div></blockquote></div><div class="">Yeah, there's no good way right now to return three scalars from Clang. swift_class_getInstanceExtents and a few other runtime entrypoints like allocBox and allocError use the `TwoWordPair::Return` hack to use types that happen to return in two registers on i386, x86_64, armv7, and arm64. If s390x's C ABI doesn't define any such types, you might need to wait for proper support for Swift calling conventions in Clang. I believe it's on John McCall's near-term todo list to do that.</div><div class=""><br class=""></div><div class="">-Joe</div></body></html>