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

[FEATURE] perfect_shuffle #1227

Open
Tracked by #1554
DenisYaroshevskiy opened this issue Feb 2, 2022 · 0 comments
Open
Tracked by #1554

[FEATURE] perfect_shuffle #1227

DenisYaroshevskiy opened this issue Feb 2, 2022 · 0 comments
Labels
feature New feature or request

Comments

@DenisYaroshevskiy
Copy link
Collaborator

First step in improving the shuffling situation.
Right now we have to all of the time go and recheck all of the intrinsics for every new shuffle we add.
No guarantees we didn't miss anything, no way to prioritise intrinsics.

The first step to improve our situation is a perfect_shuffle function.

A perfect_shuffle is a shuffle in 0 (like a cast) or 1 instruction that does not need any extra masks.
If the shuffle is not supported, perfect shuffle should fail in a sfinae friendly way.

I also think it would be helpful to introduce a byte_pattern class:

template <std::size_t N>
struct byte_pattern
{
  int group_size;
  std::array<int, N> idxs;
};

-1 could indicate a 0.
-2 could indicate - we don't care.

This will result in less template instantiations I think.

@DenisYaroshevskiy DenisYaroshevskiy added the feature New feature or request label Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant