Suite 148/148; self-hosting fixpoint OK
(bootstrap/fixpoint.sh, image 2,320,770 bytes). master, tree
clean except the user's uncommitted compiler/toto.mod.
A short session: the remaining numeric conversion gap.
| Step | Tag | Commit | What |
|---|---|---|---|
| VAL conversions | v3-val-conversions |
1c774a7 |
INTEGER/LONGINT/REAL conversions + long→int narrowing |
VAL previously accepted only same-class operands and emitted no
conversion code. It now covers:
| From → To | Codegen |
|---|---|
INTEGER → LONGINT |
extsw |
LONGINT → INTEGER |
copy w (low 32 bits) |
INTEGER → REAL |
swtof |
LONGINT → REAL |
sltof |
REAL → INTEGER / LONGINT |
dtosi (truncate toward zero) |
Ordinal↔ordinal, pointer↔pointer and REAL↔REAL were already allowed.
New QbeGen helpers: NarrowLong, ConvRI, ConvRL, ConvLR
(alongside WidenLong/ConvIR).
Conversions is simplified: StrToInt/StrToCard accumulate in a
LONGINT and range-check, then narrow with VAL(INTEGER, v) /
VAL(CARDINAL, v); the old "detect overflow before the 32-bit wrap"
hand-guard is gone.
New: t_valconv (15) — int→long→int round-trip, int→real, real→int
truncation, long→real. ConvProg/ConvResultsProg still pass.
Docs: docs/summary_val-conversions.md.
cd .../m2compiler-V3
./bootstrap/fixpoint.sh # FIXPOINT OK
cd compiler && ./build.sh && ./run_tests.sh # 148/148
CLASS (deliberate exclusion).SysClock, richer Strings (Insert/Replace/
Capitalize), more Math.IOChan support.