lumbda/asm
russell@unturf.com 6e9d3ea52f isqrt: add integer square root builtin to all three impls
Semantics: (isqrt n) → floor(sqrt(n)). Negative argument errors.
Matches Python 3.8+ math.isqrt and R7RS exact-integer-sqrt contract.

- Python: wraps math.isqrt via lambda registration
- C: hand-rolled bit-by-bit algorithm in bi_isqrt (O(log n), no FPU)
- asm: new BI_ISQRT=109, bit-by-bit algorithm in integer registers
       (%r8/%r9/%r10). Negative input → stderr + exit(1) like other
       errors. GC builtin constants bumped to 110-114.

Tests:
- tests/functional.lsp: 7 shared tests (0, 1, perfect squares, floor
  cases, large values). Python + C now 196 each (was 189).
- asm/test.sh: 5 asm-local tests. asm suite now 142 (was 137).

MOAD: all three implementations O(log n), no O(N²) hazards.
2026-04-20 08:50:24 -04:00
..
lumbda isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00
lumbda-gc isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00
lumbda-gc.o isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00
lumbda.o isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00
lumbda.s isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00
Makefile rename: uncommonlisp -> lumbda throughout the repo 2026-04-19 10:20:11 -04:00
test.sh isqrt: add integer square root builtin to all three impls 2026-04-20 08:50:24 -04:00