Instructions

Instructions are syntactically distinguished into plain and structured instructions.

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-instr}{\mathtt{instr}}_I &::=& \mathit{in}{:}\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &\Rightarrow& \mathit{in} \\ &&|& \mathit{in}{:}\href{../text/instructions.html#text-blockinstr}{\mathtt{blockinstr}}_I &\Rightarrow& \mathit{in} \\ \end{array}\end{split}\]

In addition, as a syntactic abbreviation, instructions can be written as S-expressions in folded form, to group them visually.

Labels

Structured control instructions can be annotated with a symbolic label identifier. They are the only symbolic identifiers that can be bound locally in an instruction sequence. The following grammar handles the corresponding update to the identifier context by composing the context with an additional label entry.

\[\begin{split}\begin{array}{llcllll} \def\mathdef1753#1{{}}\mathdef1753{label} & \href{../text/instructions.html#text-label}{\mathtt{label}}_I &::=& v{:}\href{../text/values.html#text-id}{\mathtt{id}} &\Rightarrow& \{\href{../text/conventions.html#text-context}{\mathsf{labels}}~v\} \href{../syntax/conventions.html#notation-compose}{\oplus} I & (\mathrel{\mbox{if}} v \notin I.\href{../text/conventions.html#text-context}{\mathsf{labels}}) \\ &&|& \epsilon &\Rightarrow& \{\href{../text/conventions.html#text-context}{\mathsf{labels}}~(\epsilon)\} \href{../syntax/conventions.html#notation-compose}{\oplus} I \\ \end{array}\end{split}\]

Note

The new label entry is inserted at the beginning of the label list in the identifier context. This effectively shifts all existing labels up by one, mirroring the fact that control instructions are indexed relatively not absolutely.

Control Instructions

Structured control instructions can bind an optional symbolic label identifier. The same label identifier may optionally be repeated after the corresponding \(\mathtt{end}\) and \(\mathtt{else}\) pseudo instructions, to indicate the matching delimiters.

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{block instruction} & \href{../text/instructions.html#text-blockinstr}{\mathtt{blockinstr}}_I &::=& \def\mathdef1789#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1789{block}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{rt}{:}\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~(\mathit{in}{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1790#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1790{end}~~\href{../text/values.html#text-id}{\mathtt{id}}^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{block}}~\mathit{rt}~\mathit{in}^\ast~\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{end}} \qquad\quad~~ (\mathrel{\mbox{if}} \href{../text/values.html#text-id}{\mathtt{id}}^? = \epsilon \vee \href{../text/values.html#text-id}{\mathtt{id}}^? = \href{../text/instructions.html#text-label}{\mathtt{label}}) \\ &&|& \def\mathdef1791#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1791{loop}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{rt}{:}\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~(\mathit{in}{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1792#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1792{end}~~\href{../text/values.html#text-id}{\mathtt{id}}^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{loop}}~\mathit{rt}~\mathit{in}^\ast~\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{end}} \qquad\qquad (\mathrel{\mbox{if}} \href{../text/values.html#text-id}{\mathtt{id}}^? = \epsilon \vee \href{../text/values.html#text-id}{\mathtt{id}}^? = \href{../text/instructions.html#text-label}{\mathtt{label}}) \\ &&|& \def\mathdef1793#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1793{if}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{rt}{:}\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~(\mathit{in}_1{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~ \def\mathdef1794#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1794{else}~~\href{../text/values.html#text-id}{\mathtt{id}}_1^?~~(\mathit{in}_2{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1795#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1795{end}~~\href{../text/values.html#text-id}{\mathtt{id}}_2^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{if}}~\mathit{rt}~\mathit{in}_1^\ast~\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{else}}~\mathit{in}_2^\ast~\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{end}} \qquad (\mathrel{\mbox{if}} \href{../text/values.html#text-id}{\mathtt{id}}_1^? = \epsilon \vee \href{../text/values.html#text-id}{\mathtt{id}}_1^? = \href{../text/instructions.html#text-label}{\mathtt{label}}, \href{../text/values.html#text-id}{\mathtt{id}}_2^? = \epsilon \vee \href{../text/values.html#text-id}{\mathtt{id}}_2^? = \href{../text/instructions.html#text-label}{\mathtt{label}}) \\ \end{array}\end{split}\]

All other control instruction are represented verbatim.

\[\begin{split}\begin{array}{llcllll} \def\mathdef1753#1{{}}\mathdef1753{plain instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \def\mathdef1796#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1796{unreachable} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{unreachable}} \\ &&|& \def\mathdef1797#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1797{nop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{nop}} \\ &&|& \def\mathdef1798#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1798{br}~~l{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br}}~l \\ &&|& \def\mathdef1799#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1799{br\_if}~~l{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br\_if}}~l \\ &&|& \def\mathdef1800#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1800{br\_table}~~l^\ast{:}\href{../text/conventions.html#text-vec}{\mathtt{vec}}(\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I)~~l_N{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br\_table}}~l^\ast~l_N \\ &&|& \def\mathdef1801#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1801{return} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{return}} \\ &&|& \def\mathdef1802#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1802{call}~~x{:}\href{../text/modules.html#text-funcidx}{\mathtt{funcidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call}}~x \\ &&|& \def\mathdef1803#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1803{call\_indirect}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}~~y,I'{:}\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call\_indirect}}~x~y & (\mathrel{\mbox{if}} I' = \{\}) \\ \end{array}\end{split}\]

Note

The side condition stating that the identifier context \(I'\) must be empty in the rule for \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call\_indirect}}\) enforces that no identifier can be bound in any \(\href{../text/types.html#text-functype}{\mathtt{param}}\) declaration appearing in the type annotation.

Abbreviations

The \(\def\mathdef1804#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1804{else}\) keyword of an \(\def\mathdef1805#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1805{if}\) instruction can be omitted if the following instruction sequence is empty.

\[\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{block instruction} & \def\mathdef1806#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1806{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef1807#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1807{end} &\equiv& \def\mathdef1808#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1808{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef1809#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1809{else}~~\def\mathdef1810#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1810{end} \end{array}\]

Also, for backwards compatibility, the table index to \(\def\mathdef1811#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1811{call\_indirect}\) can be omitted, defaulting to \(0\).

\[\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{plain instruction} & \def\mathdef1812#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1812{call\_indirect}~~\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}} &\equiv& \def\mathdef1813#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1813{call\_indirect}~~0~~\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}} \end{array}\]

Reference Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1814#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1814{ref.null} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-ref}{\mathsf{ref{.}null}} \\ &&|& \def\mathdef1815#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1815{ref.is\_null} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-ref}{\mathsf{ref{.}is\_null}} \\ &&|& \def\mathdef1816#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1816{ref.func}~~x{:}\href{../text/modules.html#text-funcidx}{\mathtt{funcidx}} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-ref}{\mathsf{ref{.}func}}~x \\ &&|& \end{array}\end{split}\]

Parametric Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1817#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1817{drop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-parametric}{\mathsf{drop}} \\ &&|& \def\mathdef1818#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1818{select}~((t{:}\href{../text/types.html#text-functype}{\mathtt{result}})^\ast)^? &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-parametric}{\mathsf{select}}~(t^\ast)^? \\ \end{array}\end{split}\]

Variable Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1819#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1819{local.get}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{local.get}}~x \\ &&|& \def\mathdef1820#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1820{local.set}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{local.set}}~x \\ &&|& \def\mathdef1821#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1821{local.tee}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{local.tee}}~x \\ &&|& \def\mathdef1822#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1822{global.get}~~x{:}\href{../text/modules.html#text-globalidx}{\mathtt{globalidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{global.get}}~x \\ &&|& \def\mathdef1823#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1823{global.set}~~x{:}\href{../text/modules.html#text-globalidx}{\mathtt{globalidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{global.set}}~x \\ \end{array}\end{split}\]

Table Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1824#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1824{table.get}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.get}}~x \\ &&|& \def\mathdef1825#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1825{table.set}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.set}}~x \\ &&|& \def\mathdef1826#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1826{table.size}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.size}}~x \\ &&|& \def\mathdef1827#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1827{table.grow}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.grow}}~x \\ &&|& \def\mathdef1828#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1828{table.fill}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.fill}}~x \\ \def\mathdef1829#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1829{table.copy}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I~~y{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.copy}}~x~y \\ &&|& \def\mathdef1830#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1830{table.init}~~x{:}\href{../text/modules.html#text-tableidx}{\mathtt{tableidx}}_I~~y{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.init}}~x~y \\ &&|& \def\mathdef1831#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1831{elem.drop}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{elem.drop}}~x \\ \end{array}\end{split}\]

Abbreviations

For backwards compatibility, all \(table indices <syntax-tableidx>\) may be omitted from table instructions, defaulting to \(0\).

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \def\mathdef1832#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1832{table.get} &\equiv& \def\mathdef1833#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1833{table.get}~~\def\mathdef1834#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1834{0} \\ &&|& \def\mathdef1835#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1835{table.set} &\equiv& \def\mathdef1836#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1836{table.set}~~\def\mathdef1837#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1837{0} \\ &&|& \def\mathdef1838#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1838{table.size} &\equiv& \def\mathdef1839#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1839{table.size}~~\def\mathdef1840#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1840{0} \\ &&|& \def\mathdef1841#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1841{table.grow} &\equiv& \def\mathdef1842#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1842{table.grow}~~\def\mathdef1843#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1843{0} \\ &&|& \def\mathdef1844#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1844{table.fill} &\equiv& \def\mathdef1845#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1845{table.fill}~~\def\mathdef1846#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1846{0} \\ &&|& \def\mathdef1847#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1847{table.copy} &\equiv& \def\mathdef1848#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1848{table.copy}~~\def\mathdef1849#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1849{0}~~\def\mathdef1850#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1850{0} \\ &&|& \def\mathdef1851#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1851{table.init}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\equiv& \def\mathdef1852#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1852{table.init}~~\def\mathdef1853#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1853{0}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I \\ &&|& \end{array}\end{split}\]

Memory Instructions

The offset and alignment immediates to memory instructions are optional. The offset defaults to \(\mathtt{0}\), the alignment to the storage size of the respective memory access, which is its natural alignment. Lexically, an \(\href{../text/instructions.html#text-memarg}{\mathtt{offset}}\) or \(\href{../text/instructions.html#text-memarg}{\mathtt{align}}\) phrase is considered a single keyword token, so no white space is allowed around the \(\def\mathdef1854#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1854{=}\).

\[\begin{split}\begin{array}{llcllll} \def\mathdef1753#1{{}}\mathdef1753{memory argument} & \href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_N &::=& o{:}\href{../text/instructions.html#text-memarg}{\mathtt{offset}}~~a{:}\href{../text/instructions.html#text-memarg}{\mathtt{align}}_N &\Rightarrow& \{ \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{align}}~n,~\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{offset}}~o \} & (\mathrel{\mbox{if}} a = 2^n) \\ \def\mathdef1753#1{{}}\mathdef1753{memory offset} & \href{../text/instructions.html#text-memarg}{\mathtt{offset}} &::=& \def\mathdef1855#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1855{offset{=}}o{:}\href{../text/values.html#text-int}{\def\mathdef1777#1{{\mathtt{u}#1}}\mathdef1777{\mathtt{32}}} &\Rightarrow& o \\ &&|& \epsilon &\Rightarrow& 0 \\ \def\mathdef1753#1{{}}\mathdef1753{memory alignment} & \href{../text/instructions.html#text-memarg}{\mathtt{align}}_N &::=& \def\mathdef1856#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1856{align{=}}a{:}\href{../text/values.html#text-int}{\def\mathdef1777#1{{\mathtt{u}#1}}\mathdef1777{\mathtt{32}}} &\Rightarrow& a \\ &&|& \epsilon &\Rightarrow& N \\ \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1857#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1857{i32.load}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}~m \\ &&|& \def\mathdef1858#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1858{i64.load}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_8 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}~m \\ &&|& \def\mathdef1859#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1859{f32.load}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}~m \\ &&|& \def\mathdef1860#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1860{f64.load}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_8 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}~m \\ &&|& \def\mathdef1861#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1861{i32.load8\_s}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{8\_s}~m \\ &&|& \def\mathdef1862#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1862{i32.load8\_u}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{8\_u}~m \\ &&|& \def\mathdef1863#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1863{i32.load16\_s}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{16\_s}~m \\ &&|& \def\mathdef1864#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1864{i32.load16\_u}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{16\_u}~m \\ &&|& \def\mathdef1865#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1865{i64.load8\_s}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{8\_s}~m \\ &&|& \def\mathdef1866#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1866{i64.load8\_u}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{8\_u}~m \\ &&|& \def\mathdef1867#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1867{i64.load16\_s}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{16\_s}~m \\ &&|& \def\mathdef1868#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1868{i64.load16\_u}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{16\_u}~m \\ &&|& \def\mathdef1869#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1869{i64.load32\_s}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{32\_s}~m \\ &&|& \def\mathdef1870#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1870{i64.load32\_u}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{load}}\mathsf{32\_u}~m \\ &&|& \def\mathdef1871#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1871{i32.store}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}~m \\ &&|& \def\mathdef1872#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1872{i64.store}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_8 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}~m \\ &&|& \def\mathdef1873#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1873{f32.store}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}~m \\ &&|& \def\mathdef1874#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1874{f64.store}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_8 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}~m \\ &&|& \def\mathdef1875#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1875{i32.store8}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}\mathsf{8}~m \\ &&|& \def\mathdef1876#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1876{i32.store16}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}\mathsf{16}~m \\ &&|& \def\mathdef1877#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1877{i64.store8}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_1 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}\mathsf{8}~m \\ &&|& \def\mathdef1878#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1878{i64.store16}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_2 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}\mathsf{16}~m \\ &&|& \def\mathdef1879#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1879{i64.store32}~~m{:}\href{../text/instructions.html#text-memarg}{\mathtt{memarg}}_4 &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{store}}\mathsf{32}~m \\ &&|& \def\mathdef1880#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1880{memory.size} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.size}} \\ &&|& \def\mathdef1881#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1881{memory.grow} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.grow}} \\ &&|& \def\mathdef1882#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1882{memory.fill} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.fill}} \\ &&|& \def\mathdef1883#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1883{memory.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.copy}} \\ &&|& \def\mathdef1884#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1884{memory.init}~~x{:}\href{../text/modules.html#text-dataidx}{\mathtt{dataidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.init}}~x \\ &&|& \def\mathdef1885#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1885{data.drop}~~x{:}\href{../text/modules.html#text-dataidx}{\mathtt{dataidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{data.drop}}~x \\ \end{array}\end{split}\]

Numeric Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\&&|& \def\mathdef1886#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1886{i32.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1783#1{{\mathtt{i}#1}}\mathdef1783{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1887#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1887{i64.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1784#1{{\mathtt{i}#1}}\mathdef1784{\mathtt{64}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1888#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1888{f32.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1787#1{{\mathtt{f}#1}}\mathdef1787{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~z \\ &&|& \def\mathdef1889#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1889{f64.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1788#1{{\mathtt{f}#1}}\mathdef1788{\mathtt{64}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~z \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1890#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1890{i32.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef1891#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1891{i32.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef1892#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1892{i32.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef1893#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1893{i32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1894#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1894{i32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1895#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1895{i32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1896#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1896{i32.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef1897#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1897{i32.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef1898#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1898{i32.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef1899#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1899{i32.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef1900#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1900{i32.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef1901#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1901{i32.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef1902#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1902{i32.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef1903#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1903{i32.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef1904#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1904{i32.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef1905#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1905{i32.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef1906#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1906{i32.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef1907#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1907{i32.rotr} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotr}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1908#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1908{i64.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef1909#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1909{i64.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef1910#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1910{i64.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef1911#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1911{i64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1912#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1912{i64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1913#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1913{i64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1914#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1914{i64.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef1915#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1915{i64.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef1916#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1916{i64.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef1917#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1917{i64.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef1918#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1918{i64.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef1919#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1919{i64.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef1920#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1920{i64.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef1921#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1921{i64.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef1922#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1922{i64.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef1923#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1923{i64.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef1924#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1924{i64.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef1925#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1925{i64.rotr} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotr}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1926#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1926{f32.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef1927#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1927{f32.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef1928#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1928{f32.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef1929#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1929{f32.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef1930#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1930{f32.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef1931#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1931{f32.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef1932#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1932{f32.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef1933#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1933{f32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1934#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1934{f32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1935#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1935{f32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1936#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1936{f32.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef1937#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1937{f32.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef1938#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1938{f32.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef1939#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1939{f32.copysign} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{copysign}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1940#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1940{f64.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef1941#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1941{f64.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef1942#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1942{f64.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef1943#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1943{f64.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef1944#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1944{f64.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef1945#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1945{f64.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef1946#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1946{f64.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef1947#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1947{f64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1948#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1948{f64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1949#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1949{f64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1950#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1950{f64.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef1951#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1951{f64.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef1952#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1952{f64.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef1953#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1953{f64.copysign} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{copysign}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1954#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1954{i32.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef1955#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1955{i32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef1956#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1956{i32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef1957#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1957{i32.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef1958#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1958{i32.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef1959#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1959{i32.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef1960#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1960{i32.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef1961#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1961{i32.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef1962#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1962{i32.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef1963#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1963{i32.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef1964#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1964{i32.ge\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_u} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1965#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1965{i64.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef1966#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1966{i64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef1967#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1967{i64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef1968#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1968{i64.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef1969#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1969{i64.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef1970#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1970{i64.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef1971#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1971{i64.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef1972#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1972{i64.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef1973#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1973{i64.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef1974#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1974{i64.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef1975#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1975{i64.ge\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_u} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1976#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1976{f32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef1977#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1977{f32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef1978#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1978{f32.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef1979#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1979{f32.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef1980#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1980{f32.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef1981#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1981{f32.ge} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1982#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1982{f64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef1983#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1983{f64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef1984#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1984{f64.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef1985#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1985{f64.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef1986#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1986{f64.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef1987#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1987{f64.ge} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}} \\ \end{array}\end{split}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1753#1{{}}\mathdef1753{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1988#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1988{i32.wrap\_i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{wrap}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ &&|& \def\mathdef1989#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1989{i32.trunc\_f32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_s} \\ &&|& \def\mathdef1990#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1990{i32.trunc\_f32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_u} \\ &&|& \def\mathdef1991#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1991{i32.trunc\_f64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_s} \\ &&|& \def\mathdef1992#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1992{i32.trunc\_f64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_u} \\ &&|& \def\mathdef1993#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1993{i64.extend\_i32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_s} \\ &&|& \def\mathdef1994#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1994{i64.extend\_i32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_u} \\ &&|& \def\mathdef1995#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1995{i64.trunc\_f32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_s} \\ &&|& \def\mathdef1996#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1996{i64.trunc\_f32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_u} \\ &&|& \def\mathdef1997#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1997{i64.trunc\_f64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_s} \\ &&|& \def\mathdef1998#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1998{i64.trunc\_f64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_u} \\ &&|& \def\mathdef1999#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1999{f32.convert\_i32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_s} \\ &&|& \def\mathdef2000#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2000{f32.convert\_i32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_u} \\ &&|& \def\mathdef2001#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2001{f32.convert\_i64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}\mathsf{\_s} \\ &&|& \def\mathdef2002#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2002{f32.convert\_i64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}\mathsf{\_u} \\ &&|& \def\mathdef2003#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2003{f32.demote\_f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{demote}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2004#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2004{f64.convert\_i32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_s} \\ &&|& \def\mathdef2005#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2005{f64.convert\_i32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}\mathsf{\_u} \\ &&|& \def\mathdef2006#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2006{f64.convert\_i64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}\mathsf{\_s} \\ &&|& \def\mathdef2007#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2007{f64.convert\_i64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}\mathsf{\_u} \\ &&|& \def\mathdef2008#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2008{f64.promote\_f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{promote}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2009#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2009{i32.reinterpret\_f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{reinterpret}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2010#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2010{i64.reinterpret\_f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{reinterpret}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2011#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2011{f32.reinterpret\_i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{reinterpret}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2012#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2012{f64.reinterpret\_i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{reinterpret}}\mathsf{\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ \end{array}\end{split}\]

Folded Instructions

Instructions can be written as S-expressions by grouping them into folded form. In that notation, an instruction is wrapped in parentheses and optionally includes nested folded instructions to indicate its operands.

In the case of block instructions, the folded form omits the \(\def\mathdef2013#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2013{end}\) delimiter. For \(\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{if}}\) instructions, both branches have to be wrapped into nested S-expressions, headed by the keywords \(\def\mathdef2014#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2014{then}\) and \(\def\mathdef2015#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2015{else}\).

The set of all phrases defined by the following abbreviations recursively forms the auxiliary syntactic class \(\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}\). Such a folded instruction can appear anywhere a regular instruction can.

\[\begin{split}\begin{array}{lllll} \def\mathdef1753#1{{}}\mathdef1753{instruction} & \def\mathdef2016#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2016{(}~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~\def\mathdef2017#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2017{)} &\equiv\quad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}} \\ & \def\mathdef2018#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2018{(}~\def\mathdef2019#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2019{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2020#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2020{)} &\equiv\quad \def\mathdef2021#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2021{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2022#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2022{end} \\ & \def\mathdef2023#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2023{(}~\def\mathdef2024#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2024{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2025#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2025{)} &\equiv\quad \def\mathdef2026#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2026{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2027#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2027{end} \\ & \def\mathdef2028#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2028{(}~\def\mathdef2029#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2029{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast &\hspace{-3ex} \def\mathdef2030#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2030{(}~\def\mathdef2031#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2031{then}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~\def\mathdef2032#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2032{)}~~\def\mathdef2033#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2033{(}~\def\mathdef2034#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2034{else}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast~\def\mathdef2035#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2035{)}^?~~\def\mathdef2036#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2036{)} \quad\equiv \\ &\qquad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\def\mathdef2037#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2037{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}} &\hspace{-1ex} \href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~~\def\mathdef2038#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2038{else}~~(\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast)^?~\def\mathdef2039#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2039{end} \\ \end{array}\end{split}\]

Note

For example, the instruction sequence

\[\mathtt{(local.get~\$x)~(i32.const~2)~i32.add~(i32.const~3)~i32.mul}\]

can be folded into

\[\mathtt{(i32.mul~(i32.add~(local.get~\$x)~(i32.const~2))~(i32.const~3))}\]

Folded instructions are solely syntactic sugar, no additional syntactic or type-based checking is implied.

Expressions

Expressions are written as instruction sequences. No explicit \(\def\mathdef2040#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2040{end}\) keyword is included, since they only occur in bracketed positions.

\[\begin{split}\begin{array}{llclll} \def\mathdef1753#1{{}}\mathdef1753{expression} & \href{../text/instructions.html#text-expr}{\mathtt{expr}} &::=& (\mathit{in}{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}})^\ast &\Rightarrow& \mathit{in}^\ast~\href{../syntax/instructions.html#syntax-instr-control}{\mathsf{end}} \\ \end{array}\end{split}\]