init: raw cpuid/rdtsc access via ctypes

This commit is contained in:
ImSavsis 2026-07-19 23:29:46 +05:00
commit fa82965ab5
15 changed files with 437 additions and 0 deletions

18
llms.txt Normal file
View file

@ -0,0 +1,18 @@
# rawcpu
> Raw CPUID and RDTSC access for Python via a tiny native DLL wrapped with ctypes. Exposes CPU feature detection (SSE/AVX/AES/etc.) and cycle-accurate timing that plain Python cannot do natively.
Windows x64 only for now. No Python C API used — a small MSVC-compiled DLL exports two functions (raw_cpuid, raw_rdtsc) loaded via ctypes.WinDLL, so it works across Python 3.10-3.13 without per-version ABI builds.
## Docs
- [README](https://github.com/ImSavsis/rawcpu/blob/master/README.md): install, usage, feature list
- [docs/quickstart.md](https://github.com/ImSavsis/rawcpu/blob/master/docs/quickstart.md)
- [docs/api.md](https://github.com/ImSavsis/rawcpu/blob/master/docs/api.md)
- [native/rawcpu.cpp](https://github.com/ImSavsis/rawcpu/blob/master/native/rawcpu.cpp): the native DLL source
- [src/rawcpu/__init__.py](https://github.com/ImSavsis/rawcpu/blob/master/src/rawcpu/__init__.py): high-level API and CPU feature bit table
## Notes
- No MSR/register-write access — that requires ring 0, not reachable from usermode without a kernel driver
- Linux/macOS not supported yet