The code below correctly shifts v256f_stats
by one and puts the results into v256f_x3
. This is then used to get the delta between n[1..7] and n[0..6]
. The undefined element in the output is not an issue.
Is there a more efficient way of doing this?
// create a shift-by-1 copy
v256f_x1 = _mm256_permute2f128_ps(v256f_stats, v256f_stats, 0);
v256f_x2 = _mm256_permute2f128_ps(v256f_stats, v256f_stats, 0x11);
v256f_x1 = _mm256_permute_ps(v256f_x1, 0b10010011);
v256f_x2 = _mm256_permute_ps(v256f_x2, 0b10010011);
v256f_x3 = _mm256_blend_ps(v256f_x1, v256f_x2, 0b11100000);