The permute command from AVX2 instructions needs a parameter from type imm8. This parameter controls how the permutation is performed. Unfortunately I do not understand how this imm8 parameter is "created". What value do I have to set or how can I determine what value I have to set for a specific permuation?
Example: _mm256_permute_pd(vec2, 0x5);
Here the parameter 0x5 permutes the first and second double in vec2 and the third and fourth double in vec2. But how do I know that 0x5 does that?