diff options
| author | Luke Wagner <luke@mozilla.com> | 2016-03-08 19:13:09 -0600 |
|---|---|---|
| committer | Luke Wagner <luke@mozilla.com> | 2016-03-09 10:52:29 -0600 |
| commit | 9632db5411c6812b4eb83c1397b1463fae442556 (patch) | |
| tree | a9342c7e45549fe64f9d082c086b4727276b32e5 /BinaryEncoding.md | |
| parent | c6e52a487a81edd9ccdd7544bd96c367aff991ba (diff) | |
| download | nanowasm-design-9632db5411c6812b4eb83c1397b1463fae442556.tar.gz | |
Clarify alignment description
Diffstat (limited to 'BinaryEncoding.md')
| -rw-r--r-- | BinaryEncoding.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 03acda4..ad77763 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -387,9 +387,15 @@ The `memory_immediate` type is encoded as follows: | Name | Type | Description | | ---- | ---- | ---- | -| flags | `varuint32` | a bitfield currently only containing the alignment (less-or-equal than natural alignment, specified as a power of 2) for the `log2(access size)` least-significant bits | +| flags | `varuint32` | a bitfield which currently contains the alignment in the least significant bits, encoded as `log2(alignment)` | | offset | `varuint32` | the value of the offset | +As implied by the `log2(alignment)` encoding, the alignment must be a power of 2. +As an additional validation criteria, the alignment must be less or equal to +natural alignment. Thus, for any given memory access op, the bits after the +`log(memory-access-size)` least-significant bits can be used in the future +(e.g., for shared memory ordering requirements). + ## Simple operators ([described here](AstSemantics#32-bit-integer-operators)) | Name | Opcode | Immediate | Description | |
