Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions document/core/exec/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion document/core/text/instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \\
Expand Down