diff --git a/FutureFeatures.md b/FutureFeatures.md index bb09b9eb..4d61da21 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -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.