-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add fast type conversion methods where possible #117
base: main
Are you sure you want to change the base?
Conversation
For SIMD types that have intrinsics for quickly converting to another type, methods were added to leverage these intrinsics for fast conversion.
83dfde4
to
8a89d31
Compare
As someone who is not an expert on wasm, I have no idea why the wasm tests are failing saying that |
@CryZe you're the wasm person, shouldn't |
From a quick glance this looks like a |
Is there a recommended fix? The one that comes to mind for me is to only include the Edit: I see that there's e.g. a f32x4::round() method although it claims that the fallback implementation is quite slow... |
The fallback is to call libm and do it in hardware. However, that fallback ends up being called only with no_std outside of x86 or x86_64. So... maybe that's okay? |
I guess for new methods, we should make the method not exist if it can't perform well. people can always turn on the std feature. |
It probably makes sense to add this |
Likewise I fixed this PR up to use the |
4d07f9c
to
1d3bf40
Compare
1d3bf40
to
7bee32d
Compare
I'm also noticing that a few of these do have existing functions, for example |
I agree that naming consistency would be best. Let's make the old names just call to the new name version, and then we can mark the old names as deprecated with a note that people should move to the new names instead. Then eventually we can remove the old names entirely in 0.8 or 0.9 or whenever. |
For SIMD types that have intrinsics for quickly
converting to another type, methods were added to
leverage these intrinsics for fast conversion.