Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Add bulk array instructions to MVP.md - #375

Merged
tlively merged 3 commits into
mainfrom
mvp-bulk-array
May 15, 2023
Merged

tlively merged 3 commits into
mainfrom
mvp-bulk-array

Conversation

@tlively

@tlively tlively commented May 12, 2023

Copy link
Copy Markdown
Member

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

Add descriptions of array.fill, array.copy, array.init_elem, and
array.init_data to MVP.md.
@tlively
tlively requested a review from rossberg May 12, 2023 18:53
@tlively

tlively commented May 12, 2023

Copy link
Copy Markdown
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@rossberg rossberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM modulo comments

Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md
- 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably ought to explain that for a packed field type t, the source is considered to be packed in the same way.

Comment thread proposals/gc/MVP.md
- 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This probably ought to explain that for a packed field type t, the source is considered to be packed in the same way.

Comment thread proposals/gc/MVP.md Resolved
Comment thread proposals/gc/MVP.md Outdated
- 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)`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- 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)`

Comment thread proposals/gc/MVP.md
- 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)`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It should also trap if the offset or size are negative afaik. (Similar comment for the operations below.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would expect that we would interpret the arguments as unsigned to avoid this complication.

@tlively

tlively commented May 15, 2023

Copy link
Copy Markdown
Member Author

All comments addressed, so merging now. Happy to continue discussions and make follow-up PRs if necessary.

@tlively
tlively merged commit 1fd0fbe into main May 15, 2023
@tlively tlively mentioned this pull request May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants