Files
pl/TODO.md
2026-01-01 16:09:21 +01:00

1.3 KiB
Raw Blame History

Milestones

Clean codebase structure

  1. Prelude classes like FileIO, strings null-termination etc.
  2. Diagnostic helper class for logging
  3. Remove "void" valuehandle class and use it as ValueHandle::Type instead
  4. Function multiple arguments support
  5. Implement if-else and while statements

Types support in language

Stack based code generation

  1. Stack based codegen, i.e. for fasm x86_64

IR Optimizations aka const folding, deadcode elimination

Register allocation

First beta assembly code generation with registers

...


References for IR optimizations

  1. Find out what use[B] and def[B] are for each block
  2. Define successors and predecessors of each block and make them accessible
  3. Compute liveIn[B] and liveOut[B] for each block

Classic equations:

liveIn[B] = use[B] (liveOut[B] - def[B])

liveOut[B] = liveIn[S] for S in succ[B] 5. Linear scan register allocation

  • Instruction numbering + per-instruction liveness
  • Live intervals
  • Linear scan allocator with ~6 fake regs
  • Spill to stack slots
  • Add “CALL clobbers regs” rule

References for register allocation

function's reserved registers: EAX, ECX, EDX

return registers: int => EAX float => ST0