Module Wax_wasm.AtomicsSource

Sourceval name : Ast.atomicop -> string

The WAT mnemonic, e.g. i64.atomic.rmw16.add_u.

Sourceval all : Ast.atomicop list

Every atomic op (atomic.fence excluded), for enumerating their mnemonics.

Sourceval opcode : Ast.atomicop -> int

The sub-opcode following the 0xFE prefix.

Sourceval of_opcode : int -> Ast.atomicop option

The Wax surface: a method name carries the access width only (atomic_load16, atomic_rmw_add8), so it denotes a family of concrete ops — the i32/i64 value type is resolved from the operand and result types during typing, mirroring the plain scalar accesses.

Sourcetype width = [
  1. | `W8
  2. | `W16
  3. | `W32
  4. | `W64
]
Sourcetype family =
  1. | Load of width
  2. | Store of width
  3. | Rmw of Ast.atomic_rmwop * width
  4. | Wait of [ `I32 | `I64 ]
  5. | Notify
Sourceval families : family list

Every Wax method family (39 names), in completion order.

Sourceval method_name : family -> string

The Wax method spelling on a memory receiver, e.g. atomic_load16, atomic_rmw_add8, atomic_notify (the inverse of of_method_name).

Sourceval of_method_name : string -> family option

Recognise a Wax atomic method name.

Sourceval family : Ast.atomicop -> family

The family a concrete op belongs to (its width is the access width).

Sourceval width_bytes : width -> int

Number of bytes a width accesses.

Sourceval family_bytes : family -> int

Number of bytes a family accesses — the width from the name, independent of which i32/i64 value type the operands select; its base-2 logarithm is the required (exact) alignment.

Sourceval natural_align_log2 : Ast.atomicop -> int

The base-2 logarithm of the access size; the memarg alignment must equal it exactly.

Sourceval signature : Ast.atomicop -> [ `I32 | `I64 ] list * [ `I32 | `I64 ] list

The operands after the address (which takes the memory's address type) and the results.