Skip to content
Merged
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
6 changes: 6 additions & 0 deletions AstSemantics.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ Each linear memory access operation also has an immediate positive integer power
of 2 alignment attribute. An alignment value which is the same as the memory
attribute size is considered to be a *natural* alignment.

The linear memory operation names listed above specify natural alignment.
To specify unnatural alignment, the opcode name can be suffixed with `/n` for
`n` any integer power of 2. For example, `float64.load/2` specifies a `float32`
load with 2-byte alignment; `int32.load16_s/1` specifies a signed 2-byte load
that is unaligned (1-byte aligned).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a better fit for text format, since it's implicit in the bytecode format?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that you think this para should go in TextFormat.md? I kinda see that point, but opcode names are not just a detail of the text format; they also show up in the SExpr language as the names of AST nodes and will show up in the module local opcode table (which is part of the binary format). AstSemantics is sortof the central hub, so I think it makes sense for it to define the names of opcodes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but I see your point too. lgtm then :-)


The alignment applies to the effective address and not merely the address operand,
i.e. the immediate offset is taken into account when considering alignment.

Expand Down