Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit b19cbf3

Browse files
AndrewScheideckerbinji
authored andcommitted
Add a second placeholder zero to the encoding of memory.copy and table.copy. (#29)
This would make it simpler to extend those instructions to support multiple memories/tables, and copying between different memories/tables. The current encoding has a single placeholder zero byte for those instructions, which allows extension to multiple memories/tables, but would require a more complicated encoding to add two immediate indices.
1 parent d6d2c1f commit b19cbf3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

document/core/binary/instructions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Each variant of :ref:`memory instruction <syntax-instr-memory>` is encoded with
163163
\hex{40}~~\hex{00} &\Rightarrow& \MEMORYGROW \\ &&|&
164164
\hex{FC}~\hex{08}~~\hex{00}~x{:}\Bdataidx &\Rightarrow& \MEMORYINIT~x \\ &&|&
165165
\hex{FC}~\hex{09}~~x{:}\Bdataidx &\Rightarrow& \MEMORYDROP~x \\ &&|&
166-
\hex{FC}~\hex{0A}~~\hex{00} &\Rightarrow& \MEMORYCOPY \\ &&|&
166+
\hex{FC}~\hex{0A}~~\hex{00}~~\hex{00} &\Rightarrow& \MEMORYCOPY \\ &&|&
167167
\hex{FC}~\hex{0B}~~\hex{00} &\Rightarrow& \MEMORYFILL \\
168168
\end{array}
169169
@@ -185,11 +185,11 @@ Each variant of :ref:`table instruction <syntax-instr-table>` is encoded with a
185185
\production{instruction} & \Binstr &::=& \dots \\ &&|&
186186
\hex{FC}~\hex{0C}~~\hex{00}~x{:}\Belemidx &\Rightarrow& \TABLEINIT~x \\ &&|&
187187
\hex{FC}~\hex{0D}~~x{:}\Belemidx &\Rightarrow& \TABLEDROP~x \\ &&|&
188-
\hex{FC}~\hex{0E}~~\hex{00} &\Rightarrow& \TABLECOPY \\
188+
\hex{FC}~\hex{0E}~~\hex{00}~~\hex{00} &\Rightarrow& \TABLECOPY \\
189189
\end{array}
190190
191191
.. note::
192-
In future versions of WebAssembly, the additional zero byte occurring in the encoding of the |TABLECOPY| instruction may be used to index an additional table.
192+
In future versions of WebAssembly, the additional zero bytes occurring in the encoding of the |TABLECOPY| instruction may be used to index additional tables.
193193

194194

195195
.. index:: numeric instruction

0 commit comments

Comments
 (0)