From d7f0241fbf676ccf0b9686c87796ab11646b14ed Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 23 Mar 2020 11:25:48 -0700 Subject: [PATCH] Fix {memory,table}.init immediate order (#147) The data/elem index comes before the memory/table index. --- document/core/binary/instructions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/document/core/binary/instructions.rst b/document/core/binary/instructions.rst index b119b2e9..1e612781 100644 --- a/document/core/binary/instructions.rst +++ b/document/core/binary/instructions.rst @@ -122,7 +122,7 @@ Each variant of :ref:`table instruction ` is encoded with a .. math:: \begin{array}{llclll} \production{instruction} & \Binstr &::=& \dots \\ &&|& - \hex{FC}~\hex{0C}~~\hex{00}~x{:}\Belemidx &\Rightarrow& \TABLEINIT~x \\ &&|& + \hex{FC}~\hex{0C}~~x{:}\Belemidx~\hex{00} &\Rightarrow& \TABLEINIT~x \\ &&|& \hex{FC}~\hex{0D}~~x{:}\Belemidx &\Rightarrow& \ELEMDROP~x \\ &&|& \hex{FC}~\hex{0E}~~\hex{00}~~\hex{00} &\Rightarrow& \TABLECOPY \\ \end{array} @@ -182,7 +182,7 @@ Each variant of :ref:`memory instruction ` is encoded with \hex{3E}~~m{:}\Bmemarg &\Rightarrow& \I64.\STORE\K{32}~m \\ &&|& \hex{3F}~~\hex{00} &\Rightarrow& \MEMORYSIZE \\ &&|& \hex{40}~~\hex{00} &\Rightarrow& \MEMORYGROW \\ &&|& - \hex{FC}~\hex{08}~~\hex{00}~x{:}\Bdataidx &\Rightarrow& \MEMORYINIT~x \\ &&|& + \hex{FC}~\hex{08}~~x{:}\Bdataidx~\hex{00} &\Rightarrow& \MEMORYINIT~x \\ &&|& \hex{FC}~\hex{09}~~x{:}\Bdataidx &\Rightarrow& \DATADROP~x \\ &&|& \hex{FC}~\hex{0A}~~\hex{00}~~\hex{00} &\Rightarrow& \MEMORYCOPY \\ &&|& \hex{FC}~\hex{0B}~~\hex{00} &\Rightarrow& \MEMORYFILL \\