Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/xsimd/arch/xsimd_avx2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,15 @@ namespace xsimd {
__m256i tmp2 = _mm256_add_epi64(self, tmp1);
__m128i tmp3 = _mm256_extracti128_si256(tmp2, 1);
__m128i res = _mm_add_epi64(_mm256_castsi256_si128(tmp2), tmp3);
#if defined(__x86_64__)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then correct me if I'm wrong : it's more an issue of 32 bits versus 64bits, right? If that's indeed the case, it means we should add a bot that capture that scenario before we merge that PR. I'll do that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's an issue only on 32 bits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to pick this change if it's useful.

return _mm_cvtsi128_si64(res);
#else
__m128i m;
_mm_storel_epi64(&m, res);
int64_t i;
std::memcpy(&i, &m, sizeof(i));
return i;
#endif
}
default: return hadd(self, avx{});
}
Expand Down