C.2.1 Codegen Notes
The AArch64 backend also keeps the parser-visible stack model, but uses registers for the shallow saved-value stack instead of immediately spilling everything.
- The current visible expression result stays in
x0. - A small prefix of saved values is cached in callee-saved registers, with deeper values spilling to stack slots.
- Calls place the first 8 arguments in
x0-x7and place overflow arguments in the outbound call stack area. - Because AArch64 already requires 16-byte stack alignment and the backend spills in 16-byte slots, this path stays naturally aligned.
- Busy locals live in
x19,x24-x28(across calls) orx11-x15(between calls) through the shared local register allocation; slots beyond the single-instruction offset range stay in memory; ordinary builds only. - The visible value may be pending: a local not yet loaded (it then loads straight into its cache register or into
x9as a right operand), or the flags of the lastcmp.if, loop and short-circuit tests branch on the flags (b.ge,b.ne, ...) instead ofcsetmpluscbz;noton a pending comparison inverts it; everything else materializes first.