diff options
| author | 2025-11-24 03:19:49 +0000 | |
|---|---|---|
| committer | 2025-11-24 03:23:22 +0000 | |
| commit | 508878ff0a9e4cd8528727c41819bc2d70b33dd0 (patch) | |
| tree | 5068ea278c0fcbe0ecae5dfe0efa1057a857adfa /src/chunklets/README-x86 | |
| parent | 13ddf47d80893eb4d09ca31f5469b835f24170c7 (diff) | |
| download | sst-508878ff0a9e4cd8528727c41819bc2d70b33dd0.tar.gz sst-508878ff0a9e4cd8528727c41819bc2d70b33dd0.zip | |
Turn x86 stuff into a chunklet to help out SPT
Quick unused header cleanup pass while we're at it.
Diffstat (limited to 'src/chunklets/README-x86')
| -rw-r--r-- | src/chunklets/README-x86 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/chunklets/README-x86 b/src/chunklets/README-x86 new file mode 100644 index 0000000..cbfcb5d --- /dev/null +++ b/src/chunklets/README-x86 @@ -0,0 +1,56 @@ +x86.{c,h}: opcode-based x86 instruction analysis (NOT a disassembler) + +Currently only handles opcodes found in basic 32-bit userspace functions; +there’s no kernel-mode instructions, no SSE 3+, no AVX, no REX (64-bit), no +EVEX, yadda yadda. + +Subject to extension later if there’s ever a use for it. + +== Compiling == + + gcc -c -O2 [-flto] x86.c + clang -c -O2 [-flto] x86.c + tcc -c x86.c + cl.exe /c /O2 x86.c + +In most cases you can just drop the .c file straight into your codebase/build +system. LTO is advised to avoid dead code and enable more efficient calls +including potential inlining. + +== Compiler compatibility == + +- Any reasonable GCC +- Any reasonable Clang +- Any reasonable MSVC +- TinyCC +- Probably almost all others; this is very portable code + +Note that GCC and Clang will generally give the best-performing output. + +Once the .c file is built, the public header can be consumed by virtually any C +or C++ compiler, as well as probably most half-decent FFIs. + +Note that the .c source file is probably C++-compatible at the moment, but this +is not guaranteed, so it's best to compile it as a C source. The header will +work fine from either language. + +== API usage == + +See documentation comments in x86.h for a basic idea. Some *pro tips*: + +== OS compatibility == + +- All. +- Seriously, this library doesn’t even use libc. + +== Architecture compatibility == + +- All, so long as char is 8 bits. + +== Copyright == + +The source file and header both fall under the ISC licence — read the notices in +both of the files for specifics. + +Thanks, and have fun! +- Michael Smith <mikesmiffy128@gmail.com> |
