-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 WASM's V128 as Rust u128 in Func::wrap() ? #7004
Comments
I've been meaning to dust off this branch for some time now! |
Well look at that! I searched issues and PR's before opening this and didn't find anything, but looks like it was hiding in a branch :) That would be really awesome, actually. We're currently evaluating Wasmtime as the runtime for stacks.co VM runtime for its Clarity language. As all numbers are currently treated as 128-bits, this would definitely save us some headaches! :D |
One thing to keep in mind perhaps is that Additionally most engines may not be that optimal at this time passing around Not to say that this isn't a good use case, just figured it might be worth giving a heads up! I personally think it'd be reasonable to improve these sorts of issues if they arise. If you're interested in running on other engines though it might be worth testing there too |
Very informed input, and good information for anyone else who might be wondering the same thing! In our case we're aware of the limitations and that v128 was meant primarily for simd operations - we're currently passing low/high u64 pairs back-and-forth, but this does incur a slight overhead in host functions instead of simply being able to, for example, |
Ok sounds good! I forgot to close this earlier but this was solved by #7010. If you notice any performance issues though in this area (or others) please let us know! |
Thanks for filing a feature request! Please fill out the TODOs below.
Feature
Wondering why V128 isn't supported in Func::wrap()? Both Walrus and Wasmer seem to allow V128's to be used in host functions mapped as u128's. I know this wasn't the "intended" use for V128's, but it would sure be nice for host functions, at least in Rust :)
Benefit
Would allow passing of 128-bit numbers to/from host-functions without the need to split them into two parameters including lower and upper bits.
Implementation
Haven't looked into the Wasmtime internals, so no comment.
Alternatives
The text was updated successfully, but these errors were encountered: