Skip to content
Merged
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
13 changes: 7 additions & 6 deletions stl/src/vector_algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <cstdint>
#include <cstring>
#include <xtr1common>

Comment thread
StephanTLavavej marked this conversation as resolved.
#ifndef _M_ARM64EC
#include <intrin.h>
#include <isa_availability.h>
Expand Down Expand Up @@ -47,6 +48,12 @@ namespace {
_mm256_zeroupper();
}
};

__m256i _Avx2_tail_mask_32(const size_t _Count_in_dwords) noexcept {
// _Count_in_dwords must be within [1, 7].
static constexpr unsigned int _Tail_masks[14] = {~0u, ~0u, ~0u, ~0u, ~0u, ~0u, ~0u, 0, 0, 0, 0, 0, 0, 0};
return _mm256_loadu_si256(reinterpret_cast<const __m256i*>(_Tail_masks + (7 - _Count_in_dwords)));
}
} // namespace
#endif // !defined(_M_ARM64EC)

Expand Down Expand Up @@ -88,12 +95,6 @@ namespace {
void _Advance_bytes(const void*& _Target, _Integral _Offset) noexcept {
_Target = static_cast<const unsigned char*>(_Target) + _Offset;
}

__m256i _Avx2_tail_mask_32(const size_t _Count_in_dwords) noexcept {
// _Count_in_dwords must be within [1, 7].
static constexpr unsigned int _Tail_masks[14] = {~0u, ~0u, ~0u, ~0u, ~0u, ~0u, ~0u, 0, 0, 0, 0, 0, 0, 0};
return _mm256_loadu_si256(reinterpret_cast<const __m256i*>(_Tail_masks + (7 - _Count_in_dwords)));
}
} // unnamed namespace

extern "C" {
Expand Down