Thread overview
[Issue 20204] need to fix ABI about registers using
Sep 10, 2019
KnightMare
Nov 09, 2021
Dlang Bot
Feb 17, 2022
duser@airmail.cc
Dec 17, 2022
Iain Buclaw
September 10, 2019
https://issues.dlang.org/show_bug.cgi?id=20204

--- Comment #1 from KnightMare <black80@bk.ru> ---
I mean need to fix documentation and add some samples that shows which registers will be used for it in Linux, Windows, _x64, ARM...

like Linux/x64 convention uses RDI, RSI, RDX, RCX, R8, R9 for args
left-to-right
but D uses same registers for args right-to-left:
extern (C) func( long a, long b, long c ) => C/Linux: RDI, RSI, RDX
extern (D) func( long a, long b, long c ) => C/Linux: RDX, RSI, RDI

--
November 09, 2021
https://issues.dlang.org/show_bug.cgi?id=20204

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ljmf00 created dlang/dlang.org pull request #3120 "spec: abi: clarify calling convention for other architectures other t…" fixing this issue:

- spec: abi: clarify calling convention for other architectures other than x86

  Observing the assembly generated by the following source file in either DMD
and
  LDC:

  ```d
  extern (C) void ccall( size_t a, size_t b, size_t c );
  extern (D) void dcall( size_t a, size_t b, size_t c );

  //...

  ccall( a, b, c ); // RDI, RSI, RDX
  dcall( a, b, c ); // RDX, RSI, RDI
  ```

  The parameters are passed in the reverse order in functions with `extern(D)`
  linkage. Furthermore, on x86 the calling convention seems to be what is
  described by the current subsections, not only matching Windows x86, but also
  appears to be the same behaviour on System V ABI.

  Fixes #20204 .

  Signed-off-by: Luís Ferreira <contact@lsferreira.net>

https://github.com/dlang/dlang.org/pull/3120

--
February 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20204

duser@airmail.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@gmail.com

--- Comment #3 from duser@airmail.cc ---
*** Issue 20993 has been marked as a duplicate of this issue. ***

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20204

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--