Releases: avwohl/uc80
v0.4.2
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
Changes
- Switch the driver to the plox-driven uc_core frontend. Replaces the legacy
Lexer+Parserinstantiations with a singleuc_core.frontend.parsecall. The preprocessor still runs upstream, same contract as before. All 136 in-tree tests pass. - Tighten dep to
uc_core>=0.3.0so installs pull the plox-driven front-end that this version expects. requires-pythonrelaxed from>=3.11to>=3.10.- Tests: drop legacy front-end tests, port helpers to
frontend.parse.
v0.4.0
Six codegen / driver fixes that move c-testsuite to 220/220 default.
Fixes
- 64-bit
++/--forlong long: was only updating the low 16 bits, sowhile (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
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/__fdivflush 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_tpinned to pointer-width so libc stack offsets stay stable under--int=32memsetcarg declared asunsigned char(libc only ever reads the low byte)%lXand%Xhonor width and zero-pad
v0.1.4
v0.1.3
v0.1.2
v0.1.1
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
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