-
Notifications
You must be signed in to change notification settings - Fork 266
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 WebAssembly Core Specification 2.0 #484
Comments
PS if anyone needs 2.0, please comment what tools you are using that target 2.0 and what use case and priority (timeline) it is for you. If you can workaround meanwhile with one of the features (as opposed to all of them), please note that too! |
ok revised the description |
This commit adds support for multiple tables per module. Notably, if the WithFeatureReferenceTypes is enabled, call_indirect, table.init and table.copy instructions can reference non-zero indexed tables. part of #484 Signed-off-by: Takeshi Yoneda <[email protected]>
TL;DR: we audited the new value types: externref and i128 and decided to continue use of encoding any and all value types as uint64 (for the purpose of This means anyone invoking an exported function that has a vector ops parameter (i128) needs to split the 128bit vector (ex. i32x4) into two 64bit vectors (ex. 32x4[0,1], i32x4[2,3]). Based on research, we think this is an edge case and can help anyone with this if they ask. We had lots of chats over the last couple days on how to handle the value types added to WebAssembly 2.0. The concern is the host function boundaries, and that can be split into two
The new types are:
The biggest deal here is how important the i128bit type is to be represented as a single unit in our exported API, as opposed to split into two uint64s, representing the high and low 64bits. Remember for this discussion, the only use of this in WebAssembly 2.0 is vector instructions. There are no other proposals included in WebAssembly 2.0 that would use these. The first question: is this a problem internally?, and it isn't. Function types are knowable before use, so it is not difficult to track how many units of 64bits should be pushed or popped from a stack. We also don't forsee any problem in JIT accessing these values. Next, should we define host function type parameter binding for an i128? Remember this is as opposed to Finally, and the biggest decision is do we break the function call API over this? It currently uses exclusively uint64 for parameter and return type. Ex. Moreover, we expect to eventually make a codegen solution for function call binding. In that case there are even less cause for concern about this as only generated code would deal with invoking "Call". However, we still need to learn if anyone would ever use i128bit for vector ops outside wasm (in a host function), and guessing ahead of time would result in tech debt. |
This commit completes the reference-types proposal implementation. Notably, this adds support for * `ref.is_null`, `ref.func`, `ref.is_null` instructions * `table.get`, `table.set`, `table.grow`, `table.size` and `table.fill` instructions * `Externref` and `Funcref` types (including invocation via uint64 encoding). part of #484 Signed-off-by: Takeshi Yoneda <[email protected]>
ok now the left is SMID proposal impl! 👯 |
This commit enables WebAssembly 2.0 Core Specification tests. In order to pass the tests, this fixes several places mostly on the validation logic. Note that SIMD instructions are not implemented yet. part of #484 Signed-off-by: Takeshi Yoneda <[email protected]> Co-authored-by: Crypt Keeper <[email protected]>
This commit implements the v128.const, i32x4.add and i64x2.add in interpreter mode and this adds support for the vector value types in the locals and globals. Notably, the vector type values can be passed and returned by exported functions as well as host functions via two-uint64 encodings as described in #484 (comment). Note: implementation of these instructions on JIT will be done in subsequent PR. part of #484 Signed-off-by: Takeshi Yoneda <[email protected]>
This implements various SIMD instructions related to load, store, and lane manipulations for all engines. Notablely, now our engines pass the following specification tests: * simd_address.wast * simd_const.wast * simd_align.wast * simd_laod16_lane.wast * simd_laod32_lane.wast * simd_laod64_lane.wast * simd_laod8_lane.wast * simd_lane.wast * simd_load_extend.wast * simd_load_splat.wast * simd_load_zero.wast * simd_store.wast * simd_store16_lane.wast * simd_store32_lane.wast * simd_store64_lane.wast * simd_store8_lane.wast part of #484 Signed-off-by: Takeshi Yoneda <[email protected]> Co-authored-by: Adrian Cole <[email protected]>
#644 completes arm64 backend for SIMD, therefore closing this long-standing issue! |
This completes the implementation of arm64 backend for SIMD instructions. Notably, now the arm64 compiler passes 100% of WebAssemby 2.0 draft specification tests. Combined with the completion of the interpreter and amd64 backend (#624), this finally resolves #484. Therefore, this also documents that wazero is 100% compatible with WebAssembly 1.0 and 2.0. Signed-off-by: Takeshi Yoneda <[email protected]>
Right now, we support WebAssembly Core Specification 1.0 and a few features that were marked finished, but not in a spec yet. While not recommendation phase, yet, there is a draft for 2.0 which helps us group which features will be in it. I think we can assume no more or less features will end up in that version.
https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#release-1-1
The text was updated successfully, but these errors were encountered: