Skip to content

Commit 8da6ee3

Browse files
committed
Add more ABI correspondence with other compilers
1 parent 9a2426c commit 8da6ee3

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
@@ -131,13 +131,15 @@ There are also some platform-specific ABI strings:
131131
r[items.extern.abi.cdecl]
132132
* `unsafe extern "cdecl"` --- The calling convention typically used with x86_32 C code.
133133
* Only available on x86_32 targets.
134+
* Corresponds to MSVC's `__cdecl` and GCC and clang's `__attribute__((cdecl))`.
134135

135136
> [!NOTE]
136137
> See <https://learn.microsoft.com/en-us/cpp/cpp/cdecl> and <https://en.wikipedia.org/wiki/X86_calling_conventions#cdecl> for more information.
137138
138139
r[items.extern.abi.stdcall]
139140
* `unsafe extern "stdcall"` --- The calling convention typically used by the [Win32 API] on x86_32.
140141
* Only available on x86_32 targets.
142+
* Corresponds to MSVC's `__stdcall` and GCC and clang's `__attribute__((stdcall))`.
141143

142144
> [!NOTE]
143145
> See <https://learn.microsoft.com/en-us/cpp/cpp/stdcall> and <https://en.wikipedia.org/wiki/X86_calling_conventions#stdcall> for more information.
@@ -146,6 +148,7 @@ r[items.extern.abi.win64]
146148
* `unsafe extern "win64"` --- The Windows x64 ABI.
147149
* Only available on x86_64 targets.
148150
* "win64" is the same as the "C" ABI on Windows x86_64 targets.
151+
* Corresponds to GCC and clang's `__attribute__((ms_abi))`.
149152

150153
> [!NOTE]
151154
> 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.
@@ -154,6 +157,7 @@ r[items.extern.abi.sysv64]
154157
* `unsafe extern "sysv64"` --- The System V ABI.
155158
* Only available on x86_64 targets.
156159
* "sysv64" is the same as the "C" ABI on non-Windows x86_64 targets.
160+
* Corresponds to GCC and clang's `__attribute__((sysv_abi))`.
157161

158162
> [!NOTE]
159163
> See <https://wiki.osdev.org/System_V_ABI> or <https://en.wikipedia.org/wiki/X86_calling_conventions#System_V_AMD64_ABI> for more information.
@@ -162,20 +166,23 @@ r[items.extern.abi.aapcs]
162166
* `unsafe extern "aapcs"` --- The soft-float ABI for ARM.
163167
* Only available on ARM32 targets.
164168
* "aapcs" is the same as the "C" ABI on soft-float ARM32.
169+
* Corresponds to clang's `__attribute__((pcs("aapcs")))`.
165170

166171
> [!NOTE]
167172
> 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.
168173
169174
r[items.extern.abi.fastcall]
170-
* `unsafe extern "fastcall"` --- The `fastcall` ABI --- corresponds to MSVC's `__fastcall` and GCC and clang's `__attribute__((fastcall))`.
175+
* `unsafe extern "fastcall"` --- A "fast" variant of stdcall that passes some arguments in registers.
171176
* Only available on x86_32 targets.
177+
* Corresponds to MSVC's `__fastcall` and GCC and clang's `__attribute__((fastcall))`.
172178

173179
> [!NOTE]
174180
> See <https://learn.microsoft.com/en-us/cpp/cpp/fastcall> and <https://en.wikipedia.org/wiki/X86_calling_conventions#Microsoft_fastcall> for more information.
175181
176182
r[items.extern.abi.thiscall]
177-
* `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))`.
183+
* `unsafe extern "thiscall"` --- The calling convention typically used on C++ class member functions on x86_32 MSVC.
178184
* Only available on x86_32 targets.
185+
* Corresponds to MSVC's `__thiscall` and GCC and clang's `__attribute__((thiscall))`.
179186

180187
> [!NOTE]
181188
> 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)