(Note, using Windows x86_64)
I've been looking in the list of abi's for cranelift, which for stable abi's supports fastcall and systemv (as far as I understand).
I'm looking to make my JIT function callable from a cdecl abi. Is there a way to do this, or is there something obvious I'm missing? I have been looking online and see some people say cdecl == fastcall == stdcall, but I look at the abi docs and they seem to be slightly different, e.g. caller or callee cleans up stack, which I would think should be pretty crucial things. So I'm not sure if I can rely on the advice that "cdecl == fastcall".
What am I missing here?
Edit: Just to be clear, I'm talking about CallConv
It is correct that cdecl == stdcall == fastcall on Windows x86-64. There is basically only one calling convention there (if you ignore vectorcall anyway).
If you look at the MSVC documentation, it explicitly states that these CC modifiers are ignored on x64. (IIRC the only exception is that cdecl can be used as an override if you've told the compiler to default to vectorcall.)
Alex Rønne Petersen said:
It is correct that cdecl == stdcall == fastcall on Windows x86-64. There is basically only one calling convention there (if you ignore vectorcall anyway).
Thank you for clarifying this point!
This topic was moved here from #general > Cranelift cdecl abi by fitzgen (he/him).
Cherry has marked this topic as resolved.
Last updated: Dec 23 2024 at 12:05 UTC