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
40 changes: 40 additions & 0 deletions stl/src/vector_algorithms.cpp
Copy link
Member

Choose a reason for hiding this comment

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

When creating a new PR, please ensure that your main is up to date, and that your feature branch is properly synced. (Ideally, clean commits rebased on top of main.) Your branch was relative to main as of 2025-10-10 which was pretty old for such a fast-moving file as vector_algorithms.cpp. In this case it made no difference, just something to remember for the future!

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#ifdef _M_ARM64
#include <arm64_neon.h>

#include <Windows.h>
#elif !defined(_M_ARM64EC)
#include <intrin.h>
#include <isa_availability.h>
Expand Down Expand Up @@ -54,6 +56,44 @@ namespace {
}
#endif // ^^^ !defined(_M_ARM64) && !defined(_M_ARM64EC) ^^^

#if defined(_M_ARM64)
bool _Use_FEAT_DotProd() noexcept {
return IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_I8MM() noexcept {
return IsProcessorFeaturePresent(PF_ARM_V82_I8MM_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_SHA3() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_SVE() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_SVE2() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_SVE2p1() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE2_1_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_SVE_SHA3() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE_SHA3_INSTRUCTIONS_AVAILABLE);
}

bool _Use_FEAT_AES() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE_AES_INSTRUCTIONS_AVAILABLE);
}
Comment on lines +88 to +90
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned in the discussion, the cryptography stuff is going to be unused by the STL, but I am fine with merging all of this for now, then we can garbage-collect the unused functions when we have the full suite of STL vectorized algorithms for ARM64 completed. These are helpers in an unnamed namespace, so they can be removed without fear of breaking the import lib's compatibility.


bool _Use_FEAT_BitPerm() noexcept {
return IsProcessorFeaturePresent(PF_ARM_SVE_BITPERM_INSTRUCTIONS_AVAILABLE);
}
#endif // ^^^ defined(_M_ARM64) ^^^

size_t _Byte_length(const void* const _First, const void* const _Last) noexcept {
return static_cast<const unsigned char*>(_Last) - static_cast<const unsigned char*>(_First);
}
Expand Down