Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

µDewy is archived and no longer developed. This is a snapshot of its documentation. → Dewy

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-x7 and 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) or x11-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 x9 as a right operand), or the flags of the last cmp. if, loop and short-circuit tests branch on the flags (b.ge, b.ne, ...) instead of csetm plus cbz; not on a pending comparison inverts it; everything else materializes first.