-
Notifications
You must be signed in to change notification settings - Fork 66
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
WebAssembly SIMD Intrinsic API Documentation #108
base: main
Are you sure you want to change the base?
Conversation
FWIW this all roughly matches what we're doing in Rust to expose SIMD intrinsics (documented here), although there's two main differences:
|
@alexcrichton I was thinking that having separate types might be helpful for users. I don't think it's very important that WebAssembly's underlying type system be mirrored exactly at the source level, even for intrinsics. On the other hand, clang by default silently allows conversions between vector types of the same size, so users have to opt-in to getting any benefit from the separate types. Perhaps having separate types is not worth the extra effort. I would be interested in hearing more opinions about this. |
Makes sense! We originally used separate types awhile back in Rust as well. I think that the most important capability to enable here is what wasm actually exposes, which is passing any vector anywhere. We do that in Rust by taking In that sense I don't think the type names in C/C++ would matter too much since the underlying functionality shouldn't change too much. This header file, though, will likely be used to model other languages which may be more strict about types than Clang specifically is today. For example we won't be able to follow this specification in Rust due to the lack of implicit type coercions. In that sense it seems like it'd be nice to have languages exposing SIMD for wasm be consistent amongst themselves! |
##### **Arithmetic Operations Definition** <a name=arithmetic-operations-definition></a> | ||
|
||
~~~ | ||
i8x16 wasm_i8x16_add(i8x16 a i8x16 b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing comma
I suggest that |
@Maratyszcza IIUC, the main problem I see with
I don't think this is just an inconvenience. Casting a Basically, the |
Thanks for your comments, everyone! Let's move conversation to the implementing PR for now to avoid duplication. Once the implementation is merged we can circle back and fix up the documentation to match. |
The Wasm SIMD intrinsics implementation PR for Emscripten is now merged. Is it time to circle back and fix up the documentation to match here? |
This is the markdown description of the WebAssembly SIMD Intrinsic API's