Repository navigation
RFC #0001 #1
MotherOfProgrammers
started this conversation in
RFC & Specs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
[RFC-0001] M4 Native Codegen Lowering Strategy & System V AMD64 Stack Contract
1. Summary
This RFC formalizes the execution contract and lowering strategy for converting verified
ir::Modulebasic blocks into bare-metal x86-64 machine instructions.With M1–M3 complete (PEP 526 parser, 11/11 untyped regression tests, and 12/12 typed range-verified regression tests passing), M4 establishes how$0\text{ malloc}$ basic blocks directly into executable memory (
lithonclowers staticmmap/PROT_EXEC) or ELF static binaries.2. Core Architectural Invariants
Every backend lowering pass in Lithon/Boa must enforce the following four hardware guarantees:
typecheck.cpp.rbp.rdi,rsi,rdx,rcx,r8,r9.rax,r10,r11.rbx,rsp,rbp,r12,r13,r14,r15.rax.sub rsp, N) must be rounded up to 16-byte boundaries to maintain ABI alignment requirements for nested function calls.3. Stack Frame Layout Specification
For a basic function block, stack frame allocation is laid out strictly at negative offsets from
rbp:All reactions