Skip to content

version 14.0-BETA3

Pre-release
Pre-release

Choose a tag to compare

@irmen irmen released this 27 Oct 22:48
· 157 commits to master since this release

Highlights

  • M68K register allocator and stack frames (amiga500, amiga1200, qemu68k): ordinary subroutine locals and parameters now live in activation records on the CPU stack, making subroutines recursive and re-entrant. Hot values are kept in hardware registers (D2-D6, A2-A4, FP2-FP7) by an intraprocedural allocator, with spill slots appended to the A5 frame. asmsub routines must preserve those registers (no clobbers() list); use %option noframe for subroutines that manipulate the stack themselves. Clean locals are zero-initialized on every call.
  • M68K codegen optimizations: store/load folding, byte/word zero-extension fusion, branch-over-jump inversion, redundant frame zero-store removal, tail-call and store-reload peepholes, address-register preference for pointer call arguments, redundant LEA dropping, and signed division by powers of two.
  • Extended loads fused into single IR opcodes (loadmz/loadms/...) for all backends, reducing instruction count and register pressure.
  • New 6502 codegen (IR-based) peephole optimizer: tail-call conversion, redundant store-reload removal, and redundant cmp #0 removal.
  • on .. goto/on .. call jump tables now allow arbitrary choice bodies and else parts, handle gapped value ranges, and synthesize gap labels.
  • pointer reserved as a datatype name; ^^pointer parsing fixed and pointer-to-pointer struct field dereferences fixed.
  • Linked-list for-loop iteration: new via/until syntax for iterating linked lists; the Exec-specific for-loop over linked lists was removed.

Language

  • lerp/lerpw/interpolate/interpolatew converted to 6502 assembly.
  • in operator fixed for arrays larger than 255 elements.
  • defer keeps a static per-subroutine mask; recursion limitation documented.
  • pointer can no longer be used as a symbol name; ^^pointer parsing fixed.
  • Disallow pointer as a struct field name.

Libraries

  • New easygfx module (renamed from amiga_gfx) with Amiga graphics routines, plus diskfont.p8 and the amiga/gfxdemo and amiga/tictactoe examples.
  • New emudbg module for amiga500/amiga1200 targets.
  • lists module: doubly linked lists on all targets; on amiga500/amiga1200 a thin wrapper around exec.library.
  • M68K math: log2, diff, lerp, interpolate, gcd, crc16/crc32, bcd routines; optimized log2/gcd/lerp/interpolate/CRC; interpolatew added.
  • Inline math trig routines.
  • Math routines converted to assembly for 6502.

Targets and tooling

  • -emu for amiga targets now launches the Copperline emulator; -emu2 still launches Vamos.
  • Amiga: get rid of local var address escape warnings.
  • Amiga: improved variable source line positions.
  • Compiler version embedded in generated assembly files.
  • LSP: extract more document symbols.
  • Label name hash numbers are now stable.

Bug fixes

  • Various internal code-generation fixes for the new 6502 and m68k backends (asmsub save/restore checking, spill-slot alignment, const-load overhead, pointer dereference and subtraction operand handling). C64 sprite examples are more robust regarding sprite data memory addresses.
  • Fix compiler crashes on peek/poke/popp in wrong statement/expression context, 'not' combined with or/and, short-circuit boolean and/or on the virtual target, indexed reads/writes through ^^pointer struct fields, and block aliases.
  • Fix in operator on arrays larger than 255 elements.
  • Fix mouse click offsets and aspect ratio.
  • Fix undefined symbol errors and invalid parsing of ^^pointer.
  • Fix m68k frame teardown for intra-subroutine dispatch.
  • Fix virtual target typed pop results.

Documentation

  • AI-assisted development docs now mention the m68k-coder skill.
  • history.rst, comparing.rst, programming.rst and variables.rst updated to reflect m68k stack frames, recursion, and default text encodings per target.
  • RTD doc build fixed.