Skip to content

Instantly share code, notes, and snippets.

@martin-steinegger
Last active January 1, 2016 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martin-steinegger/8172514 to your computer and use it in GitHub Desktop.
Save martin-steinegger/8172514 to your computer and use it in GitHub Desktop.
_M256_SLLI_SI256 CROSS LANE
template <unsigned int N> __m256i _mm256_shift_left2(__m256i a) {
__m256i mask = _mm256_srli_si256(
_mm256_permute2x128_si256(a, a, _MM_SHUFFLE(0,0,3,0)) , 16-N);
return _mm256_or_si256(_mm256_slli_si256(a,N),mask);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment