Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Memset+Memcpy to FutureFeatures.md #1057

Merged
merged 5 commits into from
May 11, 2017
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
19 changes: 19 additions & 0 deletions FutureFeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,3 +561,22 @@ static signature validation check. This could be improved by allowing:
check of a call to a heterogeneous table;
* any other specific GC reference type, effectively allowing WebAssembly code
to implement a variety of rooting API schemes.

### Memset and Memcpy Operators

Copying and clearing large memory regions is very common, and making these
operations fast is architecture dependent. Although this can be done in the MVP
via `i32.load` and `i32.store`, this requires more bytes of code and forces VMs
to recognize the loops as well. The following operators can be added to improve
performance:

* `move_memory`: Copy data from a source memory region to destination region;
these regions may overlap: the copy is performed as if the source region was
first copied to a temporary buffer, then the temporary buffer is copied to
the destination region
* `set_memory`: Set all bytes in a memory region to a given byte

We expect that WebAssembly producers will use these operations when the region
size is known to be large, and will use loads/stores otherwise.

TODO: determine how these operations interact w/ shared memory.