atomics A.0.5: full ordering surface (comptime $o: Ordering)
Migrate Atomic methods from seq_cst-only to the explicit ordering surface now that comptime value params work on generic-struct methods (workers3c4305f/d7a6857/d95ba0a): - atomic.sx: load/store take a comptime $o: Ordering (explicit, Rust-style; no default, matching design 4.6). a.load(.acquire) -> 'load atomic .. acquire'. - call.zig: atomicOrderingFromNode resolves a comptime-bound ordering identifier via comptimeIntNamed (+ atomicOrderingFromTag); documents the sx-Ordering <-> IR-AtomicOrdering declaration-order invariant. The per-op validity guard fires through the method path (a.load(.release) is a compile error). - 1700 migrated to explicit orderings (output unchanged 7/42/43). Suite green (715/0).
This commit is contained in:
@@ -59,6 +59,22 @@ Full atomic load/store plumbing with LLVM emission deliberately bailing loudly;
|
||||
`.ir`; add `emit_llvm.test.zig` unit. Then adversarial review, then the comptime-enum worker
|
||||
+ A.0.5 migration to the full ordering surface.
|
||||
|
||||
## A.0.5 — full ordering surface (DONE)
|
||||
`Atomic($T).load($o: Ordering)` / `store(v, $o)` — ordering is a COMPTIME value param,
|
||||
explicit (Rust-style, no default; design §4.6). `a.load(.acquire)` emits `load atomic …
|
||||
acquire`; `a.store(v, .release)` emits `store atomic … release`; `a.load(.release)` is a
|
||||
compile error (per-op validity guard fires through the method path). Recognizer
|
||||
`atomicOrderingFromNode` now resolves a comptime-bound ordering identifier via
|
||||
`comptimeIntNamed` (+ `atomicOrderingFromTag`, with the sx-Ordering ↔ IR-AtomicOrdering
|
||||
declaration-order invariant documented). 1700 migrated to explicit orderings (output
|
||||
unchanged 7/42/43). Suite green (715/0).
|
||||
|
||||
**Unblocked by three comptime-value-param commits (workers):** enum (3c4305f), tagged_union
|
||||
(d7a6857), generic-struct methods (d95ba0a). NOTE: default VALUES for comptime params on
|
||||
generic-struct methods are NOT bound (orthogonal gap — free-fn defaults work); atomics
|
||||
sidesteps it cleanly by requiring explicit ordering (matches the design). Candidate
|
||||
follow-up, not an atomics blocker.
|
||||
|
||||
## Known issues / capability gaps
|
||||
- **Comptime-constant ordering propagation MISSING (blocks the full surface).** A runtime
|
||||
`Ordering` method param can't reach LLVM (orderings are instruction attributes, not
|
||||
@@ -98,3 +114,7 @@ Full atomic load/store plumbing with LLVM emission deliberately bailing loudly;
|
||||
- **A.0c** — guard hardening from the adversarial review: scalar-kind allowlist + per-op
|
||||
ordering validity (call.zig), val_ty align bail (ops.zig), + diagnostic examples
|
||||
1130/1131. Suite green (713/0). (comptime enum value params landed via worker 3c4305f.)
|
||||
- **A.0.5** — full ordering surface: `Atomic($T).load/store($o: Ordering)` comptime ordering
|
||||
(explicit). Recognizer resolves comptime-bound ordering via `comptimeIntNamed`. 1700
|
||||
migrated to explicit orderings (acquire/release/relaxed/seq_cst). Unblocked by
|
||||
comptime-value-param workers (3c4305f/d7a6857/d95ba0a). Suite green (715/0).
|
||||
|
||||
Reference in New Issue
Block a user