◆ operator[]() [2/3]
template<typename Type , typename Cardinal >
template<std::ptrdiff_t... I>
Static lookup via lane indexing. Generate a new eve::wide which is an arbitrary shuffling of current eve::wide lanes. ‘p’ is an instance of eve::pattern_t constructed via the eve::pattern template variable. Values appearing in the pattern must be between 0 and Note that if the statically generated pattern matches a predefined Shuffling and Swizzling function the corresponding optimized shuffling functions will be called.
Example: See it live on Compiler Explorer #include <eve/wide.hpp>
#include <iostream>
int main()
{
eve::wide<int, eve::fixed<8>> r{1, 2, 4, 8, 16, 32, 64, 128};
std::cout << r << "\n";
// Reindex r with a static pattern
std::cout << r[ eve::pattern<0,0,1,1,2,2,3,3> ] << "\n";
}
|