Gates: suite 310/310, one-shot fixpoint OK (3,845,439 bytes), separate-object fixpoint OK (11 objects), corpus 521/612 compile-OK, 0 crashes.
SET OF CARDINAL and SET OF INTEGER now use a sorted linked list
of disjoint inclusive ranges rather than a wide inline bit-vector:
BigSet = pointer to
{ lo : CARDINAL; hi : CARDINAL; next : pointer }
INTEGER values are mapped with the sign-bit flip
VAL(CARDINAL, x) XOR 0x80000000The runtime helpers live in runtime/syslib/shim.c:
m2bs_incl, m2bs_excl, m2bs_incl_range, m2bs_in
m2bs_copy_to, m2bs_equal, m2bs_bin
CS{}, CS{1, 3, 5..7},
IS{-5..-3, 100000}INCL / EXCL / INVAR parametersSET OF INTEGER including negative values and the full signed rangeBounded sets such as SET OF [0..100000] keep the existing inline
bit-vector representation and the 1,000,000-bit limit.
SET CONST is not supported yet: a CONST of
SET OF CARDINAL/INTEGER is a loud 230 (t_bad_bigconst).malloc; assignment frees the
previous list, but there is no GC. Program-exit cleanup is omitted.PACKEDSET is unchanged and remains bounded to 32 bits.SET OF CARDINAL/INTEGER is not used by the compiler itself, so
the fixpoint image remains self-hosting.t_wide_set — bounded wide set plus dynamic cardinal sett_bad_setbase — now tests full-range SET OF INTEGERt_big_ops — literals/ranges, copy, equality, all four set operators,
EXCL, negative integer elementst_bad_bigconst — dynamic set constants are rejected for nowcompiler/tests/showcase25.mod demonstrates the last additions:
SET OF CARDINAL and SET OF INTEGERINCL/EXCL/INSET OF [0..100000]ADDRESS/pointer identity (ADR(p^) = p)Expected output:
showcase25 sets=42 addr=ok
v3-dynamic-setsv3-showcase25