Conversation
| \production{data segment} & \Bdata &::=& | ||
| \hex{00}~~e{:}\Bexpr~~b^\ast{:}\Bvec(\Bbyte) | ||
| &\Rightarrow& \{ \DMEM~0, \DOFFSET~e, \DINIT~b^\ast \} \\ &&|& | ||
| &\Rightarrow& \{ \DINIT~b^\ast, \DMODE~\DACTIVE~\{ \DMEM~0, \DOFFSET~e \} \} \\ &&|& |
There was a problem hiding this comment.
Why does \DMEM map to data and not to memory?
There was a problem hiding this comment.
Sorry, can you elaborate?
There was a problem hiding this comment.
\DMEM indicates the memory index, so I would have expected the mode to be active {memory 0, offset e}. However, for some reason it is active {data 0, offset e}.
For element segments, it is active {table 0, offset e} and not active {elem 0, offset e}.
There was a problem hiding this comment.
Ah, you mean the macro is misdefined. Indeed, fixed!
document/core/text/modules.rst
Outdated
| \text{(}~\text{elem}~~\Tid^?~~\text{(}~\text{table}~~x{:}\Ttableidx_I ~\text{)}~~\text{(}~\text{offset}~~e{:}\Texpr_I~\text{)}~~(et, y^\ast){:}\Telemlist~\text{)} \\ &&& \qquad | ||
| \Rightarrow\quad \{ \ETYPE~et, \EINIT~y^\ast, \EMODE~\EACTIVE~\{ \ETABLE~x, \EOFFSET~e \} \} \\ | ||
| \production{element list} & \Telemlist &::=& | ||
| et{:}\Telemtype~~y^\ast{:}\Tvec(\Telemexpr_I) \qquad\Rightarrow\quad ( \ETYPE~et, \EINIT~y^\ast ) \\ &&|& |
There was a problem hiding this comment.
The &&|& at the end is a typo I think.
document/core/text/modules.rst
Outdated
| \text{(}~\text{elem}~~\text{(}~\text{offset}~~\Texpr_I~\text{)}~~\dots~\text{)} | ||
| \text{(}~\text{elem}~~\Tid^?~~\text{(}~\text{offset}~~\Texpr_I~\text{)}~~\Telemlist~\text{)} | ||
| &\equiv& | ||
| \text{(}~\text{elem}~~\Tid^?~~\text{(}~\text{table}~~\text{0}~\text{)}~~\text{(}~\text{offset}~~\Texpr_I~\text{)}~~\Telemlist~\text{)} |
There was a problem hiding this comment.
A \equiv is missing here. Also, can you put all clauses into separate lines?
There was a problem hiding this comment.
The \equiv is on the line before, but there was an \\ missing.
Added line wraps.
document/core/valid/modules.rst
Outdated
| .................................................... | ||
|
|
||
| * The memory :math:`C.\CMEMS[x]` must be defined in the context. | ||
| * The data mode :math:`\elemmode` must valid with type :math:`\segtype`. |
interpreter/binary/decode.ml
Outdated
| ref_func (at var s) | ||
|
|
||
| let elem_kind s = | ||
| match vs7 s with |
|
Still LGTM. I don't know if Ben can take a look, he is OOO until next year. |
|
Okay, since @binji seems unreachable I'm landing this in the interest of making progress with the spec. |
Refactor segment representation in AST (in both spec and interpreter) by separating out a
segment_mode.Other changes in Spec:
Other changes in Interpreter: