Instructions

Instructions are syntactically distinguished into plain and structured instructions.

\[\begin{split}\begin{array}{llclll} \def\mathdef1855#1{{}}\mathdef1855{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\mathdef1855#1{{}}\mathdef1855{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\mathdef1855#1{{}}\mathdef1855{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\mathdef1855#1{{}}\mathdef1855{block instruction} & \href{../text/instructions.html#text-blockinstr}{\mathtt{blockinstr}}_I &::=& \def\mathdef1892#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1892{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\mathdef1893#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1893{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\mathdef1894#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1894{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\mathdef1895#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1895{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\mathdef1896#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1896{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\mathdef1897#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1897{else}~~\href{../text/values.html#text-id}{\mathtt{id}}_1^?~~(\mathit{in}_2{:}\href{../text/instructions.html#text-instr}{\mathtt{instr}}_{I'})^\ast~~\def\mathdef1898#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1898{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\mathdef1855#1{{}}\mathdef1855{plain instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \def\mathdef1899#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1899{unreachable} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{unreachable}} \\ &&|& \def\mathdef1900#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1900{nop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{nop}} \\ &&|& \def\mathdef1901#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1901{br}~~l{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br}}~l \\ &&|& \def\mathdef1902#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1902{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\mathdef1903#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1903{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\mathdef1904#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1904{return} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{return}} \\ &&|& \def\mathdef1905#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1905{call}~~x{:}\href{../text/modules.html#text-funcidx}{\mathtt{funcidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call}}~x \\ &&|& \def\mathdef1906#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1906{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\mathdef1907#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1907{else}\) keyword of an \(\def\mathdef1908#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1908{if}\) instruction can be omitted if the following instruction sequence is empty.

\[\begin{array}{llclll} \def\mathdef1855#1{{}}\mathdef1855{block instruction} & \def\mathdef1909#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1909{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\mathdef1910#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1910{end} &\equiv& \def\mathdef1911#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1911{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\mathdef1912#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1912{else}~~\def\mathdef1913#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1913{end} \end{array}\]

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

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

Reference Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1917#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1917{ref.null}~~t{:}\href{../text/types.html#text-heaptype}{\mathtt{heaptype}} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-ref}{\mathsf{ref{.}null}}~t \\ &&|& \def\mathdef1918#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1918{ref.is\_null} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-ref}{\mathsf{ref{.}is\_null}} \\ &&|& \def\mathdef1919#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1919{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\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1920#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1920{drop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-parametric}{\mathsf{drop}} \\ &&|& \def\mathdef1921#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1921{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\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1922#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1922{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\mathdef1923#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1923{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\mathdef1924#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1924{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\mathdef1925#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1925{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\mathdef1926#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1926{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\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1927#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1927{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\mathdef1928#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1928{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\mathdef1929#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1929{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\mathdef1930#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1930{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\mathdef1931#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1931{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\mathdef1932#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1932{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\mathdef1933#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1933{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\mathdef1934#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1934{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\mathdef1855#1{{}}\mathdef1855{instruction} & \def\mathdef1935#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1935{table.get} &\equiv& \def\mathdef1936#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1936{table.get}~~\def\mathdef1937#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1937{0} \\ &&|& \def\mathdef1938#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1938{table.set} &\equiv& \def\mathdef1939#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1939{table.set}~~\def\mathdef1940#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1940{0} \\ &&|& \def\mathdef1941#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1941{table.size} &\equiv& \def\mathdef1942#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1942{table.size}~~\def\mathdef1943#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1943{0} \\ &&|& \def\mathdef1944#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1944{table.grow} &\equiv& \def\mathdef1945#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1945{table.grow}~~\def\mathdef1946#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1946{0} \\ &&|& \def\mathdef1947#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1947{table.fill} &\equiv& \def\mathdef1948#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1948{table.fill}~~\def\mathdef1949#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1949{0} \\ &&|& \def\mathdef1950#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1950{table.copy} &\equiv& \def\mathdef1951#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1951{table.copy}~~\def\mathdef1952#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1952{0}~~\def\mathdef1953#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1953{0} \\ &&|& \def\mathdef1954#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1954{table.init}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\equiv& \def\mathdef1955#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1955{table.init}~~\def\mathdef1956#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1956{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\mathdef1957#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1957{=}\).

\[\begin{split}\begin{array}{llcllll} \def\mathdef1855#1{{}}\mathdef1855{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\mathdef1855#1{{}}\mathdef1855{memory offset} & \href{../text/instructions.html#text-memarg}{\mathtt{offset}} &::=& \def\mathdef1958#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1958{offset{=}}o{:}\href{../text/values.html#text-int}{\def\mathdef1880#1{{\mathtt{u}#1}}\mathdef1880{\mathtt{32}}} &\Rightarrow& o \\ &&|& \epsilon &\Rightarrow& 0 \\ \def\mathdef1855#1{{}}\mathdef1855{memory alignment} & \href{../text/instructions.html#text-memarg}{\mathtt{align}}_N &::=& \def\mathdef1959#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1959{align{=}}a{:}\href{../text/values.html#text-int}{\def\mathdef1880#1{{\mathtt{u}#1}}\mathdef1880{\mathtt{32}}} &\Rightarrow& a \\ &&|& \epsilon &\Rightarrow& N \\ \def\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef1960#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1960{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\mathdef1961#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1961{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\mathdef1962#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1962{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\mathdef1963#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1963{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\mathdef1964#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1964{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\mathdef1965#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1965{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\mathdef1966#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1966{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\mathdef1967#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1967{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\mathdef1968#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1968{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\mathdef1969#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1969{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\mathdef1970#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1970{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\mathdef1971#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1971{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\mathdef1972#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1972{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\mathdef1973#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1973{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\mathdef1974#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1974{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\mathdef1975#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1975{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\mathdef1976#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1976{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\mathdef1977#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1977{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\mathdef1978#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1978{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\mathdef1979#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1979{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\mathdef1980#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1980{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\mathdef1981#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1981{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\mathdef1982#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1982{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\mathdef1983#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1983{memory.size} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.size}} \\ &&|& \def\mathdef1984#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1984{memory.grow} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.grow}} \\ &&|& \def\mathdef1985#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1985{memory.fill} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.fill}} \\ &&|& \def\mathdef1986#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1986{memory.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.copy}} \\ &&|& \def\mathdef1987#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1987{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\mathdef1988#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1988{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\mathdef1855#1{{}}\mathdef1855{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\&&|& \def\mathdef1989#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1989{i32.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1886#1{{\mathtt{i}#1}}\mathdef1886{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1990#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1990{i64.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef1887#1{{\mathtt{i}#1}}\mathdef1887{\mathtt{64}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef1991#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1991{f32.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1890#1{{\mathtt{f}#1}}\mathdef1890{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~z \\ &&|& \def\mathdef1992#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1992{f64.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef1891#1{{\mathtt{f}#1}}\mathdef1891{\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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef1993#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1993{i32.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef1994#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1994{i32.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef1995#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1995{i32.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef1996#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1996{i32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef1997#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1997{i32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef1998#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1998{i32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef1999#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef1999{i32.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef2000#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2000{i32.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef2001#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2001{i32.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef2002#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2002{i32.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef2003#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2003{i32.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef2004#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2004{i32.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef2005#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2005{i32.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef2006#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2006{i32.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef2007#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2007{i32.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef2008#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2008{i32.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef2009#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2009{i32.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef2010#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2010{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2011#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2011{i64.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef2012#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2012{i64.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef2013#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2013{i64.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef2014#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2014{i64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2015#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2015{i64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2016#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2016{i64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2017#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2017{i64.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef2018#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2018{i64.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef2019#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2019{i64.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef2020#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2020{i64.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef2021#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2021{i64.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef2022#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2022{i64.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef2023#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2023{i64.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef2024#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2024{i64.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef2025#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2025{i64.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef2026#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2026{i64.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef2027#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2027{i64.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef2028#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2028{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2029#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2029{f32.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef2030#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2030{f32.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef2031#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2031{f32.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef2032#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2032{f32.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef2033#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2033{f32.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef2034#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2034{f32.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef2035#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2035{f32.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef2036#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2036{f32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2037#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2037{f32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2038#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2038{f32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2039#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2039{f32.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef2040#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2040{f32.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef2041#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2041{f32.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef2042#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2042{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2043#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2043{f64.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef2044#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2044{f64.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef2045#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2045{f64.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef2046#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2046{f64.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef2047#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2047{f64.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef2048#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2048{f64.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef2049#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2049{f64.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef2050#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2050{f64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2051#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2051{f64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2052#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2052{f64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2053#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2053{f64.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef2054#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2054{f64.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef2055#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2055{f64.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef2056#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2056{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2057#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2057{i32.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef2058#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2058{i32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2059#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2059{i32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2060#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2060{i32.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef2061#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2061{i32.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef2062#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2062{i32.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef2063#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2063{i32.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef2064#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2064{i32.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2065#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2065{i32.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2066#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2066{i32.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2067#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2067{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2068#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2068{i64.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef2069#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2069{i64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2070#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2070{i64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2071#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2071{i64.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef2072#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2072{i64.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef2073#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2073{i64.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef2074#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2074{i64.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef2075#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2075{i64.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2076#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2076{i64.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2077#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2077{i64.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2078#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2078{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2079#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2079{f32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2080#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2080{f32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2081#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2081{f32.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2082#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2082{f32.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2083#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2083{f32.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2084#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2084{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2085#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2085{f64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2086#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2086{f64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2087#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2087{f64.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2088#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2088{f64.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2089#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2089{f64.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2090#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2090{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2091#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2091{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\mathdef2092#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2092{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\mathdef2093#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2093{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\mathdef2094#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2094{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\mathdef2095#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2095{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\mathdef2096#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2096{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\mathdef2097#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2097{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\mathdef2098#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2098{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\mathdef2099#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2099{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\mathdef2100#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2100{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\mathdef2101#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2101{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\mathdef2102#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2102{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\mathdef2103#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2103{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\mathdef2104#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2104{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\mathdef2105#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2105{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\mathdef2106#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2106{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\mathdef2107#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2107{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\mathdef2108#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2108{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\mathdef2109#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2109{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\mathdef2110#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2110{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\mathdef2111#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2111{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\mathdef2112#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2112{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\mathdef2113#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2113{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\mathdef2114#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2114{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\mathdef2115#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2115{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\mathdef2116#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2116{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\mathdef2117#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2117{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\mathdef2118#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2118{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\mathdef2119#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2119{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\mathdef2120#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2120{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\mathdef2121#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2121{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\mathdef2122#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2122{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\mathdef2123#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2123{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\mathdef1855#1{{}}\mathdef1855{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2124#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2124{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\mathdef2125#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2125{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\mathdef2126#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2126{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\mathdef2127#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2127{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\mathdef2128#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2128{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\mathdef2129#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2129{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\mathdef2130#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2130{then}\) and \(\def\mathdef2131#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2131{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\mathdef1855#1{{}}\mathdef1855{instruction} & \def\mathdef2132#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2132{(}~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~\def\mathdef2133#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2133{)} &\equiv\quad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}} \\ & \def\mathdef2134#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2134{(}~\def\mathdef2135#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2135{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\mathdef2136#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2136{)} &\equiv\quad \def\mathdef2137#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2137{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\mathdef2138#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2138{end} \\ & \def\mathdef2139#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2139{(}~\def\mathdef2140#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2140{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\mathdef2141#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2141{)} &\equiv\quad \def\mathdef2142#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2142{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\mathdef2143#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2143{end} \\ & \def\mathdef2144#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2144{(}~\def\mathdef2145#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2145{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\mathdef2146#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2146{(}~\def\mathdef2147#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2147{then}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~\def\mathdef2148#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2148{)}~~\def\mathdef2149#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2149{(}~\def\mathdef2150#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2150{else}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast~\def\mathdef2151#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2151{)}^?~~\def\mathdef2152#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2152{)} \quad\equiv \\ &\qquad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\def\mathdef2153#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2153{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\mathdef2154#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2154{else}~~(\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast)^?~\def\mathdef2155#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2155{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\mathdef2156#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2156{end}\) keyword is included, since they only occur in bracketed positions.

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