Skip to content

Commit 96e4344

Browse files
committed
Add ymm_epi64 to xmm_epi32 conversion
1 parent 6288fb2 commit 96e4344

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/xsimd/types/xsimd_int_conversion.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ namespace xsimd
3737
__m128i xsimd_cvtepi32_epi16(__m256i a);
3838
__m128i xsimd_cvtepi32_epu16(__m256i a);
3939

40+
__m128i xsimd_cvtepi64_epi32(__m256i a);
41+
4042
/******************
4143
* Implementation *
4244
******************/
@@ -165,6 +167,13 @@ namespace xsimd
165167
#endif
166168
return res;
167169
}
170+
171+
inline __m128i xsimd_cvtepi64_epi32(__m256i a)
172+
{
173+
__m128i hi = _mm256_extractf128_si256(a, 1);
174+
__m128i lo = _mm256_castsi256_si128(a);
175+
return (__m128i)_mm_shuffle_ps((__m128)lo, (__m128)hi, _MM_SHUFFLE(2, 0, 2, 0));
176+
}
168177
}
169178
}
170179

0 commit comments

Comments
 (0)