Commit Graph

3 Commits

Author SHA1 Message Date
9ec72b7895 test/804: u16 row exercises the MOVW copy-tail arm (#35 review)
esz 1/4/8/24/56 left the esz=2 MOVW tail the only emitted-but-
unexercised copy arm in both stages' delete lowering. 41 -> 44
fixtures.
2026-06-04 06:51:35 +09:00
912b9acef6 test/804: reject-row diagnostic-text checks + delete-in-a-loop row (#35 review)
A BUILD_FAIL row now asserts the expected stderr substring on both
stages (the #35 cite on the range form included) — without it a row
passes vacuously on any unrelated build failure. The new
delete_in_loop row drains [1,2,3,4] to empty via repeated
delete(xs[0]) with base-4 positional accumulation, pinning the len
bookkeeping under iteration. 38 -> 41 fixtures.
2026-06-04 06:50:16 +09:00
37febab9d5 wcc+w6c+w6c_ww: delete() builtin — single-element slice removal (part of #35)
Hare's delete(xs[i]) (ref/harec/src/check.c:1981-2027): checker accepts
an N_INDEX over a slice-typed base, stamps void; loud-rejects the range
form delete(xs[i..j]) (stays filed on #35 — regex fold-2b's consumers
are all single-element), non-index operands, array bases, wrong arity.

Lowering (both stages, converged byte-identical by construction):
ascending word-copy loop shifts [i+1..len) down one esz stride, then
hdr.len -= 1; cap unchanged. The move is a same-type whole-stride byte
copy — src and dst are elements of the SAME slice, so no boxing exists
for any element kind; one loop serves scalar/narrow/str/struct/tagged.
esz off the STAMPED base type (#34/#48 discipline). Base shapes: local
slice ident (LEAQ) and deref-of-local ptr-to-slice (MOVQ — the fold-2b
delete_thread shape); others rule-7 loud-stop.

test/804: 38 fixtures — first/middle/last/to-empty, esz 1/4/8/24/56
(MOVB/MOVL tails + 7-qword tagged), cap-unchanged, (*threads)[i], 4
checker reject rows; every accept row cs==ww asm byte-id.
2026-06-04 06:41:12 +09:00