diff --git a/document/core/exec/instructions.rst b/document/core/exec/instructions.rst index d564924912..ee21271f86 100644 --- a/document/core/exec/instructions.rst +++ b/document/core/exec/instructions.rst @@ -372,6 +372,14 @@ Variable Instructions Memory Instructions ~~~~~~~~~~~~~~~~~~~ +.. note:: + The alignment :math:`\memarg.\ALIGN` in load and store instructions does not affect the semantics. + It is an indication that the offset :math:`\X{ea}` at which the memory is accessed is intended to satisfy the property :math:`\X{ea} \mod 2^{\memarg.\ALIGN} = 0`. + A WebAssembly implementation can use this hint to optimize for the intended use. + Unaligned access violating that property is still allowed and must succeed regardless of the annotation. + However, it may be substantially slower on some hardware. + + .. _exec-load: .. _exec-loadn: @@ -447,11 +455,6 @@ Memory Instructions (\otherwise) \\ \end{array} -.. note:: - The alignment :math:`\memarg.\ALIGN` does not affect the semantics. - Unaligned access is supported for all types, and succeeds regardless of the annotation. - The only purpose of the annotation is to provide optimizatons hints. - .. _exec-store: .. _exec-storen: diff --git a/document/core/text/instructions.rst b/document/core/text/instructions.rst index d2caf58d9d..f95c590ea1 100644 --- a/document/core/text/instructions.rst +++ b/document/core/text/instructions.rst @@ -179,7 +179,7 @@ Lexically, an |Toffset| or |Talign| phrase is considered a single :ref:`keyword .. math:: \begin{array}{llclll} \production{memory argument} & \Tmemarg_N &::=& - o{:}\Toffset~~a{:}\Talign_N &\Rightarrow& \{ \ALIGN~a,~\OFFSET~o \} \\ + o{:}\Toffset~~a{:}\Talign_N &\Rightarrow& \{ \ALIGN~n,~\OFFSET~o \} & (\iff a = 2^n) \\ \production{memory offset} & \Toffset &::=& \text{offset{=}}o{:}\Tu32 &\Rightarrow& o \\ &&|& \epsilon &\Rightarrow& 0 \\