rfc: 0015 scalar atomics and the Aji memory model accepted (revision 2) and integrated into the spec

The Aji RC11 profile (RC11 with NO-THIN-AIR; stronger than ISO C11/C++20) as
normative axioms in spec 04 §20; DRF-SC; linear atomic<T> for AtomicScalar
with atomic.new/atomic.take; ref<atomic<T>> operands; ordering tables incl.
cmpxchg failure table and two results; effects [atomic] / [atomic, atomic.weak];
target atomic_widths and E4203; E4202; enumerator as oracle (observed ⊆ allowed,
exact equality on the normative litmus corpus). Feature atomics stays reserved
until P5-2a. Q-015 resolved; record/replay and Q-017 moved to Phase 8.
RFC 0003 superseded. AIR bundle +1.9 %.
This commit is contained in:
dev committed 2026-10-06 00:30:35 +03:00
1 parent 702d69b2c1
commit 2bbbd2135c
24 files changed
+927 -142

No files matched your search

+16 -1
View File
@@ -52,7 +52,8 @@ block = ident [ "(" [ param_list ] ")" ] ":" NL { instruction NL } ;
(* The first block is the entry block and takes no parameters. *)
instruction = [ local { "," local } "=" ] operation ;
(* More than one result only for instructions specified with several results (slice.split). *)
(* More than one result only for instructions specified with several results
(slice.split; atomic.cmpxchg with feature atomics). *)
operation = "const." int_type int_lit
| "const.bool" ( "true" | "false" )
@@ -74,6 +75,7 @@ operation = "const." int_type int_lit
| channel_op
| sync_op
| graph_op
| atomic_op
| terminator ;
(* Several instructions are terminators with named outgoing edges (spec 07a).
@@ -171,6 +173,18 @@ graph_op = "island.create" local "," local ok_err (* ter
| "arc.new" local "," local ok_err (* feature arc; terminator: root value, cap<mem.alloc> *)
| ( "arc.from_frozen" | "arc.clone" | "arc.release" ) local ; (* feature arc *)
(* Feature atomics (spec 04 §20–§30, §42). Each opcode is one dotted word; the
allowed orderings per operation are spec 04 §24 (E4201 otherwise). *)
atomic_op = "atomic.new" local
| "atomic.take" local
| "atomic.load." ordering local
| "atomic.store." ordering local "," local
| "atomic." rmw_op "." ordering local "," local
| "atomic.cmpxchg." ordering "." ordering local "," local "," local (* two results: old, exchanged *)
| "atomic.fence." ordering ;
rmw_op = "xchg" | "add.wrap" | "sub.wrap" | "and" | "or" | "xor" ;
ordering = "relaxed" | "acquire" | "release" | "acq_rel" | "seq_cst" ;
arith_op = ( "add" | "sub" | "mul" ) "." ( "checked" | "wrap" ) "." int_type
| ( "div" | "rem" ) ".checked." int_type
| ( "and" | "or" | "xor" ) "." ( int_type | "bool" )
@@ -204,6 +218,7 @@ type = int_type | "bool" | "void" | "never" | global
| ( "mutex" | "guard" ) "<" type ">" (* feature sync *)
| ( "island" | "frozen" | "iref" ) "<" type ">" (* feature islands *)
| "arc" "<" type ">" (* feature arc *)
| "atomic" "<" type ">" (* feature atomics; bool or an integer type up to 64 bits *)
| builtin_type ;
builtin_type = "cap_error" (* feature capabilities *)
| "alloc_error" (* feature heap *)