This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Execution prose for bulk array operations#408
Merged
Conversation
Add execution prose for array.fill, array.copy, array.init_data, and array.init_elem. As a drive by consistency fix, also remove unnecessary parentheses around values in the prose for other GC instructions. These parentheses do not appear in the prose for any other instruction.
Member
Author
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
rossberg
reviewed
Jul 21, 2023
|
|
||
| 3. Assert: due to :ref:`validation <valid-array.init_data>`, :math:`\deftype` is an :ref:`array type <syntax-arraytype>`. | ||
|
|
||
| 4. Let :math:`\TARRAY~\X{ft}` be the :ref:`array type <syntax-arraytype>` :math:`\deftype`. (todo: unroll) |
Member
There was a problem hiding this comment.
This todo is elsewhere resolved in #406, you can copy from there. (Which also tweaks the wording of the previous bullet.)
|
|
||
| a. Trap. | ||
|
|
||
| 20. Let :math:`z` be the :ref:`bit width <bitwidth-fieldtype>` of :ref:`field type <syntax-fieldtype>` :math:`\X{ft}`. |
Member
There was a problem hiding this comment.
I just noticed that the bitwidth of course is in bits, so we need to divide by 8, here and in the formal rules, as well as for array.new_data. Could you fix both?
Also, this could use an assertion that the bitwidth actually is defined (because ft is not a reference).
|
|
||
| 24. Let :math:`t` be the :ref:`value type <syntax-valtype>` :math:`\unpacktype(\X{ft})`. | ||
|
|
||
| 25. Let :math:`c` be the constant for which :math:`\bytes_{\X{ft}}(k_i)` is :math:`b^\ast`. |
Member
There was a problem hiding this comment.
Same here, this is only defined because of validation.
|
|
||
| 3. Assert: due to :ref:`validation <valid-array.init_elem>`, :math:`\deftype` is an :ref:`array type <syntax-arraytype>`. | ||
|
|
||
| 4. Let :math:`\TARRAY~\X{ft}` be the :ref:`array type <syntax-arraytype>` :math:`\deftype`. (todo: unroll) |
Member
Author
|
Comments addressed. PTAL at the new assertions to see if they make sense. |
rossberg
approved these changes
Jul 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add execution prose for array.fill, array.copy, array.init_data, and
array.init_elem. As a drive by consistency fix, also remove unnecessary
parentheses around values in the prose for other GC instructions. These
parentheses do not appear in the prose for any other instruction.