-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Consider compiling SIMD-from-SIMD initialisation directly to a shuffle #18148
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
Comments
If we would stop using |
Two things:
updated code:
|
This is a code-generation thing, so external SIMD would still benefit.
There's still 4 that could theoretically be removed. (Thanks for prompting for updates!) |
Closing wishlist. |
fix: When checking for forbidden expr kind matches, account for rawness An expression starting with `r#const` etc. should be accepted even in edition <=2021. Fixes rust-lang#18148. This was not fixed when testing with edition 2024, I wonder whether that means our check for edition is incorrect...
becomes, with no optimisations:
with optimisations it becomes
We could detect when a SIMD vector is being created directly from elements of another (pair of*) SIMD vector(s) and convert it directly into the appropriate shuffle instruction. This will save allocas and LLVM doing work, and probably guarantees it more than LLVM currently does. This should even work for vectors of different lengths, as long as the elements are the same.
(This is just a bug since it's an implementation detail.)
*
shufflevector
actually takes two operands, sof32x2(x.0, y.0, x.1, y.1)
can also directly become a shuffle.The text was updated successfully, but these errors were encountered: