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

Work around swap_bytes on WebAssembly #222

Open
CryZe opened this issue Mar 12, 2024 · 1 comment
Open

Work around swap_bytes on WebAssembly #222

CryZe opened this issue Mar 12, 2024 · 1 comment

Comments

@CryZe
Copy link

CryZe commented Mar 12, 2024

Unfortunately neither u128 nor swap_bytes are supported directly by WebAssembly. So both implementations of folded_multiply are very slow.

I think an algorithm that takes both u64 values, turns them into a v128 vector and then does a bunch of swizzling and vector multiplications and co. probably would be the much faster solution. Here a Godbolt link with a little sketch:

https://rust.godbolt.org/z/jGGhYjGs8

I don't have enough knowledge about how to verify the quality, so I decided to not directly open a PR and instead first discuss the feasibility.

@tkaitchuck
Copy link
Owner

Do you have a good way to benchmark this? If so open a PR for that, and I'll play with it to make sure that quality is there.

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

No branches or pull requests

2 participants