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

fix: disable bulk memory feature when BULK_MEMORY_THRESHOLD is UINT32_MAX #395

Closed
wants to merge 1 commit into from
Closed

fix: disable bulk memory feature when BULK_MEMORY_THRESHOLD is UINT32_MAX #395

wants to merge 1 commit into from

Conversation

HerrCai0907
Copy link

I want to run c++ code in some platform which does not support bulk memory instruction.

If env BULK_MEMORY_THRESHOLD is UINT32_MAX which means we don't want to use bulk memory instruction. So maybe it is reasonable to disable this feature in this situation.

@HerrCai0907
Copy link
Author

@sbc100 Could you kindly review this PR?

@sbc100
Copy link
Member

sbc100 commented Mar 9, 2023

I'm not sure that setting BULK_MEMORY_THRESHOLD to UINT32_MAX is the best way to completely opt out bulk memory support/requirement.

After a quick review I don't see discussion of bulk memory dependency in #263. @sunfishcode do you remember why we didn't add an opt out for this initially?

@sunfishcode
Copy link
Member

We didn't add it at the time because bulk-memory is in all the major Wasm engines. It can make sense to add options when people have specific needs, but it's a balance because every ifdef we add makes it a little harder to evolve the code to meet new needs.

@dkegel-fastly
Copy link

I suspect "wasm MVP" is https://www.wasm.com.cn, and currently lacks bulk memory support; perhaps a chinese speaker can confirm.

@radkomih
Copy link

My use case is such that it targets Wasm MVP (which does not include bulk memory operations).
I need to be able to execute Wasm in a host environment that does not support bulk memory operations, so +1 for being able to opt-out from memory bulk ops.

@jedisct1
Copy link
Member

@radkomih If you're using zig cc, the wasi libc gets compiled with the same options as the rest of the application.

The default target is compatible with Wasm MVP.

Additional optimizations for specific runtimes can be added with -mcpu=..., for example:

zig cc -s -Os -target wasm32-wasi -mcpu=generic+simd128+bulk_memory app.c

@radkomih
Copy link

Thanks, but unfortunately, I can't take advantage of this option since I am not using Zig.

@dkegel-fastly
Copy link

should still be able to use the same option change in whatever you use to build wasi-libc.

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 this pull request may close these issues.

None yet

6 participants