Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename atomic.notify and *.atomic.wait #149

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions document/core/appendix/index-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ Instruction Binary Opcode
:math:`\F32.\REINTERPRET\K{\_}\I32` :math:`\hex{BE}` :math:`[\I32] \to [\F32]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-reinterpret>`
:math:`\F64.\REINTERPRET\K{\_}\I64` :math:`\hex{BF}` :math:`[\I64] \to [\F64]` :ref:`validation <valid-cvtop>` :ref:`execution <exec-cvtop>`, :ref:`operator <op-reinterpret>`
:math:`\ATOMICNOTIFY~\memarg` :math:`\hex{FE}~\hex{00}` :math:`[\I32~\I64] \to [\I64]` :ref:`validation <valid-atomic-notify>`
:math:`\I32.\ATOMICWAIT~\memarg` :math:`\hex{FE}~\hex{01}` :math:`[\I32~\I32~\I64] \to [\I32]` :ref:`validation <valid-atomic-wait>`
:math:`\I64.\ATOMICWAIT~\memarg` :math:`\hex{FE}~\hex{02}` :math:`[\I32~\I64~\I64] \to [\I32]` :ref:`validation <valid-atomic-wait>`
:math:`\MEMORYATOMICWAIT32~\memarg` :math:`\hex{FE}~\hex{01}` :math:`[\I32~\I32~\I64] \to [\I32]` :ref:`validation <valid-atomic-wait>`
:math:`\MEMORYATOMICWAIT64~\memarg` :math:`\hex{FE}~\hex{02}` :math:`[\I32~\I64~\I64] \to [\I32]` :ref:`validation <valid-atomic-wait>`
:math:`\I32.\ATOMICLOAD~\memarg` :math:`\hex{FE}~\hex{10}` :math:`[\I32] \to [\I32]` :ref:`validation <valid-atomic-load>` :ref:`execution <exec-atomic-load>`
:math:`\I64.\ATOMICLOAD~\memarg` :math:`\hex{FE}~\hex{11}` :math:`[\I32] \to [\I64]` :ref:`validation <valid-atomic-load>` :ref:`execution <exec-atomic-load>`
:math:`\I32.\ATOMICLOAD\K{8\_u}~\memarg` :math:`\hex{FE}~\hex{12}` :math:`[\I32] \to [\I32]` :ref:`validation <valid-atomic-loadn>` :ref:`execution <exec-atomic-loadn>`
Expand Down
6 changes: 3 additions & 3 deletions document/core/binary/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ Each variant of :ref:`atomic memory instruction <syntax-instr-atomic-memory>` is
.. math::
\begin{array}{llclll}
\production{instruction} & \Binstr &::=& \dots && \phantom{thisshouldbeenough} \\ &&|&
\hex{FE}~\hex{00}~~m{:}\Bmemarg &\Rightarrow& \ATOMICNOTIFY~m \\ &&|&
\hex{FE}~\hex{01}~~m{:}\Bmemarg &\Rightarrow& \I32.\ATOMICWAIT~m \\ &&|&
\hex{FE}~\hex{02}~~m{:}\Bmemarg &\Rightarrow& \I64.\ATOMICWAIT~m \\
\hex{FE}~\hex{00}~~m{:}\Bmemarg &\Rightarrow& \MEMORYATOMICNOTIFY~m \\ &&|&
\hex{FE}~\hex{01}~~m{:}\Bmemarg &\Rightarrow& \MEMORYATOMICWAIT\K{32}~m \\ &&|&
\hex{FE}~\hex{02}~~m{:}\Bmemarg &\Rightarrow& \MEMORYATOMICWAIT\K{64}~m \\
\end{array}


Expand Down
32 changes: 16 additions & 16 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -966,46 +966,46 @@ See :ref:`above <exec-atomic-store>`.

.. _exec-wait:

:math:`t\K{.}\ATOMICWAIT`
.........................
:math:`\MEMORYATOMICWAIT{N}`
............................

.. todo:: update to new rules
.. todo:: add text

.. math::
\begin{array}{l}
\begin{array}{lcl@{\qquad}l}
F; (\I64.\CONST~k)~(t.\CONST~c)~(\I32.\CONST~i)~t.\ATOMICWAIT
&\stepto^{(\ARD~a.\LLEN~n)~(\ARD~a.\LDATA[i]~b^{|t|})}&
F; (\I64.\CONST~k)~(\iN.\CONST~c)~(\I32.\CONST~i)~\MEMORYATOMICWAIT{N}
&\stepto^{(\ARD~a.\LLEN~n)~(\ARD~a.\LDATA[i]~b^{N})}&
F; (\WAITX~a.\LDATA[i])
\end{array}
\\ \qquad
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & \X{ea} + |t|/8 \leq n \\
\wedge & \X{ea} \mod |t|/8 = 0 \\
\wedge & b^{|t|} = \bytes_t(c) \\
(\iff & \X{ea} + N/8 \leq n \\
\wedge & \X{ea} \mod N/8 = 0 \\
\wedge & b^{N} = \bytes_t(c) \\
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
F; (\I64.\CONST~k)~(t.\CONST~c)~(\I32.\CONST~i)~t.\ATOMICWAIT
&\stepto^{(\ARD~a.\LLEN~n)~(\ARD~a.\LDATA[i]~b^{|t|})}&
F; (\I64.\CONST~k)~(\iN.\CONST~c)~(\I32.\CONST~i)~\MEMORYATOMICWAIT{N}
&\stepto^{(\ARD~a.\LLEN~n)~(\ARD~a.\LDATA[i]~b^{N})}&
F; (\I32.\CONST~1)
\end{array}
\\ \qquad
\begin{array}[t]{@{}r@{~}l@{}}
(\iff & \X{ea} + |t|/8 \leq n \\
\wedge & \X{ea} \mod |t|/8 = 0 \\
\wedge & b^{|t|} \neq \bytes_t(c) \\
(\iff & \X{ea} + N/8 \leq n \\
\wedge & \X{ea} \mod N/8 = 0 \\
\wedge & b^{N} \neq \bytes_t(c) \\
\end{array}
\\[1ex]
\begin{array}{lcl@{\qquad}l}
F; (\I64.\CONST~k)~(t.\CONST~c)~(\I32.\CONST~i)~t.\ATOMICWAIT
F; (\I64.\CONST~k)~(\iN.\CONST~c)~(\I32.\CONST~i)~\MEMORYATOMICWAIT{N}
&\stepto^{(\ARD~a.\LLEN~n)}&
F; \TRAP
\end{array}
\\ \qquad
\begin{array}[t]{@{}r@{~}l@{}}
(\iff i + |t|/8 > n \vee i \mod |t|/8 \neq 0) \\
(\iff i + N/8 > n \vee i \mod N/8 \neq 0) \\
\end{array}
\\[2ex]
\begin{array}[t]{@{}r@{~}l@{}}
Expand All @@ -1017,8 +1017,8 @@ See :ref:`above <exec-atomic-store>`.

.. _exec-notify:

:math:`\ATOMICNOTIFY`
.....................
:math:`\MEMORYATOMICNOTIFY`
...........................

.. todo:: update to new rules
.. todo:: add text; operand order? is the trap case correct (issue #105)?
Expand Down
12 changes: 6 additions & 6 deletions document/core/syntax/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ Instructions in this group are concerned with accessing :ref:`linear memory <syn
\ATOMICXCHG \\
\production{instruction} & \instr &::=&
\dots ~|~ \\&&&
\ATOMICNOTIFY~\memarg ~|~ \\&&&
\K{i}\X{nn}\K{.}\ATOMICWAIT~\memarg ~|~ \\&&&
\MEMORYATOMICNOTIFY~\memarg ~|~ \\&&&
\MEMORYATOMICWAIT\X{nn}~\memarg ~|~ \\&&&
\K{i}\X{nn}\K{.}\ATOMICLOAD~\memarg ~|~ \\&&&
\K{i}\X{nn}\K{.}\ATOMICSTORE~\memarg ~|~ \\&&&
\K{i}\X{nn}\K{.}\ATOMICLOAD\K{8\_u}~\memarg ~|~
Expand Down Expand Up @@ -324,13 +324,13 @@ this action conditionally, if the read value is equal to a provided comparison
argument. All other :ref:`atomicops <syntax-atomicop>` have behavior of the
:ref:`ibinop <syntax-ibinop>` of the same name.

The |ATOMICWAIT| and |ATOMICNOTIFY| instructions provide primitive
synchronization between :ref:`threads <syntax-thread>`. The |ATOMICWAIT|
The |MEMORYATOMICWAIT| and |MEMORYATOMICNOTIFY| instructions provide primitive
synchronization between :ref:`threads <syntax-thread>`. The |MEMORYATOMICWAIT|
instructions atomically load a value from the calculated effective address and
compare it to an expected value. If they are equal, the thread is then
suspended until a given timeout expires or another thread wakes it. The
|ATOMICNOTIFY| instruction wakes threads that are waiting on a given address, up
to a given maximum.
|MEMORYATOMICNOTIFY| instruction wakes threads that are waiting on a given
address, up to a given maximum.


.. index:: ! control instruction, ! structured control, ! label, ! block, ! branch, ! unwinding, result type, label index, function index, type index, vector, trap, function, table, function type
Expand Down
6 changes: 3 additions & 3 deletions document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ The offset immediate to atomic memory instructions is optional, and defaults to
.. math::
\begin{array}{llclll}
\production{instruction} & \Tplaininstr_I &::=& \dots \phantom{thisshouldbeenoughnowitissee} && \phantom{thisshouldbeenough} \\ &&|&
\text{atomic.notify}~~m{:}\Tmemarg_4 &\Rightarrow& \ATOMICNOTIFY~m \\ &&|&
\text{i32.atomic.wait}~~m{:}\Tmemarg_4 &\Rightarrow& \I32.\ATOMICWAIT~m \\ &&|&
\text{i64.atomic.wait}~~m{:}\Tmemarg_8 &\Rightarrow& \I64.\ATOMICWAIT~m \\
\text{memory.atomic.notify}~~m{:}\Tmemarg_4 &\Rightarrow& \MEMORYATOMICNOTIFY~m \\ &&|&
\text{memory.atomic.wait32}~~m{:}\Tmemarg_4 &\Rightarrow& \MEMORYATOMICWAIT{32}~m \\ &&|&
\text{memory.atomic.wait64}~~m{:}\Tmemarg_8 &\Rightarrow& \MEMORYATOMICWAIT{64}~m \\
\end{array}

.. math::
Expand Down
4 changes: 2 additions & 2 deletions document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@
.. |REINTERPRET| mathdef:: \xref{syntax/instructions}{syntax-instr-numeric}{\K{reinterpret}}

.. |ATOMIC| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{atomic}}
.. |ATOMICWAIT| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{atomic.wait}}
.. |ATOMICNOTIFY| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{atomic.notify}}
.. |MEMORYATOMICWAIT| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{memory.atomic.wait}}
.. |MEMORYATOMICNOTIFY| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{memory.atomic.notify}}
.. |ATOMICADD| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{add}}
.. |ATOMICSUB| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{sub}}
.. |ATOMICAND| mathdef:: \xref{syntax/instructions}{syntax-instr-atomic-memory}{\K{and}}
Expand Down
18 changes: 9 additions & 9 deletions document/core/valid/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ Atomic Memory Instructions

.. _valid-atomic-notify:

:math:`\ATOMICNOTIFY~\memarg`
.............................
:math:`\MEMORYATOMICNOTIFY~\memarg`
...................................

* The memory :math:`C.\CMEMS[0]` must be defined in the context.

Expand All @@ -450,29 +450,29 @@ Atomic Memory Instructions
\qquad
2^{\memarg.\ALIGN} = 4
}{
C \vdash \ATOMICNOTIFY~\memarg : [\I32~\I64] \to [\I64]
C \vdash \MEMORYATOMICNOTIFY~\memarg : [\I32~\I64] \to [\I64]
}

.. _valid-atomic-wait:

:math:`t\K{.}\ATOMICWAIT~\memarg`
.................................
:math:`\MEMORYATOMICWAIT{N}~\memarg`
....................................

* The memory :math:`C.\CMEMS[0]` must be defined in the context.

* Let :math:`\limits~\share` be the :ref:`memory type <syntax-memtype>` :math:`C.\CMEMS[0]`.

* The alignment :math:`2^{\memarg.\ALIGN}` must be equal to the :ref:`width <syntax-valtype>` of :math:`t` divided by :math:`8`.
* The alignment :math:`2^{\memarg.\ALIGN}` must be equal to :math:`N` divided by :math:`8`.

* Then the instruction is valid with type :math:`[\I32~t~\I64] \to [\I32]`.
* Then the instruction is valid with type :math:`[\I32~\K{i}{N}~\I64] \to [\I32]`.

.. math::
\frac{
C.\CMEMS[0] = \memtype
\qquad
2^{\memarg.\ALIGN} = |t|/8
2^{\memarg.\ALIGN} = N/8
}{
C \vdash t\K{.}\ATOMICWAIT~\memarg : [\I32~t~\I64] \to [\I32]
C \vdash \MEMORYATOMICWAIT{N}~\memarg : [\I32~\K{i}{N}~\I64] \to [\I32]
}

.. _valid-atomic-load:
Expand Down
6 changes: 3 additions & 3 deletions interpreter/binary/decode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ let memop s =
let atomic_instr s =
let pos = pos s in
match op s with
| 0x00 -> let a, o = memop s in atomic_notify a o
| 0x01 -> let a, o = memop s in i32_atomic_wait a o
| 0x02 -> let a, o = memop s in i64_atomic_wait a o
| 0x00 -> let a, o = memop s in memory_atomic_notify a o
| 0x01 -> let a, o = memop s in memory_atomic_wait32 a o
| 0x02 -> let a, o = memop s in memory_atomic_wait64 a o

| 0x10 -> let a, o = memop s in i32_atomic_load a o
| 0x11 -> let a, o = memop s in i64_atomic_load a o
Expand Down
15 changes: 8 additions & 7 deletions interpreter/binary/encode.ml
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,18 @@ let encode m =
| Store ({ty = I64Type; sz = Some Pack32; _} as mo) -> op 0x3e; memop mo
| Store {ty = F32Type | F64Type; sz = Some _; _} -> assert false

| AtomicNotify ({ty = I32Type; sz = None; _} as mo) ->
| MemoryAtomicNotify ({ty = I32Type; sz = None; _} as mo) ->
op 0xfe; op 0x00; memop mo
| AtomicNotify {ty = I32Type; sz = Some _; _} -> assert false
| AtomicNotify {ty = I64Type | F32Type | F64Type; _} -> assert false
| MemoryAtomicNotify {ty = I32Type; sz = Some _; _} -> assert false
| MemoryAtomicNotify {ty = I64Type | F32Type | F64Type; _} -> assert false

| AtomicWait ({ty = I32Type; sz = None; _} as mo) ->
| MemoryAtomicWait ({ty = I32Type; sz = None; _} as mo) ->
op 0xfe; op 0x01; memop mo
| AtomicWait ({ty = I64Type; sz = None; _} as mo) ->
| MemoryAtomicWait ({ty = I64Type; sz = None; _} as mo) ->
op 0xfe; op 0x02; memop mo
| AtomicWait {ty = I32Type | I64Type; sz = Some _; _} -> assert false
| AtomicWait {ty = F32Type | F64Type; _} -> assert false
| MemoryAtomicWait {ty = I32Type | I64Type; sz = Some _; _} ->
assert false
| MemoryAtomicWait {ty = F32Type | F64Type; _} -> assert false

| AtomicLoad ({ty = I32Type; sz = None; _} as mo) ->
op 0xfe; op 0x10; memop mo
Expand Down
5 changes: 2 additions & 3 deletions interpreter/exec/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ let rec step (c : config) : config =
v1 :: vs', []
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at]);

| AtomicWait {offset; ty; sz; _}, I64 timeout :: ve :: I32 i :: vs' ->
(* TODO: Trap if memory is not shared *)
| MemoryAtomicWait {offset; ty; sz; _}, I64 timeout :: ve :: I32 i :: vs' ->
let mem = memory frame.inst (0l @@ e.at) in
let addr = I64_convert.extend_i32_u i in
(try
Expand All @@ -290,7 +289,7 @@ let rec step (c : config) : config =
I32 1l :: vs', [] (* Not equal *)
with exn -> vs', [Trapping (memory_error e.at exn) @@ e.at])

| AtomicNotify x, I32 count :: I32 i :: vs' ->
| MemoryAtomicNotify x, I32 count :: I32 i :: vs' ->
if count = 0l then
I32 0l :: vs', [] (* Trivial case waking 0 waiters *)
else
Expand Down
4 changes: 2 additions & 2 deletions interpreter/syntax/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ and instr' =
| Unary of unop (* unary numeric operator *)
| Binary of binop (* binary numeric operator *)
| Convert of cvtop (* conversion *)
| AtomicWait of atomicop (* atomically wait for notification at address *)
| AtomicNotify of atomicop (* atomically notify all waiters at address *)
| MemoryAtomicWait of atomicop (* atomically wait for notification at address *)
| MemoryAtomicNotify of atomicop (* atomically notify all waiters at address *)
| AtomicLoad of atomicop (* atomically read memory at address *)
| AtomicStore of atomicop (* atomically write memory at address *)
| AtomicRmw of rmwop * atomicop (* atomically read, modify, write memory at address *)
Expand Down
12 changes: 6 additions & 6 deletions interpreter/syntax/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ let i64_store16 align offset =
let i64_store32 align offset =
Store {ty = I64Type; align; offset; sz = Some Pack32}

let atomic_notify align offset =
AtomicNotify {ty = I32Type; align; offset; sz = None}
let memory_atomic_notify align offset =
MemoryAtomicNotify {ty = I32Type; align; offset; sz = None}

let i32_atomic_wait align offset =
AtomicWait {ty = I32Type; align; offset; sz = None}
let i64_atomic_wait align offset =
AtomicWait {ty = I64Type; align; offset; sz = None}
let memory_atomic_wait32 align offset =
MemoryAtomicWait {ty = I32Type; align; offset; sz = None}
let memory_atomic_wait64 align offset =
MemoryAtomicWait {ty = I64Type; align; offset; sz = None}

let i32_atomic_load align offset =
AtomicLoad {ty = I32Type; align; offset; sz = None}
Expand Down
19 changes: 13 additions & 6 deletions interpreter/text/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ let extension = function
| Memory.SX -> "_s"
| Memory.ZX -> "_u"

let wait_size = function
| I32Type -> "32"
| I64Type -> "64"
| _ -> assert false

let rmw = function
| I32 I32Op.RmwAdd | I64 I64Op.RmwAdd -> "add"
| I32 I32Op.RmwSub | I64 I64Op.RmwSub -> "sub"
Expand Down Expand Up @@ -225,14 +230,16 @@ let storeop op =
| None -> memop "store" op (size op.ty)
| Some sz -> memop ("store" ^ pack_size sz) op (Memory.packed_size sz)

let atomicwaitop op =
let memoryatomicwaitop op =
match op.sz with
| None -> memop "atomic.wait" op (size op.ty)
| None ->
memop_without_type ("memory.atomic.wait" ^ (wait_size op.ty)) op
(size op.ty)
| Some sz -> assert false

let atomicnotifyop op =
let memoryatomicnotifyop op =
match op.sz with
| None -> memop_without_type "atomic.notify" op (size op.ty)
| None -> memop_without_type "memory.atomic.notify" op (size op.ty)
| Some sz -> assert false

let atomicloadop op =
Expand Down Expand Up @@ -302,8 +309,8 @@ let rec instr e =
| Unary op -> unop op, []
| Binary op -> binop op, []
| Convert op -> cvtop op, []
| AtomicWait op -> atomicwaitop op, []
| AtomicNotify op -> atomicnotifyop op, []
| MemoryAtomicWait op -> memoryatomicwaitop op, []
| MemoryAtomicNotify op -> memoryatomicnotifyop op, []
| AtomicLoad op -> atomicloadop op, []
| AtomicStore op -> atomicstoreop op, []
| AtomicRmw (rmwop, op) -> atomicrmwop op rmwop, []
Expand Down
19 changes: 11 additions & 8 deletions interpreter/text/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,12 @@ let string = '"' character* '"'
let name = '$' (letter | digit | '_' | symbol)+
let reserved = ([^'\"''('')'';'] # space)+ (* hack for table size *)

let ixx = "i" ("32" | "64")
let fxx = "f" ("32" | "64")
let xx = "32" | "64"
let ixx = "i" xx
let fxx = "f" xx
let nxx = ixx | fxx
let mixx = "i" ("8" | "16" | "32" | "64")
let mfxx = "f" ("32" | "64")
let mfxx = "f" xx
let sign = "s" | "u"
let mem_size = "8" | "16" | "32"
let rmw = "add" | "sub" | "and" | "or" | "xor" | "xchg"
Expand Down Expand Up @@ -251,11 +252,13 @@ rule token = parse
(i64_store16 (opt a 1))
(i64_store32 (opt a 2)) o)) }

| "atomic.notify"
{ ATOMIC_NOTIFY (fun a o -> (atomic_notify (opt a 2)) o) }
| (ixx as t)".atomic.wait"
{ ATOMIC_WAIT (fun a o ->
intop t (i32_atomic_wait (opt a 2)) (i64_atomic_wait (opt a 3)) o) }
| "memory.atomic.notify"
{ MEMORY_ATOMIC_NOTIFY (fun a o -> (memory_atomic_notify (opt a 2)) o) }
| "memory.atomic.wait"(xx as sz)
{ MEMORY_ATOMIC_WAIT (fun a o ->
intop ("i" ^ sz)
(memory_atomic_wait32 (opt a 2))
(memory_atomic_wait64 (opt a 3)) o) }
| (ixx as t)".atomic.load"
{ ATOMIC_LOAD (fun a o ->
intop t (i32_atomic_load (opt a 2)) (i64_atomic_load (opt a 3)) o) }
Expand Down
10 changes: 5 additions & 5 deletions interpreter/text/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ let inline_type_explicit (c : context) x ft at =
%token CALL CALL_INDIRECT RETURN
%token LOCAL_GET LOCAL_SET LOCAL_TEE GLOBAL_GET GLOBAL_SET
%token LOAD STORE OFFSET_EQ_NAT ALIGN_EQ_NAT
%token ATOMIC_WAIT ATOMIC_NOTIFY
%token MEMORY_ATOMIC_WAIT MEMORY_ATOMIC_NOTIFY
%token ATOMIC_LOAD ATOMIC_STORE ATOMIC_RMW ATOMIC_RMW_CMPXCHG
%token CONST UNARY BINARY TEST COMPARE CONVERT
%token UNREACHABLE MEMORY_SIZE MEMORY_GROW
Expand Down Expand Up @@ -186,8 +186,8 @@ let inline_type_explicit (c : context) x ft at =
%token<Ast.instr'> CONVERT
%token<int option -> Memory.offset -> Ast.instr'> LOAD
%token<int option -> Memory.offset -> Ast.instr'> STORE
%token<int option -> Memory.offset -> Ast.instr'> ATOMIC_WAIT
%token<int option -> Memory.offset -> Ast.instr'> ATOMIC_NOTIFY
%token<int option -> Memory.offset -> Ast.instr'> MEMORY_ATOMIC_WAIT
%token<int option -> Memory.offset -> Ast.instr'> MEMORY_ATOMIC_NOTIFY
%token<int option -> Memory.offset -> Ast.instr'> ATOMIC_LOAD
%token<int option -> Memory.offset -> Ast.instr'> ATOMIC_STORE
%token<int option -> Memory.offset -> Ast.instr'> ATOMIC_RMW
Expand Down Expand Up @@ -345,8 +345,8 @@ plain_instr :
| UNARY { fun c -> $1 }
| BINARY { fun c -> $1 }
| CONVERT { fun c -> $1 }
| ATOMIC_WAIT offset_opt align_opt { fun c -> $1 $3 $2 }
| ATOMIC_NOTIFY offset_opt align_opt { fun c -> $1 $3 $2 }
| MEMORY_ATOMIC_WAIT offset_opt align_opt { fun c -> $1 $3 $2 }
| MEMORY_ATOMIC_NOTIFY offset_opt align_opt { fun c -> $1 $3 $2 }
| ATOMIC_LOAD offset_opt align_opt { fun c -> $1 $3 $2 }
| ATOMIC_STORE offset_opt align_opt { fun c -> $1 $3 $2 }
| ATOMIC_RMW offset_opt align_opt { fun c -> $1 $3 $2 }
Expand Down
Loading