Repository navigation
Add bulk array instructions to MVP.md - #375
Conversation
Add descriptions of array.fill, array.copy, array.init_elem, and array.init_data to MVP.md.
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
| - the 1st operand is the `array` to be initialized | ||
| - the 2nd operand is the `dest_offset` at which the copy will begin in `array` | ||
| - the 3rd operand is the `src_offset` at which the copy will begin in `$d` | ||
| - the 4th operand is the `size` of the copy in array slots |
There was a problem hiding this comment.
This probably ought to explain that for a packed field type t, the source is considered to be packed in the same way.
| - the 1st operand is the `array` to be initialized | ||
| - the 2nd operand is the `dest_offset` at which the copy will begin in `array` | ||
| - the 3rd operand is the `src_offset` at which the copy will begin in `$d` | ||
| - the 4th operand is the `size` of the copy in array slots |
There was a problem hiding this comment.
This probably ought to explain that for a packed field type t, the source is considered to be packed in the same way.
| - the 3rd operand is the `src_offset` at which the copy will begin in `$d` | ||
| - the 4th operand is the `size` of the copy in array slots | ||
| - traps if `array` is null | ||
| - traps if `dest_offset + size > len(array)` or `src_offset + size * bytes(t) > len($d)` |
There was a problem hiding this comment.
| - traps if `dest_offset + size > len(array)` or `src_offset + size * bytes(t) > len($d)` | |
| - traps if `dest_offset + size > len(array)` or `src_offset + size * |t| > len($d)` |
| - the 2nd operand is the `offset` into the array at which to begin filling | ||
| - the 3rd operand is the `value` with which to fill | ||
| - the 4th operand is the `size` of the filled slice | ||
| - traps if `array` is null or `offset + size > len(array)` |
There was a problem hiding this comment.
It should also trap if the offset or size are negative afaik. (Similar comment for the operations below.)
There was a problem hiding this comment.
I would expect that we would interpret the arguments as unsigned to avoid this complication.
Co-authored-by: Andreas Rossberg <[email protected]>
|
All comments addressed, so merging now. Happy to continue discussions and make follow-up PRs if necessary. |

Add descriptions of array.fill, array.copy, array.init_elem, and
array.init_data to MVP.md.