[dmd-internals] x86_64 ABI questions

Bernard Helyer b.helyer at gmail.com
Thu Jun 7 17:06:51 PDT 2012


I can't even figure out the ABI on all platforms for IA32, let alone AMD64.
Good luck to you, sir.

On 8 June 2012 11:42, David Nadlinger <code at klickverbot.at> wrote:

> 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:
>
>  - What is the exact specification for returning static arrays by value?
>
>  - What is the ABI for D vararg functions? (extern(D) void foo(…);)
>
>  - 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.
>
> By the way, http://dlang.org/abi.html seems to be quite outdated, as it
> still mentions static arrays being passed by reference.
>
> Also related to my current LDC pre-release work, name mangling on OS X:
> http://d.puremagic.com/issues/show_bug.cgi?id=8207
>
> Thanks,
> David
> _______________________________________________
> dmd-internals mailing list
> dmd-internals at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-internals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20120608/2681ca84/attachment.html>


More information about the dmd-internals mailing list