Skip to content

Add SIMD shuffles for SimdType{2,4,8,16,32,64} #62

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

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

workingjubilee
Copy link
Member

This const generic implementation for certain lane sizes represents
a more limited interface than what LLVM's shufflevector instruction
can handle, as normally the length of U can be different from the
length of T, but offers an interface that it is expected to be able
to expand the capabilities of in the future.

@workingjubilee
Copy link
Member Author

workingjubilee commented Feb 4, 2021

Check failures seem to be spurious, i.e. due to under-resourced computers rather than actually being compile or test failures.

pub(crate) fn simd_shuffle8<T, U>(x: T, y: T, idx: [u32; 8]) -> U;
pub(crate) fn simd_shuffle16<T, U>(x: T, y: T, idx: [u32; 16]) -> U;
pub(crate) fn simd_shuffle32<T, U>(x: T, y: T, idx: [u32; 32]) -> U;
pub(crate) fn simd_shuffle64<T, U>(x: T, y: T, idx: [u32; 64]) -> U;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if we extend rustc to have fn simd_shuffle<T, U, M>(x: T, y: T, idx: M) -> U we could make this fully generic, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly! I am currently poking people in the const generics crew to better understand what is required, so I'm optimistic but not completely certain what's going to happen next.

This const generic implementation for certain lane sizes represents
a more limited interface than what LLVM's shufflevector instruction
can handle, as normally the length of U can be different from the
length of T, but offers an interface that it is expected to be able
to expand the capabilities of in the future.
@KodrAus KodrAus merged commit 1b0c231 into master Feb 9, 2021
@workingjubilee workingjubilee deleted the feature/shuffle-self branch February 9, 2021 05:06
@calebzulawski calebzulawski mentioned this pull request Apr 12, 2021
5 tasks
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

Successfully merging this pull request may close these issues.

3 participants