Skip to content

Tags: avwohl/uc80

Tags

v0.4.2

Toggle v0.4.2's commit message
Move to src-layout: stop publishing src/ and lib/ as top-level packages

The previous 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.

Layout now matches uc_core:
- src/*.py        -> src/uc80/*.py
- lib/            -> src/uc80/lib/
- pyproject.toml: where = ["src"]; package-data scoped to uc80
- entry point: uc80 = "uc80.main:main"

Path references updated:
- runtime.py and main.py: __file__.parent.parent / "lib" -> __file__.parent / "lib"
- run_*.py runners: UC80_DIR / "lib" -> UC80_DIR / "src" / "uc80" / "lib"
- All tests: from src.X -> from uc80.X; -m src.main -> -m uc80.main
- README and implementation_plan paths updated to src/uc80/lib/

__version__ now sourced from importlib.metadata.version("uc80") so it
can't drift from pyproject (was hardcoded "0.1.0" / never updated).

Bump to 0.4.2.

Verified: built wheel ships only `uc80` in top_level.txt; in a fresh
venv `import src` and `import lib` both fail; 136 in-tree tests pass;
run_ctests.py 00001 passes; end-to-end `uc80 hello.c -o hello.asm`
works.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

v0.4.1

Toggle v0.4.1's commit message
Bump version to 0.4.1

Switches the driver to the plox-driven uc_core front-end
(uc_core.frontend.parse) and drops the legacy lexer/parser
instantiations. All 136 in-tree tests pass.

Tighten the uc_core dep to >=0.3.0 to ensure installs pull the new
plox-driven uc_core (the legacy one stays usable but the new uc80
main relies on the same parse() that ships in 0.3.0).

Note: leaves untracked tests/fred.txt alone (workspace scratch).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

v0.4.0

Toggle v0.4.0's commit message
Release 0.4.0: 64-bit codegen, EXTRN, builtins, compound-literal fix

Bumps version 0.3.0 -> 0.4.0 and tightens the uc_core dep to >=0.2.0
(needs the new __SIZE_TYPE__ predefines).

Notable fixes since 0.3.0:
  - 64-bit ++/-- for long_long (was only updating low 16 bits — caused
    `while (size--)` to loop forever under --long=64)
  - Condition test for long_long expressions (was only ORing low 32
    bits, missing a non-zero high half)
  - Emit EXTRN for implicit-external function symbols (un-stuck many
    gcc-c-torture tests that called abort()/exit() without a prototype)
  - Rewrite GCC builtins (__builtin_memcpy, abort, trap, unreachable,
    malloc, calloc, realloc, free, etc.) to their libc names
  - Latin-1 fallback for non-UTF-8 source bytes
  - 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.  Manifested as an infinite loop in
    c-testsuite 00216 under --long=64.

c-testsuite final scores after these fixes:
  default                  220/220
  --int=32                 219/220 (00200 .com >62KB TPA)
  --long=64                218/220 (00104, 00204 lack 32-bit type)
  --int=32 --long=64       219/220 (00200 .com >62KB TPA)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

v0.3.0

Toggle v0.3.0's commit message
Release 0.3.0: full c-testsuite default pass + many --int=32 / SDCC f…

…ixes

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

This release lands a long backlog of correctness fixes spanning the
codegen, the runtime float library, and the libc:

- Trig range reduction + cos byte-swap fix; cos→sin route near pi/2
- __fmul / __fdiv flush-to-zero on exponent underflow
- Float→int conversion under --int=32 (fn args + var init)
- BinaryOp pointer arithmetic returns ptr type
- size_t / wchar_t pinned to pointer-width; memset c arg = unsigned char
- %lX / %X width + zero-pad
- Comma operator: evaluate left first
- Struct array element rvalues
- Globals disambiguated when case-folded names collide
- Per-test SDCC=1 define for swap

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

v0.1.4

Toggle v0.1.4's commit message
Code review cleanup: fix bugs, remove dead code, lowercase asm output

Fix 6 bugs: gen_cast ftoi corruption, _gen_zero_init_member missing branches,
_calc_locals_size counting static/extern, _is_bool_type missing _Bool,
ForStmt init analysis, static_locals type annotation. Remove ~375 lines of
dead code across 10 files. Lowercase all assembly output mnemonics and
directives. Fix 5 stale/wrong comments. Bump version to 0.1.4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

v0.1.3

Toggle v0.1.3's commit message
Bump version to 0.1.3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

v0.1.2

Toggle v0.1.2's commit message
Fix CI: add upeepz80 dependency and update stale tests

- Add upeepz80>=0.2.0 as a runtime dependency (needed by src/main.py)
- Fix test_lexer: float values are tuples, .5/1. parse as floats,
  true/false are identifiers, [[/]]/:: not implemented
- Fix test_parser: true/false are identifiers not BoolLiteral
- Fix test_codegen: disable inlining/const-prop for multiply test
- Bump version to 0.1.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

v0.1.1

Toggle v0.1.1's commit message
Math fixes, new math functions, fprintf restoration, and missing RET …

…fixes

- Range reduction for exp, log, atan, floor, sinh, cosh, tan, sqrt, frexp/ldexp
- New math modules: exp2, expm1, log1p, logb, scalbn, fmax, fdim, fma,
  asinh, acosh, atanh, fpclassify, nan, nextafter
- Extract fprintf/vfprintf/vprintf/vsprintf from monolithic libc to modular lib
- Fix putchar and gets missing RET (fell through to next module)
- Fix duplicate END in lc_atomic.mac
- Make _prt_dec PUBLIC for vprintf
- Add PUSH BC prologue to 14 math functions for correct IX offsets
- Update ANSI_C_COMPLIANCE.md: qsort/bsearch done, stdlib done, math extras
- Bump version to 0.1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

v0.1.0

Toggle v0.1.0's commit message
Fix pyproject.toml package-data for PyPI build

The empty-string key in [tool.setuptools.package-data] is not a valid
Python module name and caused the build to fail. Fix by making lib/
a proper package (add __init__.py files) and using lib = ["**/*.mac",
"**/*.h"] instead. Also add lib* to packages.find include.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>