Skip to content

Commit d05d46f

Browse files
authored
Merge pull request xtensor-stack#1306 from DiamonDinoia/fix/avx2-uint64-mul
perf: add native AVX2 uint64/int64 mul kernel
2 parents 1e7c3b9 + ce57bfe commit d05d46f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

include/xsimd/arch/xsimd_avx2.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,16 @@ namespace xsimd
912912
{
913913
return _mm256_mullo_epi32(self, other);
914914
}
915+
else XSIMD_IF_CONSTEXPR(sizeof(T) == 8)
916+
{
917+
return _mm256_add_epi64(
918+
_mm256_mul_epu32(self, other),
919+
_mm256_slli_epi64(
920+
_mm256_add_epi64(
921+
_mm256_mul_epu32(other, _mm256_shuffle_epi32(self, _MM_SHUFFLE(2, 3, 0, 1))),
922+
_mm256_mul_epu32(self, _mm256_shuffle_epi32(other, _MM_SHUFFLE(2, 3, 0, 1)))),
923+
32));
924+
}
915925
else
916926
{
917927
return mul(self, other, avx {});

0 commit comments

Comments
 (0)