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

Support TargetFeatures section #306

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Conversation

zherczeg
Copy link
Collaborator

Currently all features are accepted, we could add filters later.

Background: clang compiled .wasm files requires features such as bulk-memory / mutable-globals / sign-ext. These are all part of WebAssembly 2.0.

Shall I add manual checking of features?

Currently all features are accepted, we could add filters later.

Signed-off-by: Zoltan Herczeg [email protected]
Comment on lines +46 to +48
virtual void OnFeatureCount(Index count) = 0;
// Returns false, if the feature is not supported.
virtual bool OnFeature(uint8_t prefix, std::string name) = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these two methods really used?
Are there any cases that require these methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we are trying to extend the testing coverage of Walrus. One of the things we try is using benchmarks from other projects such as Dhrystone. We compile them with two compilers: emscripten and clang. We assume they generate different byte-code which further increase the coverage. Clang always generates "feature" section even for features which are in WebAssembly 2.0 such as bulk-memory / mutable-globals / sign-ext. These are all supported by Walrus, so we just "skip" this section in this patch. Furthermore clang code uses a few wasi functions: "args_get / args_sizes_get / clock_time_get / fd_close / fd_fdstat_get / fd_seek / fd_write / proc_exit". Half of them are already supported by Walrus, and we want to support the others as well. Do you think it is a good direction or shall we try something else?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Your approach looks good :)

@clover2123 clover2123 merged commit e5f6c55 into Samsung:main Nov 25, 2024
15 checks passed
@zherczeg zherczeg deleted the target_features branch November 25, 2024 10:06
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.

2 participants