Instructions

Instructions are syntactically distinguished into plain and structured instructions.

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

Note

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

Control Instructions

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

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

All other control instruction are represented verbatim.

\[\begin{split}\begin{array}{llcllll} \def\mathdef2390#1{{}}\mathdef2390{plain instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \def\mathdef2454#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2454{unreachable} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{unreachable}} \\ &&|& \def\mathdef2455#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2455{nop} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{nop}} \\ &&|& \def\mathdef2456#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2456{br}~~l{:}\href{../text/modules.html#text-labelidx}{\mathtt{labelidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{br}}~l \\ &&|& \def\mathdef2457#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2457{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\mathdef2458#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2458{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\mathdef2459#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2459{return} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{return}} \\ &&|& \def\mathdef2460#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2460{call}~~x{:}\href{../text/modules.html#text-funcidx}{\mathtt{funcidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-control}{\mathsf{call}}~x \\ &&|& \def\mathdef2461#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2461{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\mathdef2462#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2462{else}\) keyword of an \(\def\mathdef2463#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2463{if}\) instruction can be omitted if the following instruction sequence is empty.

\[\begin{array}{llclll} \def\mathdef2390#1{{}}\mathdef2390{block instruction} & \def\mathdef2464#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2464{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2465#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2465{end} &\equiv& \def\mathdef2466#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2466{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2467#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2467{else}~~\def\mathdef2468#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2468{end} \end{array}\]

Parametric Instructions

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

Variable Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef2390#1{{}}\mathdef2390{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef2471#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2471{get\_local}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{get\_local}}~x \\ &&|& \def\mathdef2472#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2472{set\_local}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{set\_local}}~x \\ &&|& \def\mathdef2473#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2473{tee\_local}~~x{:}\href{../text/modules.html#text-localidx}{\mathtt{localidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{tee\_local}}~x \\ &&|& \def\mathdef2474#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2474{get\_global}~~x{:}\href{../text/modules.html#text-globalidx}{\mathtt{globalidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{get\_global}}~x \\ &&|& \def\mathdef2475#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2475{set\_global}~~x{:}\href{../text/modules.html#text-globalidx}{\mathtt{globalidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-variable}{\mathsf{set\_global}}~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\mathdef2476#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2476{=}\).

\[\begin{split}\begin{array}{llcllll} \def\mathdef2390#1{{}}\mathdef2390{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\mathdef2390#1{{}}\mathdef2390{memory offset} & \href{../text/instructions.html#text-memarg}{\mathtt{offset}} &::=& \def\mathdef2477#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2477{offset{=}}o{:}\href{../text/values.html#text-int}{\def\mathdef2435#1{{\mathtt{u}#1}}\mathdef2435{\mathtt{32}}} &\Rightarrow& o \\ &&|& \epsilon &\Rightarrow& 0 \\ \def\mathdef2390#1{{}}\mathdef2390{memory alignment} & \href{../text/instructions.html#text-memarg}{\mathtt{align}}_N &::=& \def\mathdef2478#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2478{align{=}}a{:}\href{../text/values.html#text-int}{\def\mathdef2435#1{{\mathtt{u}#1}}\mathdef2435{\mathtt{32}}} &\Rightarrow& a \\ &&|& \epsilon &\Rightarrow& N \\ \def\mathdef2390#1{{}}\mathdef2390{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef2479#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2479{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\mathdef2480#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2480{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\mathdef2481#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2481{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\mathdef2482#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2482{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\mathdef2483#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2483{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\mathdef2484#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2484{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\mathdef2485#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2485{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\mathdef2486#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2486{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\mathdef2487#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2487{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\mathdef2488#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2488{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\mathdef2489#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2489{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\mathdef2490#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2490{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\mathdef2491#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2491{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\mathdef2492#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2492{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\mathdef2493#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2493{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\mathdef2494#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2494{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\mathdef2495#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2495{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\mathdef2496#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2496{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\mathdef2497#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2497{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\mathdef2498#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2498{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\mathdef2499#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2499{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\mathdef2500#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2500{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\mathdef2501#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2501{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\mathdef2502#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2502{memory.size} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.size}} \\ &&|& \def\mathdef2503#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2503{memory.grow} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.grow}} \\ &&|& \def\mathdef2504#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2504{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\mathdef2505#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2505{memory.drop}~~x{:}\href{../text/modules.html#text-dataidx}{\mathtt{dataidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.drop}}~x \\ &&|& \def\mathdef2506#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2506{memory.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.copy}} \\ &&|& \def\mathdef2507#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2507{memory.fill} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-memory}{\mathsf{memory.fill}} \\ \end{array}\end{split}\]

Table Instructions

\[\begin{split}\begin{array}{llcllll} \def\mathdef2390#1{{}}\mathdef2390{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\ &&|& \def\mathdef2508#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2508{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\mathdef2509#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2509{table.drop}~~x{:}\href{../text/modules.html#text-elemidx}{\mathtt{elemidx}}_I &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.drop}}~x \\ &&|& \def\mathdef2510#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2510{table.copy} &\Rightarrow& \href{../syntax/instructions.html#syntax-instr-table}{\mathsf{table.copy}} \\ \end{array}\end{split}\]

Numeric Instructions

\[\begin{split}\begin{array}{llclll} \def\mathdef2390#1{{}}\mathdef2390{instruction} & \href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I &::=& \dots \\&&|& \def\mathdef2511#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2511{i32.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef2441#1{{\mathtt{i}#1}}\mathdef2441{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef2512#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2512{i64.const}~~n{:}\href{../text/values.html#text-int}{\def\mathdef2442#1{{\mathtt{i}#1}}\mathdef2442{\mathtt{64}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~n \\ &&|& \def\mathdef2513#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2513{f32.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef2445#1{{\mathtt{f}#1}}\mathdef2445{\mathtt{32}}} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{const}}~z \\ &&|& \def\mathdef2514#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2514{f64.const}~~z{:}\href{../text/values.html#text-float}{\def\mathdef2446#1{{\mathtt{f}#1}}\mathdef2446{\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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2515#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2515{i32.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef2516#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2516{i32.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef2517#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2517{i32.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef2518#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2518{i32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2519#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2519{i32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2520#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2520{i32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2521#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2521{i32.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef2522#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2522{i32.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef2523#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2523{i32.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef2524#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2524{i32.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef2525#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2525{i32.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef2526#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2526{i32.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef2527#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2527{i32.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef2528#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2528{i32.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef2529#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2529{i32.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef2530#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2530{i32.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef2531#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2531{i32.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef2532#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2532{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2533#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2533{i64.clz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{clz}} \\ &&|& \def\mathdef2534#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2534{i64.ctz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ctz}} \\ &&|& \def\mathdef2535#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2535{i64.popcnt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{popcnt}} \\ &&|& \def\mathdef2536#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2536{i64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2537#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2537{i64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2538#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2538{i64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2539#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2539{i64.div\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_s} \\ &&|& \def\mathdef2540#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2540{i64.div\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}}\mathsf{\_u} \\ &&|& \def\mathdef2541#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2541{i64.rem\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_s} \\ &&|& \def\mathdef2542#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2542{i64.rem\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rem}}\mathsf{\_u} \\ &&|& \def\mathdef2543#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2543{i64.and} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{and}} \\ &&|& \def\mathdef2544#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2544{i64.or} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{or}} \\ &&|& \def\mathdef2545#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2545{i64.xor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{xor}} \\ &&|& \def\mathdef2546#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2546{i64.shl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shl}} \\ &&|& \def\mathdef2547#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2547{i64.shr\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_s} \\ &&|& \def\mathdef2548#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2548{i64.shr\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{shr}}\mathsf{\_u} \\ &&|& \def\mathdef2549#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2549{i64.rotl} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{rotl}} \\ &&|& \def\mathdef2550#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2550{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2551#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2551{f32.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef2552#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2552{f32.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef2553#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2553{f32.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef2554#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2554{f32.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef2555#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2555{f32.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef2556#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2556{f32.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef2557#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2557{f32.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef2558#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2558{f32.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2559#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2559{f32.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2560#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2560{f32.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2561#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2561{f32.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef2562#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2562{f32.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef2563#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2563{f32.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef2564#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2564{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2565#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2565{f64.abs} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{abs}} \\ &&|& \def\mathdef2566#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2566{f64.neg} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{neg}} \\ &&|& \def\mathdef2567#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2567{f64.ceil} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ceil}} \\ &&|& \def\mathdef2568#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2568{f64.floor} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{floor}} \\ &&|& \def\mathdef2569#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2569{f64.trunc} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}} \\ &&|& \def\mathdef2570#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2570{f64.nearest} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{nearest}} \\ &&|& \def\mathdef2571#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2571{f64.sqrt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sqrt}} \\ &&|& \def\mathdef2572#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2572{f64.add} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{add}} \\ &&|& \def\mathdef2573#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2573{f64.sub} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{sub}} \\ &&|& \def\mathdef2574#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2574{f64.mul} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{mul}} \\ &&|& \def\mathdef2575#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2575{f64.div} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{div}} \\ &&|& \def\mathdef2576#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2576{f64.min} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{min}} \\ &&|& \def\mathdef2577#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2577{f64.max} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{max}} \\ &&|& \def\mathdef2578#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2578{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2579#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2579{i32.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef2580#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2580{i32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2581#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2581{i32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2582#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2582{i32.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef2583#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2583{i32.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef2584#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2584{i32.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef2585#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2585{i32.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef2586#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2586{i32.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2587#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2587{i32.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2588#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2588{i32.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2589#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2589{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2590#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2590{i64.eqz} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eqz}} \\ &&|& \def\mathdef2591#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2591{i64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2592#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2592{i64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2593#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2593{i64.lt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_s} \\ &&|& \def\mathdef2594#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2594{i64.lt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}}\mathsf{\_u} \\ &&|& \def\mathdef2595#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2595{i64.gt\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_s} \\ &&|& \def\mathdef2596#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2596{i64.gt\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}}\mathsf{\_u} \\ &&|& \def\mathdef2597#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2597{i64.le\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_s} \\ &&|& \def\mathdef2598#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2598{i64.le\_u} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}}\mathsf{\_u} \\ &&|& \def\mathdef2599#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2599{i64.ge\_s} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ge}}\mathsf{\_s} \\ &&|& \def\mathdef2600#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2600{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2601#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2601{f32.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2602#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2602{f32.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2603#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2603{f32.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2604#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2604{f32.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2605#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2605{f32.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2606#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2606{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2607#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2607{f64.eq} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{eq}} \\ &&|& \def\mathdef2608#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2608{f64.ne} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{ne}} \\ &&|& \def\mathdef2609#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2609{f64.lt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{lt}} \\ &&|& \def\mathdef2610#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2610{f64.gt} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{gt}} \\ &&|& \def\mathdef2611#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2611{f64.le} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{le}} \\ &&|& \def\mathdef2612#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2612{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\mathdef2390#1{{}}\mathdef2390{instruction}} & \phantom{\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}_I} &\phantom{::=}& \phantom{thisisenough} && \phantom{thisshouldbeenough} \\[-2ex] &&|& \def\mathdef2613#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2613{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\mathdef2614#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2614{i32.trunc\_s/f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2615#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2615{i32.trunc\_u/f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2616#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2616{i32.trunc\_s/f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2617#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2617{i32.trunc\_u/f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2618#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2618{i64.extend\_s/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2619#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2619{i64.extend\_u/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{extend}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2620#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2620{i64.trunc\_s/f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2621#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2621{i64.trunc\_u/f32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f32}} \\ &&|& \def\mathdef2622#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2622{i64.trunc\_s/f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2623#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2623{i64.trunc\_u/f64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{i64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{trunc}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{f64}} \\ &&|& \def\mathdef2624#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2624{f32.convert\_s/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2625#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2625{f32.convert\_u/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2626#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2626{f32.convert\_s/i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ &&|& \def\mathdef2627#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2627{f32.convert\_u/i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f32}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ &&|& \def\mathdef2628#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2628{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\mathdef2629#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2629{f64.convert\_s/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2630#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2630{f64.convert\_u/i32} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i32}} \\ &&|& \def\mathdef2631#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2631{f64.convert\_s/i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_s/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ &&|& \def\mathdef2632#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2632{f64.convert\_u/i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{convert}}\mathsf{\_u/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ &&|& \def\mathdef2633#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2633{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\mathdef2634#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2634{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\mathdef2635#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2635{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\mathdef2636#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2636{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\mathdef2637#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2637{f64.reinterpret/i64} &\Rightarrow& \href{../syntax/types.html#syntax-valtype}{\mathsf{f64}}.\href{../syntax/instructions.html#syntax-instr-numeric}{\mathsf{reinterpret}}\mathsf{/}\href{../syntax/types.html#syntax-valtype}{\mathsf{i64}} \\ \end{array}\end{split}\]

Folded Instructions

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

In the case of block instructions, the folded form omits the \(\def\mathdef2638#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2638{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\mathdef2639#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2639{then}\) and \(\def\mathdef2640#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2640{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\mathdef2390#1{{}}\mathdef2390{instruction} & \def\mathdef2641#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2641{(}~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~\def\mathdef2642#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2642{)} &\equiv\quad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\href{../text/instructions.html#text-plaininstr}{\mathtt{plaininstr}} \\ & \def\mathdef2643#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2643{(}~\def\mathdef2644#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2644{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2645#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2645{)} &\equiv\quad \def\mathdef2646#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2646{block}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2647#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2647{end} \\ & \def\mathdef2648#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2648{(}~\def\mathdef2649#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2649{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~\def\mathdef2650#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2650{)} &\equiv\quad \def\mathdef2651#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2651{loop}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}^\ast~~\def\mathdef2652#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2652{end} \\ & \def\mathdef2653#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2653{(}~\def\mathdef2654#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2654{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}}~~\href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast &\hspace{-3ex} \def\mathdef2655#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2655{(}~\def\mathdef2656#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2656{then}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~\def\mathdef2657#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2657{)}~~\def\mathdef2658#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2658{(}~\def\mathdef2659#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2659{else}~~\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast~\def\mathdef2660#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2660{)}^?~~\def\mathdef2661#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2661{)} \quad\equiv \\ &\qquad \href{../text/instructions.html#text-foldedinstr}{\mathtt{foldedinstr}}^\ast~~\def\mathdef2662#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2662{if}~~\href{../text/instructions.html#text-label}{\mathtt{label}}~~\href{../text/types.html#text-resulttype}{\mathtt{resulttype}} &\hspace{-1ex} \href{../text/instructions.html#text-instr}{\mathtt{instr}}_1^\ast~~\def\mathdef2663#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2663{else}~~(\href{../text/instructions.html#text-instr}{\mathtt{instr}}_2^\ast)^?~\def\mathdef2664#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2664{end} \\ \end{array}\end{split}\]

Note

For example, the instruction sequence

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

can be folded into

\[\mathtt{(i32.mul~(i32.add~(get\_local~\$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\mathdef2665#1{\mbox{‘}\mathtt{#1}\mbox{’}}\mathdef2665{end}\) keyword is included, since they only occur in bracketed positions.

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