boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

commit a1e3df941d9d15283a5a552e21b87b3f70854deb
parent 495942511e1e7cd5aa46d018bc40f72dfc2338a5
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Thu,  7 May 2026 10:43:27 -0700

docs: drop references to retired CC-PUNCHLIST/CC-CONTRACTS/PLAN/TCC-ARM64-ASM

Strip §X.Y citations to docs that no longer exist from 25 cc/cc-cg test
fixtures, the cc-lex/cc-pp run drivers, cc.scm's Initializers section,
and the boot4 / lib-arch / stage1-flatten / aarch64 kernel.S / arm64-asm
preambles. Each fixture's actual rationale is preserved; only the
dangling section anchor is removed.

Repoint cc/README.md at the docs that exist (SCHEME1.md, CCSCM.md, CC.md,
CC-EXT.md) instead of the four retired ones.

Diffstat:
Mboot/boot4.sh | 8+++++---
Mboot/lib-arch.sh | 2+-
Mbootprep/stage1-flatten.sh | 2+-
Mcc/README.md | 36+++++++++---------------------------
Mcc/cc.scm | 2+-
Mseed-kernel/arch/aarch64/kernel.S | 2+-
Mtests/cc-cg/015-char-roundtrip.scm | 2+-
Mtests/cc-cg/016-short-roundtrip.scm | 2+-
Mtests/cc-cg/017-int-roundtrip.scm | 2+-
Mtests/cc-cg/018-sext-narrow.scm | 2+-
Mtests/cc-cg/019-zext-narrow.scm | 3+--
Mtests/cc-cg/020-promote-sign.scm | 3+--
Mtests/cc-cg/036-struct-load.scm | 3+--
Mtests/cc-cg/037-struct-store.scm | 7++++---
Mtests/cc-cg/038-arrow.scm | 4++--
Mtests/cc-cg/040-array-index.scm | 2+-
Mtests/cc-cg/049-init-scalar-global.scm | 2+-
Mtests/cc-lex/_run-lex.scm | 4++--
Mtests/cc-pp/_run-pp.scm | 4++--
Mtests/cc/000-return-argc.c | 2+-
Mtests/cc/015-char-arith.c | 2+-
Mtests/cc/016-short-arith.c | 2+-
Mtests/cc/017-int-arith.c | 2+-
Mtests/cc/018-sext-narrow.c | 2+-
Mtests/cc/019-zext-narrow.c | 1-
Mtests/cc/020-promote-sign.c | 1-
Mtests/cc/036-struct-load.c | 8++++----
Mtests/cc/037-struct-store.c | 8++++----
Mtests/cc/038-arrow.c | 6+++---
Mtests/cc/039-struct-nested.c | 6+++---
Mtests/cc/040-array-index.c | 6+++---
Mtests/cc/041-array-2d.c | 8++++----
Mtests/cc/042-struct-fn-arg.c | 4++--
Mtests/cc/043-array-param-decay.c | 8++++----
Mtests/cc/111-struct-ret-1word.c | 6+++---
Mtests/cc/112-struct-ret-2word.c | 2+-
Mtests/cc/113-struct-ret-3word.c | 8++++----
Mtests/cc/114-struct-ret-many-args.c | 4++--
Mtests/cc/116-struct-ret-vararg.c | 2+-
Mvendor/tcc/patches/files/arm64-asm.c | 2+-
40 files changed, 81 insertions(+), 101 deletions(-)

diff --git a/boot/boot4.sh b/boot/boot4.sh @@ -5,8 +5,10 @@ ## the four-stage chain: tcc0 → tcc1 → tcc2 → tcc3. The bootstrap ## fixed-point check is `tcc2 == tcc3`: once tcc is compiling itself ## with no help from cc.scm, the chain reaches a byte-identical fixed -## point. (See docs/PLAN.md for the cc.scm vs tcc codegen-divergence -## reasoning behind needing four stages rather than two.) +## point. cc.scm and tcc emit different — but both correct — code from +## the same source, so tcc0 ≠ tcc1. tcc1 and tcc2 are both built by tcc, +## but tcc1 is itself a cc.scm-shaped binary, so its codegen choices in +## tcc2 need one more bounce to reach the tcc-shaped fixed point. ## ## tcc0 = tcc-source compiled by cc.scm ← boot3 ## tcc1 = tcc-source compiled by tcc0 ← produced here @@ -32,7 +34,7 @@ ## assembles .S inputs (start.S, sys_stubs.S) directly inside the ## container; no host asm step. The aarch64 assembler is the phase-1 ## arm64-asm.c that flatten patches into tcc-0.9.26 (see -## docs/TCC-ARM64-ASM.md). +## bootprep/stage1-flatten.sh, around the arm64-asm patch block). ## ## ─── Outputs ────────────────────────────────────────────────────────── ## build/$ARCH/$DRIVER/boot4/{tcc1, tcc2, tcc3} diff --git a/boot/lib-arch.sh b/boot/lib-arch.sh @@ -125,7 +125,7 @@ driver_init() { seed) # DRIVER=seed always consumes the podman-built boot6 kernel — # tcc3 is platform-agnostic but we settled on a single canonical - # build location to reduce surface area. See docs/PLAN.md A3. + # build location to reduce surface area. KERNEL_IMAGE=$ROOT/build/$ARCH/podman/boot6/$KERNEL_NAME EXTRACT=$ROOT/seed-kernel/scripts/extract-blk.sh [ -f "$KERNEL_IMAGE" ] || { diff --git a/bootprep/stage1-flatten.sh b/bootprep/stage1-flatten.sh @@ -221,7 +221,7 @@ apply_our_patch arm64-svcul-no-truncate-store "$SRC/arm64-gen.c" # AArch64 assembler — phase 1. Drops in arm64-asm.c + arm64-tok.h and # wires their includes into tcc.h, libtcc.c, and tcctok.h. Patches are # gated by TCC_TARGET_ARM64 in the surrounding source so they no-op on -# other arches even when applied. See docs/TCC-ARM64-ASM.md. +# other arches even when applied. cp "$OUR_PATCHES/files/arm64-asm.c" "$SRC/arm64-asm.c" cp "$OUR_PATCHES/files/arm64-tok.h" "$SRC/arm64-tok.h" apply_our_patch arm64-asm-include-tcc-h "$SRC/tcc.h" diff --git a/cc/README.md b/cc/README.md @@ -1,6 +1,6 @@ # cc — C compiler in scheme1 -A single-file C compiler written in scheme1 (see [LISP.md](../docs/LISP.md)) +A single-file C compiler written in scheme1 (see [docs/SCHEME1.md](../docs/SCHEME1.md)) that emits P1pp text, replacing MesCC at the live-bootstrap `tcc-mes` stage. ## Specs @@ -8,11 +8,10 @@ that emits P1pp text, replacing MesCC at the live-bootstrap `tcc-mes` stage. Read in this order: 1. [docs/CC.md](../docs/CC.md) — accepted C subset. -2. [docs/CC-INTERNALS.md](../docs/CC-INTERNALS.md) — module interfaces. -3. [docs/CC-CONTRACTS.md](../docs/CC-CONTRACTS.md) — frozen alphabets, ABI, - test formats, mangling, phase-1 milestone. -4. [docs/CC-PUNCHLIST.md](../docs/CC-PUNCHLIST.md) — TDD checklist of - codegen capabilities still red. +2. [docs/CCSCM.md](../docs/CCSCM.md) — `cc.scm` code map: subsystems, + data structures, pipeline. +3. [docs/CC-EXT.md](../docs/CC-EXT.md) — platform extensions accepted + beyond the base subset (the deltas tcc-0.9.26 actually uses). ## Files @@ -28,27 +27,6 @@ catm build/$ARCH/cc/cc.scm \ scheme1/prelude.scm cc/cc.scm cc/main.scm ``` -## Status - -Modules filled in past the scaffold; parser drives all six cg sections -and the cc suite has its phase-1 milestone fixture -(`tests/cc/00-return-argc.c`). The cg punch list (per -`docs/CC-INTERNALS.md`) is the active edge. - -## Workflow - -Per `docs/CC-INTERNALS.md` §Feature workflow, every codegen-touching -change lands in this order: - -1. cc-cg fixture (red). -2. cg implementation (green). -3. cc fixture (red). -4. parse implementation (green). - -Both cc-cg and cc are runtime-validating: the harness builds the -emitted P1pp into a real ELF, runs it, and asserts exit code / stdout. -No P1pp-text goldens. - ## Tests - `tests/cc-util/` — util helpers (Scheme unit tests) @@ -56,3 +34,7 @@ No P1pp-text goldens. - `tests/cc-pp/` — preprocessor token-stream goldens - `tests/cc-cg/` — direct cg API → ELF → run; assert runtime - `tests/cc/` — full pipeline via .c → ELF → run; assert runtime + +Both cc-cg and cc are runtime-validating: the harness builds the +emitted P1pp into a real ELF, runs it, and asserts exit code / stdout. +No P1pp-text goldens. diff --git a/cc/cc.scm b/cc/cc.scm @@ -5640,7 +5640,7 @@ (else #t)))))))) ;; ==================================================================== -;; Initializers (CC.md §Variable initializers, §E of CC-PUNCHLIST). +;; Initializers (see CC.md §Variable initializers). ;; ;; parse-init-global ps ty ;; Reads the initializer following `=` for a file-scope or block-scope diff --git a/seed-kernel/arch/aarch64/kernel.S b/seed-kernel/arch/aarch64/kernel.S @@ -46,7 +46,7 @@ stext: * Address loads use `ldr Xn, =sym` rather than `adrp/add :lo12:` so this * file assembles under tcc3 (the MOVW_UABS_G{0..3} reloc chain that * `ldr =sym` lowers to is the same chain `arm64-gen.c` uses for every - * compiler-emitted symbol load — see docs/TCC-ARM64-ASM.md). */ + * compiler-emitted symbol load). */ mov x9, #(1 << 31) msr hcr_el2, x9 mov x9, #0x3c5 /* EL1h, DAIF=1111 */ diff --git a/tests/cc-cg/015-char-roundtrip.scm b/tests/cc-cg/015-char-roundtrip.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/15-char-roundtrip.scm — width-correct byte load/store -;; on adjacent unsigned-char lvals (§A.1 of docs/CC-PUNCHLIST.md). +;; on adjacent unsigned-char lvals. ;; ;; Models: ;; unsigned char a = 0xAA, b = 0xBB; diff --git a/tests/cc-cg/016-short-roundtrip.scm b/tests/cc-cg/016-short-roundtrip.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/16-short-roundtrip.scm — width-correct 16-bit load/store -;; on adjacent unsigned-short lvals (§A.2 of docs/CC-PUNCHLIST.md). +;; on adjacent unsigned-short lvals. ;; ;; Models: ;; unsigned short a = 0xAABB, b = 0xCCDD; diff --git a/tests/cc-cg/017-int-roundtrip.scm b/tests/cc-cg/017-int-roundtrip.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/17-int-roundtrip.scm — width-correct 32-bit load/store -;; on adjacent unsigned-int lvals (§A.3 of docs/CC-PUNCHLIST.md). +;; on adjacent unsigned-int lvals. ;; ;; Models: ;; unsigned int a = 0xAABBCCDD, b = 0x11223344; diff --git a/tests/cc-cg/018-sext-narrow.scm b/tests/cc-cg/018-sext-narrow.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/18-sext-narrow.scm — signed narrowing keeps sign on -;; re-widen (§A.4 of docs/CC-PUNCHLIST.md). +;; re-widen. ;; ;; Models: ((int)(char)-3) == -3. ;; Forces the cg-cast narrowing path to sign-encode the result so diff --git a/tests/cc-cg/019-zext-narrow.scm b/tests/cc-cg/019-zext-narrow.scm @@ -1,5 +1,4 @@ -;; tests/cc-cg/19-zext-narrow.scm — unsigned narrowing zero-extends -;; (§A.5 of docs/CC-PUNCHLIST.md). +;; tests/cc-cg/19-zext-narrow.scm — unsigned narrowing zero-extends. ;; ;; Models: ((unsigned)(unsigned char)-3) == 253. ;; The narrowing cast to u8 must mask off the high bits (not sign- diff --git a/tests/cc-cg/020-promote-sign.scm b/tests/cc-cg/020-promote-sign.scm @@ -1,5 +1,4 @@ -;; tests/cc-cg/20-promote-sign.scm — integer promotion preserves sign -;; (§A.6 of docs/CC-PUNCHLIST.md). +;; tests/cc-cg/20-promote-sign.scm — integer promotion preserves sign. ;; ;; Models: signed char x = -1; return ((int)x + 2) == 1; ;; If promotion doesn't sign-extend, the i8 -1 reads as 255 and diff --git a/tests/cc-cg/036-struct-load.scm b/tests/cc-cg/036-struct-load.scm @@ -1,5 +1,4 @@ -;; tests/cc-cg/36-struct-load.scm — struct member load via cg-push-field -;; (§D.1 of docs/CC-PUNCHLIST.md). +;; tests/cc-cg/36-struct-load.scm — struct member load via cg-push-field. ;; ;; Models: ;; struct S { int a; int b; }; diff --git a/tests/cc-cg/037-struct-store.scm b/tests/cc-cg/037-struct-store.scm @@ -1,6 +1,7 @@ -;; tests/cc-cg/37-struct-store.scm — struct member store via cg-push-field -;; (§D.2 of docs/CC-PUNCHLIST.md). Uses char-typed fields to ensure the -;; width-correct store path from §A.1 cooperates with field offsets. +;; tests/cc-cg/37-struct-store.scm — struct member store via cg-push-field. +;; Uses char-typed fields to ensure the width-correct store path from +;; the byte-roundtrip test (15-char-roundtrip) cooperates with field +;; offsets. ;; ;; struct B { unsigned char a; unsigned char b; unsigned char c; }; ;; b.a = 3; b.b = 5; b.c = 7; diff --git a/tests/cc-cg/038-arrow.scm b/tests/cc-cg/038-arrow.scm @@ -1,5 +1,5 @@ -;; tests/cc-cg/38-arrow.scm — pointer-to-struct field access via cg -;; (§D.3 of docs/CC-PUNCHLIST.md). Models p->a / p->b through: +;; tests/cc-cg/38-arrow.scm — pointer-to-struct field access via cg. +;; Models p->a / p->b through: ;; cg-push-sym sym-p ; lval (frame), holds ptr-value ;; cg-load ; rval ptr ;; cg-push-deref ; lval struct (indirect) diff --git a/tests/cc-cg/040-array-index.scm b/tests/cc-cg/040-array-index.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/40-array-index.scm — array element access at non-zero -;; index (§D.5 of docs/CC-PUNCHLIST.md). Models: +;; index. Models: ;; int a[3]; a[0]=1; a[1]=2; a[2]=4; return a[0]+a[1]+a[2]; -> 7 ;; ;; The cg API does the same dance the parser uses for a[i]: diff --git a/tests/cc-cg/049-init-scalar-global.scm b/tests/cc-cg/049-init-scalar-global.scm @@ -1,5 +1,5 @@ ;; tests/cc-cg/49-init-scalar-global.scm — emit a global int with a -;; constant initializer; main returns its value. §E.1 of CC-PUNCHLIST. +;; constant initializer; main returns its value. ;; ;; Models: int g = 42; int main(void) { return g; } ;; Runtime: exits 42. diff --git a/tests/cc-lex/_run-lex.scm b/tests/cc-lex/_run-lex.scm @@ -4,8 +4,8 @@ ;; name; argv[1] is the combined source file (the test runner catm's ;; prelude+lex+driver into one); argv[2] is the .c fixture path. ;; -;; Calls lex-tokenize and prints one line per tok in CC-CONTRACTS §2.1 -;; serialization. Run: +;; Calls lex-tokenize and prints one line per tok in the cc-lex +;; golden serialization. Run: ;; scheme1 /tmp/c.scm <FIXTURE.c> (define (%hex-nibble n) diff --git a/tests/cc-pp/_run-pp.scm b/tests/cc-pp/_run-pp.scm @@ -5,8 +5,8 @@ ;; argv[2] = .c fixture path ;; ;; Slurps the fixture, runs lex-tokenize then pp-expand, prints one -;; tok per line on stdout in CC-CONTRACTS §2.1 format. Mirrors -;; tests/cc-lex/_run-lex.scm with one extra phase (pp). +;; tok per line on stdout in the cc-lex / cc-pp golden format. +;; Mirrors tests/cc-lex/_run-lex.scm with one extra phase (pp). (define (%hex-nibble n) (if (< n 10) (+ n 48) (+ n 87))) diff --git a/tests/cc/000-return-argc.c b/tests/cc/000-return-argc.c @@ -1,4 +1,4 @@ -/* Phase-1 milestone — see docs/CC-CONTRACTS.md §6. +/* Phase-1 milestone: smallest end-to-end exercise of the cc.scm pipeline. * Returns argc, so: * ./00-return-argc -> exit 1 (argv[0] only) * ./00-return-argc a b -> exit 3 diff --git a/tests/cc/015-char-arith.c b/tests/cc/015-char-arith.c @@ -1,5 +1,5 @@ // tests/cc-parse/15-char-arith.c — width-correct char load/store via -// real C source. §A.1 of docs/CC-PUNCHLIST.md. +// real C source. // // Two adjacent unsigned-char locals at consecutive 1-byte frame slots. // If cg uses 8-byte loads/stores on byte-typed lvals, b's store diff --git a/tests/cc/016-short-arith.c b/tests/cc/016-short-arith.c @@ -1,5 +1,5 @@ // tests/cc-parse/16-short-arith.c — width-correct short load/store via -// real C source. §A.2 of docs/CC-PUNCHLIST.md. +// real C source. // // Two adjacent unsigned-short locals at consecutive 2-byte slots. // Width-aware emission keeps b's store from contaminating a's slot. diff --git a/tests/cc/017-int-arith.c b/tests/cc/017-int-arith.c @@ -1,5 +1,5 @@ // tests/cc-parse/17-int-arith.c — width-correct 32-bit load/store via -// real C source. §A.3 of docs/CC-PUNCHLIST.md. +// real C source. int main() { unsigned int a = 2864434397u; /* 0xAABBCCDD */ diff --git a/tests/cc/018-sext-narrow.c b/tests/cc/018-sext-narrow.c @@ -1,5 +1,5 @@ // tests/cc-parse/18-sext-narrow.c — signed narrowing keeps sign on -// re-widen. §A.4 of docs/CC-PUNCHLIST.md. +// re-widen. int main() { return ((int)(signed char)-3) == -3; diff --git a/tests/cc/019-zext-narrow.c b/tests/cc/019-zext-narrow.c @@ -1,5 +1,4 @@ // tests/cc-parse/19-zext-narrow.c — unsigned narrowing zero-extends. -// §A.5 of docs/CC-PUNCHLIST.md. int main() { return ((unsigned)(unsigned char)-3) == 253; diff --git a/tests/cc/020-promote-sign.c b/tests/cc/020-promote-sign.c @@ -1,5 +1,4 @@ // tests/cc-parse/20-promote-sign.c — integer promotion preserves sign. -// §A.6 of docs/CC-PUNCHLIST.md. int main() { signed char x = -1; diff --git a/tests/cc/036-struct-load.c b/tests/cc/036-struct-load.c @@ -1,7 +1,7 @@ -// tests/cc-parse/36-struct-load.c — struct member load via real C -// (§D.1 of docs/CC-PUNCHLIST.md). Two int fields at distinct offsets; -// reading both back in distinct positions of the result confirms the -// parser uses the field offset, not 0 for both. +// tests/cc-parse/36-struct-load.c — struct member load via real C. +// Two int fields at distinct offsets; reading both back in distinct +// positions of the result confirms the parser uses the field offset, +// not 0 for both. // // s.a=1; s.b=2; return s.a + s.b*10; => exit 21. diff --git a/tests/cc/037-struct-store.c b/tests/cc/037-struct-store.c @@ -1,7 +1,7 @@ -// tests/cc-parse/37-struct-store.c — struct member store via real C -// (§D.2 of docs/CC-PUNCHLIST.md). char-typed fields exercise the -// width-correct store path; distinct multipliers in the readback -// isolate each field, so any offset/width bug yields a wrong sum. +// tests/cc-parse/37-struct-store.c — struct member store via real C. +// char-typed fields exercise the width-correct store path; distinct +// multipliers in the readback isolate each field, so any offset/width +// bug yields a wrong sum. // // b.a=3; b.b=5; b.c=7; return (b.a + b.b*10 + b.c*100) == 753; -> 1. diff --git a/tests/cc/038-arrow.c b/tests/cc/038-arrow.c @@ -1,6 +1,6 @@ -// tests/cc-parse/38-arrow.c — pointer-to-struct field access via real C -// (§D.3 of docs/CC-PUNCHLIST.md). Validates the arrow arm: rval the -// pointer, deref to reach the struct, push-field at the right offset. +// tests/cc-parse/38-arrow.c — pointer-to-struct field access via real C. +// Validates the arrow arm: rval the pointer, deref to reach the struct, +// push-field at the right offset. // // p->a=4; p->b=9; return p->b - p->a; => exit 5. diff --git a/tests/cc/039-struct-nested.c b/tests/cc/039-struct-nested.c @@ -1,7 +1,7 @@ // tests/cc-parse/39-struct-nested.c — nested struct field access via -// real C (§D.4 of docs/CC-PUNCHLIST.md). Tests both `s.inner.x` and -// `p->inner.x` chains. Padding ensures the inner struct is at a -// non-zero offset, so each step's offset must be summed correctly. +// real C. Tests both `s.inner.x` and `p->inner.x` chains. Padding +// ensures the inner struct is at a non-zero offset, so each step's +// offset must be summed correctly. // // outer.lead = 0; outer.inner.x=2; outer.inner.y=3; // return p->inner.x + p->inner.y*10 + s.inner.x*100 + s.inner.y*1000; diff --git a/tests/cc/040-array-index.c b/tests/cc/040-array-index.c @@ -1,7 +1,7 @@ // tests/cc-parse/40-array-index.c — array element access at non-zero -// index via real C (§D.5 of docs/CC-PUNCHLIST.md). a[0]+a[1]+a[2] -// = 7. Distinct values 1,2,4 ensure each index is read independently -// (sum 7 forms a unique bit-pattern in 3 bits). +// index via real C. a[0]+a[1]+a[2] = 7. Distinct values 1,2,4 ensure +// each index is read independently (sum 7 forms a unique bit-pattern +// in 3 bits). int main() { int a[3]; diff --git a/tests/cc/041-array-2d.c b/tests/cc/041-array-2d.c @@ -1,7 +1,7 @@ -// tests/cc-parse/41-array-2d.c — multi-dim array indexing (§D.6 of -// docs/CC-PUNCHLIST.md). int a[2][3]; row-major, so &a[1][2] is at -// byte offset (1*3 + 2)*4 = 20 from a's base. We write distinct -// values into a[0][0]..a[1][2] and read them back via a known sum. +// tests/cc-parse/41-array-2d.c — multi-dim array indexing. int a[2][3]; +// row-major, so &a[1][2] is at byte offset (1*3 + 2)*4 = 20 from a's +// base. We write distinct values into a[0][0]..a[1][2] and read them +// back via a known sum. // // Sum is 0 + 1 + 2 + 10 + 11 + 12 = 36. diff --git a/tests/cc/042-struct-fn-arg.c b/tests/cc/042-struct-fn-arg.c @@ -1,6 +1,6 @@ // tests/cc-parse/42-struct-fn-arg.c — struct passed by pointer to a -// function (§D.7 of docs/CC-PUNCHLIST.md). Smoke-tests §D primitives: -// caller takes &s, callee dereferences via -> on the pointer arg. +// function. Smoke-tests struct primitives: caller takes &s, callee +// dereferences via -> on the pointer arg. // // sum2(&s) where s={3,5} returns 8. diff --git a/tests/cc/043-array-param-decay.c b/tests/cc/043-array-param-decay.c @@ -1,8 +1,8 @@ // tests/cc-parse/43-array-param-decay.c — T[] in fn-param position -// decays to T* (§L.2 of docs/CC-PUNCHLIST.md). The callee declares -// `int a[]`; the parser must rewrite it to `int *` before slot -// allocation so `a[i]` indexes through a real pointer (not via an -// array slot, which would be wrong for an actual int* argument). +// decays to T*. The callee declares `int a[]`; the parser must +// rewrite it to `int *` before slot allocation so `a[i]` indexes +// through a real pointer (not via an array slot, which would be +// wrong for an actual int* argument). // // sum(a, 4) over {1,2,3,4} = 10. diff --git a/tests/cc/111-struct-ret-1word.c b/tests/cc/111-struct-ret-1word.c @@ -1,8 +1,8 @@ /* Struct return — 1 word. * - * Whole struct fits in a single 8-byte return slot. Per CC-CONTRACTS - * §3.2, the function exit emits `LD a0, [sp + <return-slot>]`; a - * single-int struct rides through that slot intact. */ + * Whole struct fits in a single 8-byte return slot. The function exit + * emits `LD a0, [sp + <return-slot>]`; a single-int struct rides + * through that slot intact. */ struct OneInt { int x; }; /* 4 bytes */ struct TwoInt { int x; int y; }; /* 8 bytes */ diff --git a/tests/cc/112-struct-ret-2word.c b/tests/cc/112-struct-ret-2word.c @@ -1,7 +1,7 @@ /* Struct return — 2 words (16 bytes). * * The cg return path uses one 8-byte return slot loaded into a0 at - * function exit (CC-CONTRACTS §3.2). A 2-word struct does not fit; on + * function exit. A 2-word struct does not fit; on * most ABIs the second word goes through a1 (or a hidden-pointer * convention is used). This test surfaces whichever path is wired, * or the absence of one. */ diff --git a/tests/cc/113-struct-ret-3word.c b/tests/cc/113-struct-ret-3word.c @@ -2,10 +2,10 @@ * * Larger than any reasonable register-pair return. Most real ABIs * would use a hidden first-arg pointer (sret/byval) so the callee - * stores the result through that pointer. CC-CONTRACTS §3.2 does - * not describe such a convention, so this exercises whatever the - * code does today — a loud fail is the expected outcome until a - * large-return ABI lands. */ + * stores the result through that pointer. The cg return path doesn't + * describe such a convention, so this exercises whatever the code does + * today — a loud fail is the expected outcome until a large-return ABI + * lands. */ struct Triple { long a; long b; long c; }; /* 24 bytes */ diff --git a/tests/cc/114-struct-ret-many-args.c b/tests/cc/114-struct-ret-many-args.c @@ -1,8 +1,8 @@ /* Struct return interacting with many args. * * Two pressures at once: - * - >4 named args spill from arg regs into stack-staged slots - * (CC-CONTRACTS §3.4 outgoing-arg staging). + * - >4 named args spill from arg regs into stack-staged + * outgoing-arg slots. * - The return value is a struct, which on a hidden-pointer ABI * would consume an *additional* arg slot (often arg0). * If both paths exist they must compose; the offsets must not collide. */ diff --git a/tests/cc/116-struct-ret-vararg.c b/tests/cc/116-struct-ret-vararg.c @@ -2,7 +2,7 @@ * * Combines two ABI-shaped concerns: the variadic save area (cg.scm * around L1027 has a TODO for variadic args >= 4) and the struct - * return slot (single 8-byte slot per CC-CONTRACTS §3.2). + * return slot (a single 8-byte slot). * * If the hidden return pointer is wired through arg0, the variadic * save area's indexing must skip it; if it isn't wired, a 2-word diff --git a/vendor/tcc/patches/files/arm64-asm.c b/vendor/tcc/patches/files/arm64-asm.c @@ -22,7 +22,7 @@ * * Inline-__asm__ constraint plumbing remains stubbed in the riscv64-asm * shape; .S input + top-level __asm__("…") works, constraint-driven - * asm gen is phase 3. See docs/TCC-ARM64-ASM.md. + * asm gen is phase 3. * * arm64_movimm() and arm64_encode_bimm64() live as static helpers in * arm64-gen.c — under ONE_SOURCE both arm64-gen.c and this file are