-
Notifications
You must be signed in to change notification settings - Fork 11
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
Structures with arbitrary size #4
Comments
Internally, this library uses
I imagine you would amortize the branch (possibly by detecting it once at startup and setting a global function pointer). Regardless, this library doesn't support that anyway. But hopefully some day. :-) |
Looks good :) What about adding support for arbitrary size vectors though? So that chosing SIMD instructions or not is abstracted away? |
@flip111 I'm not sure that's in scope for this crate. I'd recommend building something yourself in a separate crate and see where it takes us. |
Would it be possible to define a structure where the right SIMD instruction is chosen automatically (question 1)? Where the possible SIMD instructions are detected on compile time (question 2)?
Let's say i have an older CPU so no AVX2, hopefully the compiler can hint this just like gcc. Then i can have a maximum of 128 bits vectors.
For example i have a 1300 bit vector which i want to AND with another 1300 vector. Which would take 10x 128 bit vectors and 1x 20 bit vector (round up to 32 bits). If the size of the vector is known at compile time could rust generate the right instructors for it, with only me specifying the 1300 bit size?
If 1300 is the wrong example, think of 1312 or 1344.
Runtime would also be interesting (question 3), but i think actually less interesting than compile time because you would have to branch to normal instructions (for 32 bits and so) and avx instructions based on size which will make you loose performance.
The text was updated successfully, but these errors were encountered: