package wax-lib

  1. Overview
  2. Docs
Libraries for Wax, a Rust-like syntax for WebAssembly

Install

dune-project
 Dependency

Authors

Maintainers

Sources

wax-v0.2.0.tbz
sha256=4361e1324b7754a4c08ab5b505df32061f3ce0cea60443fd0d3699e0fa796b32
sha512=fcc756d2f160ba90a9aa1131f2ab22ed7f45466ccd658c21cf9df6868a6aab0cee7f404719d698a379958802f9820398f2fe0685ecc4dda018ca4f653294e39b

doc/wax-lib.wasm/Wax_wasm/Atomics/index.html

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.