Instructions

Instructions are syntactically distinguished into plain and structured instructions.

\[\begin{split}\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{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\mathdef1823#1{{}}\mathdef1823{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.

Their block type is given as a type use, analogous to the type of functions. However, the special case of a type use that is syntactically empty or consists of only a single result is not regarded as an abbreviation for an inline function type, but is parsed directly into an optional value type.

\[\begin{split}\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{block type} & \href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}_I & \begin{array}[t]{@{}c@{}} ::= \\ | \\ \end{array} & \begin{array}[t]{@{}lcll@{}} (t{:}\href{../text/types.html#text-functype}{\mathtt{result}})^? &\Rightarrow& t^? \\ x,I'{:}\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}}_I &\Rightarrow& x & (\mathrel{\mbox{if}} I' = \{\}) \\ \end{array} \\ \def\mathdef1823#1{{}}\mathdef1823{block instruction} & \href{../text/instructions.html#text-blockinstr}{\mathtt{blockinstr}}_I &::=& \def\mathdef1860#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1860{block}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{bt}{:}\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~(\mathit{in}{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1861#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1861{end}~~\href{../text/values.html#text-id}{\mathtt{id}}^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{block}}~\mathit{bt}~\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\mathdef1862#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1862{loop}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{bt}{:}\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~(\mathit{in}{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1863#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1863{end}~~\href{../text/values.html#text-id}{\mathtt{id}}^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{loop}}~\mathit{bt}~\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\mathdef1864#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1864{if}~~I'{:}\href{../text/instructions.html#text-label}{\mathtt{label}}_I~~\mathit{bt}{:}\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~(\mathit{in}_1{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~ \def\mathdef1865#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1865{else}~~\href{../text/values.html#text-id}{\mathtt{id}}_1^?~~(\mathit{in}_2{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1866#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1866{end}~~\href{../text/values.html#text-id}{\mathtt{id}}_2^? \\ &&&\qquad \Rightarrow\quad \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{if}}~\mathit{bt}~\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}\]

Note

The side condition stating that the identifier context \(I'\) must be empty in the rule for \(\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}}\) block types enforces that no identifier can be bound in any \(\href{../text/types.html#text-functype}{\mathtt{param}}\) declaration for a block type.

All other control instruction are represented verbatim.

\[\begin{split}\begin{array}{llcllll} \def\mathdef1823#1{{}}\mathdef1823{plain instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \def\mathdef1867#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1867{unreachable} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{unreachable}} \\ &&|& \def\mathdef1868#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1868{nop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{nop}} \\ &&|& \def\mathdef1869#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1869{br}~~l{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br}}~l \\ &&|& \def\mathdef1870#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1870{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\mathdef1871#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1871{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\mathdef1872#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1872{return} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{return}} \\ &&|& \def\mathdef1873#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1873{call}~~x{:}\href{../text/modules.html#text-funcidx}{\mathtt{funcidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call}}~x \\ &&|& \def\mathdef1874#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1874{call\_indirect}~~x,I'{:}\href{../text/modules.html#text-typeuse}{\mathtt{typeuse}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call\_indirect}}~x & (\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\mathdef1875#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1875{else}\) keyword of an \(\def\mathdef1876#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1876{if}\) instruction can be omitted if the following instruction sequence is empty.

\[\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{block instruction} & \def\mathdef1877#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1877{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef1878#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1878{end} &\equiv& \def\mathdef1879#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1879{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef1880#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1880{else}~~\def\mathdef1881#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1881{end} \end{array}\]

Parametric Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1882#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1882{drop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-parametric}{\mathsf{drop}} \\ &&|& \def\mathdef1883#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1883{select} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-parametric}{\mathsf{select}} \\ \end{array}\end{split}\]

Variable Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1884#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1884{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\mathdef1885#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1885{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\mathdef1886#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1886{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\mathdef1887#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1887{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\mathdef1888#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1888{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}{llcllll} \def\mathdef1823#1{{}}\mathdef1823{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1889#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1889{table.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.copy}} \\ &&|& \def\mathdef1890#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1890{table.init}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.init}}~x \\ &&|& \def\mathdef1891#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1891{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}\]

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\mathdef1892#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1892{=}\).

\[\begin{split}\begin{array}{llcllll} \def\mathdef1823#1{{}}\mathdef1823{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\mathdef1823#1{{}}\mathdef1823{memory offset} & \href{../text/instructions.html#text-memarg}{\mathtt{offset}} &::=& \def\mathdef1893#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1893{offset{=}}o{:}\href{../text/values.html#text-int}{\def\mathdef1848#1{{\mathtt{u}#1}}\mathdef1848{\mathtt{32}}} &\Rightarrow& o \\ &&|& \epsilon &\Rightarrow& 0 \\ \def\mathdef1823#1{{}}\mathdef1823{memory alignment} & \href{../text/instructions.html#text-memarg}{\mathtt{align}}_N &::=& \def\mathdef1894#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1894{align{=}}a{:}\href{../text/values.html#text-int}{\def\mathdef1848#1{{\mathtt{u}#1}}\mathdef1848{\mathtt{32}}} &\Rightarrow& a \\ &&|& \epsilon &\Rightarrow& N \\ \def\mathdef1823#1{{}}\mathdef1823{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1895#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1895{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\mathdef1896#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1896{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\mathdef1897#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1897{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\mathdef1898#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1898{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\mathdef1899#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1899{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\mathdef1900#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1900{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\mathdef1901#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1901{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\mathdef1902#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1902{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\mathdef1903#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1903{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\mathdef1904#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1904{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\mathdef1905#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1905{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\mathdef1906#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1906{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\mathdef1907#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1907{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\mathdef1908#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1908{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\mathdef1909#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1909{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\mathdef1910#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1910{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\mathdef1911#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1911{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\mathdef1912#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1912{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\mathdef1913#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1913{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\mathdef1914#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1914{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\mathdef1915#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1915{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\mathdef1916#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1916{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\mathdef1917#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1917{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\mathdef1918#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1918{memory.size} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.size}} \\ &&|& \def\mathdef1919#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1919{memory.grow} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.grow}} \\ &&|& \def\mathdef1920#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1920{memory.fill} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.fill}} \\ &&|& \def\mathdef1921#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1921{memory.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.copy}} \\ &&|& \def\mathdef1922#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1922{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\mathdef1923#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1923{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\mathdef1823#1{{}}\mathdef1823{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\&&|& \def\mathdef1924#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1924{i32.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1854#1{{\mathtt{i}#1}}\mathdef1854{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1925#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1925{i64.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1855#1{{\mathtt{i}#1}}\mathdef1855{\mathtt{64}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1926#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1926{f32.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1858#1{{\mathtt{f}#1}}\mathdef1858{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~z \\ &&|& \def\mathdef1927#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1927{f64.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1859#1{{\mathtt{f}#1}}\mathdef1859{\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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1928#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1928{i32.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef1929#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1929{i32.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef1930#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1930{i32.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef1931#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1931{i32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1932#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1932{i32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1933#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1933{i32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1934#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1934{i32.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef1935#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1935{i32.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef1936#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1936{i32.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef1937#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1937{i32.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef1938#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1938{i32.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef1939#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1939{i32.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef1940#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1940{i32.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef1941#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1941{i32.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef1942#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1942{i32.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef1943#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1943{i32.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef1944#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1944{i32.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef1945#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1945{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1946#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1946{i64.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef1947#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1947{i64.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef1948#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1948{i64.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef1949#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1949{i64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1950#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1950{i64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1951#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1951{i64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1952#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1952{i64.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef1953#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1953{i64.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef1954#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1954{i64.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef1955#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1955{i64.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef1956#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1956{i64.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef1957#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1957{i64.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef1958#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1958{i64.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef1959#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1959{i64.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef1960#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1960{i64.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef1961#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1961{i64.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef1962#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1962{i64.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef1963#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1963{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1964#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1964{f32.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef1965#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1965{f32.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef1966#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1966{f32.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef1967#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1967{f32.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef1968#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1968{f32.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef1969#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1969{f32.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef1970#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1970{f32.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef1971#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1971{f32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1972#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1972{f32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1973#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1973{f32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1974#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1974{f32.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef1975#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1975{f32.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef1976#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1976{f32.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef1977#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1977{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1978#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1978{f64.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef1979#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1979{f64.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef1980#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1980{f64.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef1981#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1981{f64.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef1982#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1982{f64.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef1983#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1983{f64.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef1984#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1984{f64.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef1985#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1985{f64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1986#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1986{f64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1987#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1987{f64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1988#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1988{f64.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef1989#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1989{f64.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef1990#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1990{f64.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef1991#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1991{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1992#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1992{i32.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef1993#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1993{i32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef1994#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1994{i32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef1995#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1995{i32.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef1996#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1996{i32.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef1997#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1997{i32.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef1998#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1998{i32.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef1999#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1999{i32.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2000#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2000{i32.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2001#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2001{i32.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2002#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2002{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2003#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2003{i64.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef2004#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2004{i64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2005#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2005{i64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2006#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2006{i64.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef2007#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2007{i64.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef2008#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2008{i64.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef2009#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2009{i64.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef2010#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2010{i64.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2011#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2011{i64.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2012#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2012{i64.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2013#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2013{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2014#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2014{f32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2015#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2015{f32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2016#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2016{f32.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2017#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2017{f32.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2018#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2018{f32.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2019#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2019{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2020#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2020{f64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2021#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2021{f64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2022#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2022{f64.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2023#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2023{f64.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2024#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2024{f64.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2025#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2025{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\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2026#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2026{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\mathdef2027#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2027{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\mathdef2028#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2028{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\mathdef2029#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2029{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\mathdef2030#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2030{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\mathdef2031#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2031{i32.trunc\_sat\_f32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_s} \\ &&|& \def\mathdef2032#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2032{i32.trunc\_sat\_f32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_u} \\ &&|& \def\mathdef2033#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2033{i32.trunc\_sat\_f64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_s} \\ &&|& \def\mathdef2034#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2034{i32.trunc\_sat\_f64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_u} \\ &&|& \def\mathdef2035#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2035{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\mathdef2036#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2036{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\mathdef2037#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2037{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\mathdef2038#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2038{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\mathdef2039#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2039{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\mathdef2040#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2040{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\mathdef2041#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2041{i64.trunc\_sat\_f32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_s} \\ &&|& \def\mathdef2042#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2042{i64.trunc\_sat\_f32\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}\mathsf{\_u} \\ &&|& \def\mathdef2043#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2043{i64.trunc\_sat\_f64\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_s} \\ &&|& \def\mathdef2044#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2044{i64.trunc\_sat\_f64\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_sat\_}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}\mathsf{\_u} \\ &&|& \def\mathdef2045#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2045{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\mathdef2046#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2046{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\mathdef2047#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2047{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\mathdef2048#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2048{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\mathdef2049#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2049{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\mathdef2050#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2050{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\mathdef2051#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2051{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\mathdef2052#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2052{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\mathdef2053#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2053{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\mathdef2054#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2054{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\mathdef2055#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2055{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\mathdef2056#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2056{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\mathdef2057#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2057{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\mathdef2058#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2058{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}\]
\[\begin{split}\begin{array}{llclll} \phantom{\def\mathdef1823#1{{}}\mathdef1823{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2059#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2059{i32.extend8\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{8\_s} \\ &&|& \def\mathdef2060#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2060{i32.extend16\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{16\_s} \\ &&|& \def\mathdef2061#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2061{i64.extend8\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{8\_s} \\ &&|& \def\mathdef2062#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2062{i64.extend16\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{16\_s} \\ &&|& \def\mathdef2063#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2063{i64.extend32\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{32\_s} \\ \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\mathdef2064#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2064{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\mathdef2065#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2065{then}\) and \(\def\mathdef2066#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2066{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\mathdef1823#1{{}}\mathdef1823{instruction} & \def\mathdef2067#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2067{(}~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~\def\mathdef2068#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2068{)} &\equiv\quad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}} \\ & \def\mathdef2069#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2069{(}~\def\mathdef2070#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2070{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2071#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2071{)} &\equiv\quad \def\mathdef2072#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2072{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2073#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2073{end} \\ & \def\mathdef2074#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2074{(}~\def\mathdef2075#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2075{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2076#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2076{)} &\equiv\quad \def\mathdef2077#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2077{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2078#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2078{end} \\ & \def\mathdef2079#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2079{(}~\def\mathdef2080#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2080{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast &\hspace{-3ex} \def\mathdef2081#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2081{(}~\def\mathdef2082#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2082{then}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~\def\mathdef2083#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2083{)}~~\def\mathdef2084#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2084{(}~\def\mathdef2085#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2085{else}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast~\def\mathdef2086#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2086{)}^?~~\def\mathdef2087#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2087{)} \quad\equiv \\ &\qquad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\def\mathdef2088#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2088{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/instructions.html#text-blocktype}{\mathtt{blocktype}} &\hspace{-1ex} \href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~~\def\mathdef2089#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2089{else}~~(\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast)^?~\def\mathdef2090#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2090{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\mathdef2091#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2091{end}\) keyword is included, since they only occur in bracketed positions.

\[\begin{split}\begin{array}{llclll} \def\mathdef1823#1{{}}\mathdef1823{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}\]