wasm_decode_atomic (wasm v0.1.0)
View SourceThe 0xFE opcode space: threads. Add an atomic instruction here.
Sixty-six instructions in four shapes, and only one of them is new to this decoder:
| shape | instructions |
|---|---|
| memory argument | every atomic load, store and read-modify-write, and memory.atomic.wait and notify |
| a single zero byte | atomic.fence |
The 0x03 0x00 encoding of atomic.fence is the odd one. The trailing byte is
a memory index reserved for a future proposal and required to be zero, so it is
checked rather than skipped: a non-zero byte there is a malformed module, not a
fence on another memory.