Skip to content

Releases: avwohl/uc80

v0.4.2

09 May 14:35

Choose a tag to compare

Switch to src-layout. Previously the wheel published src and lib as top-level Python packages — top_level.txt literally listed them and the entry point was src.main:main. Any user (or other library) doing import src or import lib would resolve to uc80's internals. Now the wheel only publishes uc80. Also wires __version__ to importlib.metadata so it can't drift from pyproject. No behavior changes — pure packaging fix.

v0.4.1

09 May 11:05

Choose a tag to compare

Changes

  • Switch the driver to the plox-driven uc_core frontend. Replaces the legacy Lexer + Parser instantiations with a single uc_core.frontend.parse call. The preprocessor still runs upstream, same contract as before. All 136 in-tree tests pass.
  • Tighten dep to uc_core>=0.3.0 so installs pull the plox-driven front-end that this version expects.
  • requires-python relaxed from >=3.11 to >=3.10.
  • Tests: drop legacy front-end tests, port helpers to frontend.parse.

v0.4.0

30 Apr 11:04

Choose a tag to compare

Six codegen / driver fixes that move c-testsuite to 220/220 default.

Fixes

  • 64-bit ++/-- for long long: was only updating the low 16 bits, so while (size--) looped forever under --long=64.
  • Condition test for long long: only ORed the low 32 bits, could miss a non-zero high half.
  • Emit EXTRN for implicit external symbols: functions called without a prototype (e.g. `abort()` / `exit()`) emitted `LD HL,_abort` without the matching EXTRN, so um80 failed at assembly. Un-stuck many gcc-c-torture tests.
  • GCC builtin pass-throughs: rewrite `__builtin_memcpy` / `memset` / `abort` / `trap` / `unreachable` / `malloc` / `calloc` / `realloc` / `free` to their plain libc names.
  • Latin-1 fallback for non-UTF-8 source bytes (some torture tests have embedded `\xff`).
  • Struct-array element initialized from a compound literal: `struct Wrap arr[] = { (struct Wrap){fn}, fn };` was storing the address of the materialized literal in the first member instead of doing a byte-copy — the corrupted function pointer caused infinite loops in c-testsuite 00216 under `--long=64`.

Test results

config pass failures
default 220/220
--int=32 219/220 00200 .com >62KB TPA
--long=64 218/220 00104, 00204 lack a 32-bit native type
--int=32 --long=64 219/220 00200 .com >62KB TPA

gcc-c-torture (sample of 500): 418/500 (84%); remaining failures are dominated by GCC features the Z80 port can't reasonably implement (alloca, &&label / computed goto, __builtin_return_address, nested-function trampolines, _Complex).

Dependencies

Bumps the `uc_core` floor to `>=0.2.0` for the new `SIZE_TYPE` predefines.

v0.3.0

25 Apr 08:52

Choose a tag to compare

Test results

  • c-testsuite default: 220/220 (full pass, was 215)
  • c-testsuite --int=32: 219/220 (was 194)
  • c-testsuite --int=32 --long=64: 218/220 (was 194)
  • SDCC regression: 514/523 (was 488)

Highlights

Codegen

  • Float→int implicit conversion when target is "long" (caught plain int under --int=32)
  • Pointer arithmetic in BinaryOp now returns the pointer type — fixes *(N + (char *)&x) byte writes
  • Comma operator now evaluates left first regardless of operand width
  • Struct array element rvalues (t = buf[i] for struct types)
  • Globals whose case-folded names collide get a numeric suffix (um80 is case-insensitive)

Runtime

  • __fmul / __fdiv flush to zero on exponent underflow (was wrapping to a near-1.0 garbage)
  • Trig range reduction (_reduce_trig) shared between sin and cos
  • cos near pi/2 routes through sin(pi/2 - x) to avoid Taylor cancellation
  • cos: removed stale byte-swap before __fdiv

libc / headers

  • size_t / wchar_t pinned to pointer-width so libc stack offsets stay stable under --int=32
  • memset c arg declared as unsigned char (libc only ever reads the low byte)
  • %lX and %X honor width and zero-pad

v0.1.4

29 Mar 20:15

Choose a tag to compare

Code review cleanup release:

  • Fix 6 bugs (gen_cast ftoi, zero-init, locals size, _Bool, ForStmt analysis, type annotation)
  • Remove ~375 lines of dead code across 10 files
  • Lowercase all assembly output mnemonics and directives
  • Fix 5 stale/wrong comments

v0.1.3

14 Mar 23:17

Choose a tag to compare

Bitfield support, Fujitsu test runner consolidation, and bug fixes.

v0.1.2

13 Mar 03:11

Choose a tag to compare

  • Add upeepz80 as a runtime dependency
  • Fix CI test suite to match current compiler behavior

v0.1.1

13 Mar 02:38

Choose a tag to compare

Changes

  • Math library: Range reduction for exp, log, atan, floor, sinh, cosh, tan, sqrt, frexp/ldexp
  • New math functions: exp2, expm1, log1p, logb, scalbn, fmax, fdim, fma, asinh, acosh, atanh, fpclassify, nan, nextafter
  • fprintf restored: fprintf, vfprintf, vprintf, vsprintf extracted to modular library
  • Bug fixes: putchar and gets missing RET instruction, duplicate END in atomic, PUSH BC prologue for 14 math functions
  • stdlib complete: qsort and bsearch now implemented

v0.1.0 - Initial release

12 Mar 23:53

Choose a tag to compare

Initial release of uc80 - ANSI C compiler for Z80/CP/M.

Features:

  • ANSI C (C11/C23) compilation targeting Z80
  • Whole-program optimization with dead function elimination
  • Printf auto-detection and printf-to-puts rewrite
  • Shared storage for non-recursive functions
  • Modular library with selective linking
  • IEEE 754 single-precision float
  • CP/M target with embedded crt0