I can't even figure out the ABI on all platforms for IA32, let alone AMD64. Good luck to you, sir.<br><br><div class="gmail_quote">On 8 June 2012 11:42, David Nadlinger <span dir="ltr"><<a href="mailto:code@klickverbot.at" target="_blank">code@klickverbot.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm currently working on a few codegen issues in LDC, where I'm not quite sure if I understood the intended ABI for extern(D) on x86_64 correctly:<br>

<br>
 - What is the exact specification for returning static arrays by value?<br>
<br>
 - What is the ABI for D vararg functions? (extern(D) void foo(…);)<br>
<br>
 - What was the reason of explicitly exposing __va_argsave_t instead of going for compiler magic in vararg functions? The latter is what we do in LDC (LLVM provides va_* intrinsics), and it seems to work fine. We obviously try to be compatible to DMD, but I don't quite see why we should move towards an (at least subjectively) worse design: With the DMD implementation, the API is different from C _and_ requires annoying special casing of code for x86_64. Sure, code that relied on directly manipulating the argument pointer on x86 obviously can't work, but a program just using va_start/va_arg/va_end should compile fine on either platform without changes. With DMD, it doesn't.<br>

<br>
By the way, <a href="http://dlang.org/abi.html" target="_blank">http://dlang.org/abi.html</a> seems to be quite outdated, as it still mentions static arrays being passed by reference.<br>
<br>
Also related to my current LDC pre-release work, name mangling on OS X: <a href="http://d.puremagic.com/issues/show_bug.cgi?id=8207" target="_blank">http://d.puremagic.com/issues/show_bug.cgi?id=8207</a><br>
<br>
Thanks,<br>
David<br>
_______________________________________________<br>
dmd-internals mailing list<br>
<a href="mailto:dmd-internals@puremagic.com" target="_blank">dmd-internals@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a></blockquote></div><br>