Skip to content

Commit 1a38446

Browse files
committed
Clarify inline assembly vs separate assembly file usage
- Made it clear that separate assembly files (.S/.asm) are preferred - Documented which platforms support inline assembly (x86/x64/ARM with GCC only) - Explained that Clang, RISC-V, macOS, and Windows always use separate files - Reorganized to recommend assembly files first, inline as legacy option
1 parent df82420 commit 1a38446

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,24 @@ There are two basic ways to add the library to your project: Using a static libr
167167
168168
### inlined code
169169
170-
- Include `stackman_impl.h` in one of your .c source files to provide inline assembly.
171-
- Include `stackman_impl.h` in an assembly (.S) file in your project to include assembly code.
172-
- (Windows) Include `stackman_s.asm` in an assembly (.asm) file in your project.
170+
**Note:** Most platforms now use separate assembly files (`.S` or `.asm`) rather than inline assembly.
171+
Inline assembly is only available for some platforms when using GCC (not Clang), and using separate
172+
assembly files is generally preferred for reliability and compatibility.
173+
174+
**To include the implementation directly in your project:**
175+
176+
- **Recommended:** Include `stackman_impl.h` in an assembly (`.S`) file in your project. This works for all Unix-like platforms (Linux, macOS, BSD).
177+
- **Windows:** Include `stackman_s.asm` in an assembly (`.asm`) file in your project.
178+
- **Legacy (GCC only, limited platforms):** Include `stackman_impl.h` in a `.c` source file to use inline assembly where available (x86, x86_64, ARM32, ARM64 with GCC).
179+
180+
**Platforms with inline assembly support:**
181+
- x86 (sysv_i386)
182+
- x86_64 (sysv_amd64)
183+
- ARM32 (arm32)
184+
- ARM64 (aarch64)
185+
186+
Only when compiled with GCC and `STACKMAN_INLINE_ASM` is not disabled. Clang, RISC-V, macOS, and Windows
187+
always use separate assembly files.
173188
174189
In the case of inlined code, it can be specified to prefer in-line assembly and static linkage
175190
over separate assembly language source.

0 commit comments

Comments
 (0)