ScarletNX / ScarletNX documentation / The recompiler as a library · ← previous
Limits
- The host is x86-64 (the memory ordering of the generated code relies on it,
cpu.h).
- PAuth support uses disabled instruction/data authentication controls. Signing and authentication preserve
pointers, and XPAC strips them for 39-bit virtual addresses without top-byte ignore. No PAC keys or
authentication protection are implemented, including with the MAX target.
- Guest memory is flat (
cpu->mem + address), with no page tables: the caller lays out
the guest address space and keeps the code in it.
- One thread uses a given
snx_recompiler or snx_recompiled object at a time (binding
and running CPUs on a module from several threads is fine).
- A64 and A32 modules are separate things: never run an A32 block on a
CPU, or hand an
SnxArmCPU to A64 code.
- The dispatch table holds a pointer per instruction slot of the code range, so ranges
spanning more than 1 GiB of guest addresses are refused.
- Out of memory ends the process, as it does everywhere in this recompiler (
snx_alloc).
Every other failure comes back as NULL or -1 with snx_recompiler_error set.
The test tests/recompiler_library.c is a complete example: hand-assembled A64 and A32
programs recompiled on each backend, with SVC, BRK and undefined-instruction hooks,
hints, and code compiled at its miss.
← previous