www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to implement fastcall ?

reply =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
How to implement fastcall ?
( stdcall is calling convention for pass function arguments via 
registers )
Sep 21 2020
next sibling parent =?UTF-8?B?0JLQuNGC0LDQu9C40Lkg0KTQsNC0?= =?UTF-8?B?0LXQtdCy?= writes:
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев 
wrote:
 How to implement fastcall ?
 ( stdcall is calling convention for pass function arguments via 
 registers )
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев wrote: fix... ( fastcall is calling convention for pass function arguments via registers )
Sep 21 2020
prev sibling next sibling parent Mike Parker <aldacron gmail.com> writes:
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев 
wrote:
 How to implement fastcall ?
 ( stdcall is calling convention for pass function arguments via 
 registers )
The supported linkage attributes are here: https://dlang.org/spec/attribute.html#linkage `extern(Windows)` is stdcall, `extern(C)` is cdecl. Unless it's a hidden feature that I'm unaware of, fastcall is not supported.
Sep 21 2020
prev sibling parent reply Denis Feklushkin <feklushkin.denis gmail.com> writes:
On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев 
wrote:
 How to implement fastcall ?
 ( stdcall is calling convention for pass function arguments via 
 registers )
Hypothesis: it is possible what LLVM + Link Time Optimization does by this way.
Sep 23 2020
parent kinke <noone nowhere.com> writes:
On Wednesday, 23 September 2020 at 19:50:13 UTC, Denis Feklushkin 
wrote:
 On Monday, 21 September 2020 at 11:14:06 UTC, Виталий Фадеев 
 wrote:
 How to implement fastcall ?
 ( stdcall is calling convention for pass function arguments 
 via registers )
Hypothesis: it is possible what LLVM + Link Time Optimization does by this way.
~All modern ABIs use registers; __fastcall was one of the special 32-bit x86 ABIs AFAIK (using up to 2 GP registers) and isn't supported directly. The D ABI for 32-bit x86 uses one GP register (and is somewhat similar to __thiscall for member functions).
Sep 23 2020