Skip to content

Commit d0fce21

Browse files
committed
Add more ABI correspondence with other compilers
1 parent d77c6b8 commit d0fce21

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/items/external-blocks.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ There are also some platform-specific ABI strings:
138138
r[items.extern.abi.cdecl]
139139
* `unsafe extern "cdecl"` --- The calling convention typically used with x86_32 C code.
140140
* Only available on x86_32 targets.
141+
* Corresponds to MSVC's `__cdecl` and GCC and clang's `__attribute__((cdecl))`.
141142
142143
> [!NOTE]
143144
> See <https://learn.microsoft.com/en-us/cpp/cpp/cdecl> and <https://en.wikipedia.org/wiki/X86_calling_conventions#cdecl> for more information.
144145
145146
r[items.extern.abi.stdcall]
146147
* `unsafe extern "stdcall"` --- The calling convention typically used by the [Win32 API] on x86_32.
147148
* Only available on x86_32 targets.
149+
* Corresponds to MSVC's `__stdcall` and GCC and clang's `__attribute__((stdcall))`.
148150
149151
> [!NOTE]
150152
> See <https://learn.microsoft.com/en-us/cpp/cpp/stdcall> and <https://en.wikipedia.org/wiki/X86_calling_conventions#stdcall> for more information.
@@ -153,6 +155,7 @@ r[items.extern.abi.win64]
153155
* `unsafe extern "win64"` --- The Windows x64 ABI.
154156
* Only available on x86_64 targets.
155157
* "win64" is the same as the "C" ABI on Windows x86_64 targets.
158+
* Corresponds to GCC and clang's `__attribute__((ms_abi))`.
156159
157160
> [!NOTE]
158161
> See <https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions> and <https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_x64_calling_convention> for more information.
@@ -161,6 +164,7 @@ r[items.extern.abi.sysv64]
161164
* `unsafe extern "sysv64"` --- The System V ABI.
162165
* Only available on x86_64 targets.
163166
* "sysv64" is the same as the "C" ABI on non-Windows x86_64 targets.
167+
* Corresponds to GCC and clang's `__attribute__((sysv_abi))`.
164168
165169
> [!NOTE]
166170
> See <https://wiki.osdev.org/System_V_ABI> or <https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI> for more information.
@@ -169,20 +173,23 @@ r[items.extern.abi.aapcs]
169173
* `unsafe extern "aapcs"` --- The soft-float ABI for ARM.
170174
* Only available on ARM32 targets.
171175
* "aapcs" is the same as the "C" ABI on soft-float ARM32.
176+
* Corresponds to clang's `__attribute__((pcs("aapcs")))`.
172177
173178
> [!NOTE]
174179
> See [Arm Procedure Call Standard](https://developer.arm.com/documentation/107656/0101/Getting-started-with-Armv8-M-based-systems/Procedure-Call-Standard-for-Arm-Architecture--AAPCS-) for more information.
175180
176181
r[items.extern.abi.fastcall]
177-
* `unsafe extern "fastcall"` --- The `fastcall` ABI --- corresponds to MSVC's `__fastcall` and GCC and clang's `__attribute__((fastcall))`.
182+
* `unsafe extern "fastcall"` --- A "fast" variant of stdcall that passes some arguments in registers.
178183
* Only available on x86_32 targets.
184+
* Corresponds to MSVC's `__fastcall` and GCC and clang's `__attribute__((fastcall))`.
179185
180186
> [!NOTE]
181187
> See <https://learn.microsoft.com/en-us/cpp/cpp/fastcall> and <https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_fastcall> for more information.
182188
183189
r[items.extern.abi.thiscall]
184-
* `unsafe extern "thiscall"` --- The calling convention typically used on C++ class member functions on x86_32 MSVC --- corresponds to MSVC's `__thiscall` and GCC and clang's `__attribute__((thiscall))`.
190+
* `unsafe extern "thiscall"` --- The calling convention typically used on C++ class member functions on x86_32 MSVC.
185191
* Only available on x86_32 targets.
192+
* Corresponds to MSVC's `__thiscall` and GCC and clang's `__attribute__((thiscall))`.
186193
187194
> [!NOTE]
188195
> See <https://en.wikipedia.org/wiki/X86_calling_conventions#thiscall> and <https://learn.microsoft.com/en-us/cpp/cpp/thiscall> for more information.

0 commit comments

Comments
 (0)