On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote:
On Saturday, 6 March 2021 at 11:57:13 UTC, Imperatorn wrote:
What... Is this really how it's supposed to be? Makes no sense
to not use any of the existing conventions.
extern(C) and extern(D) are both documented to be the same as
the platform's C calling convention everywhere except x86
windows:
https://dlang.org/spec/abi.html#function_calling_conventions
There have been times when differences were noted (I recall a
particularly bad one related to passing structs by value on
64-bit linux) and there may be more. When they are, they should
be reported in Bugzilla.
Where exactly is documented the extern(D) x86-64 calling
convention? Because currently seems like a mess according to the
dissasembly. First X parameters on stack from left to right, last
4 in registers. But wait, if you have less than 4 parameters,
they are passed in register. Again, WTF?