Skip to content

emscripten_memcpy_big when bulk-memory enabled #18414

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

Closed
miwelc opened this issue Dec 21, 2022 · 4 comments
Closed

emscripten_memcpy_big when bulk-memory enabled #18414

miwelc opened this issue Dec 21, 2022 · 4 comments

Comments

@miwelc
Copy link
Contributor

miwelc commented Dec 21, 2022

I've seen in the emitted JS code that emscripten_memcpy_big is being defined even if -mbulk-memory is enabled.
Is this the expected behavior?

@RReverser
Copy link
Collaborator

RReverser commented Mar 1, 2023

Running into this as well. Not critical, but looks like this issue might've slipped under the radar?

@sbc100
Copy link
Collaborator

sbc100 commented Mar 1, 2023

I don't see anything in the code that would stop emscripten_memcpy_big from being used. What makes you think this is not expected behaviour? Are you expecting an explict call to the memory.copy builtin here:

#ifndef EMSCRIPTEN_STANDALONE_WASM
if (n >= 512) {
emscripten_memcpy_big(dest, src, n);
return dest;
}
#endif

One problem with doing that is that we probably wouldn't want to build a specific / separate version of libc when bulk-memory is enabled.

@RReverser
Copy link
Collaborator

What makes you think this is not expected behaviour?

Nothing except that it feels like it should be, sort of like -fwasm-exceptions reduces overhead by replacing exception imports from JS with native Wasm functionality.

Are you expecting an explict call to the memory.copy builtin here:

Yeah.

@RReverser
Copy link
Collaborator

Looks like this was implemented in #19128.

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

No branches or pull requests

3 participants