From 9632db5411c6812b4eb83c1397b1463fae442556 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Tue, 8 Mar 2016 19:13:09 -0600 Subject: Clarify alignment description --- BinaryEncoding.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'BinaryEncoding.md') 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 | -- cgit v1.2.3