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

Use WebAssembly bulk memory opcodes for memcpy/memset? #262

Closed
TerrorJack opened this issue Dec 3, 2021 · 2 comments · Fixed by #263
Closed

Use WebAssembly bulk memory opcodes for memcpy/memset? #262

TerrorJack opened this issue Dec 3, 2021 · 2 comments · Fixed by #263

Comments

@TerrorJack
Copy link
Contributor

WebAssembly bulk memory opcodes have shipped for major browsers for some time. Does it make sense to use that for memcpy/memset functions in wasi-libc? If there are no objections in principle, I'd like to try opening a PR for this.

@sunfishcode
Copy link
Member

That sounds great!

It appears bulk-memory is supported in all the engines tracked in the roadmap, and according to this bulk memory was standardized in February.

Could you write the code guarded with #ifdef __wasm_bulk_memory__? I expect we'll enable it by default, but that way if someone wants to make a custom build of wasi-libc without it, they can pass -mno-bulk-memory to clang and build their own.

@kripken
Copy link
Member

kripken commented Dec 3, 2021

I'd recommend measuring the effect of this. At least at some point it was the case that not all browsers optimized these operations very well. (But it is a win for size, of course.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants