Add SVE implementations of bitset_meow_string - #6420
Merged
Stephan T. Lavavej (StephanTLavavej) merged 18 commits intoSep 16, 2026
Merged
Stephan T. Lavavej (StephanTLavavej) merged 18 commits into
Stephan T. Lavavej (StephanTLavavej) merged 18 commits into
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This computation was identical.
This isn't needed to guard against a do-nothing for-loop.
…`[_Size_convert, _Size_chars)`. `_Size_convert` is defined as `(_Size_chars <= _Size_bits) ? _Size_chars : _Size_bits`. That's equivalent to: `(_Size_bits < _Size_chars) ? _Size_bits : _Size_chars` `_Size_bits < _Size_chars` is the condition when this for-loop is going to do anything. When it's going to do something, `_Size_convert` is `_Size_bits`, so the behavior is unchanged. When it's going to be a no-op, `_Size_convert` is `_Size_chars`, so `_Ix < _Size_chars` is immediately false, so the no-op is unchanged.
…e_chars, _Size_convert` without confusing variation.
This matches how `_Size_convert` is used as the SVE threshold and makes much more sense. When `_Size_chars <= _Size_bits`, we set `_Size_convert` to `_Size_chars` and vectorize that much. The remaining bits are memset.
…lidate_extra`, equivalent to the first part of `_Finish_sve`.
This makes more sense given how it's used.
Member
|
Thanks! 😻 I pushed fairly significant refactorings to avoid code duplication, reusing the old I kept the old |
Stephan T. Lavavej (StephanTLavavej)
approved these changes
Sep 15, 2026
Member
|
I'm mirroring this to the MSVC-internal repo. Please notify me if any further changes are pushed, otherwise no action is required. |
Stephan T. Lavavej (StephanTLavavej)
merged commit Sep 16, 2026
cb7268f
into
microsoft:main
48 checks passed
Member
🧶 😻 🧵 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds SVE implementations of
bitset_meow_string.As discussed on the STL discord, the ACLE does not expose explicit predicate load/store intrinsics, so this implementation uses explicit casts to/from
svbool_t*.Benchmark Results ⏲️
Neoverse N2 (Cobalt 100)
BM_bitset_to_string_large_single<512, char>BM_bitset_to_string_large_single<2048, char>BM_bitset_to_string_large_single<512, wchar_t>BM_bitset_to_string_large_single<2048, wchar_t>bitset_from_string<length_type::char_count, 16, char>bitset_from_string<length_type::char_count, 36, char>bitset_from_string<length_type::char_count, 64, char>bitset_from_string<length_type::char_count, 512, char>bitset_from_string<length_type::char_count, 2048, char>bitset_from_string<length_type::char_count, 16, wchar_t>bitset_from_string<length_type::char_count, 36, wchar_t>bitset_from_string<length_type::char_count, 64, wchar_t>bitset_from_string<length_type::char_count, 512, wchar_t>bitset_from_string<length_type::char_count, 2048, wchar_t>bitset_from_string<length_type::null_term, 16, char>bitset_from_string<length_type::null_term, 36, char>bitset_from_string<length_type::null_term, 64, char>bitset_from_string<length_type::null_term, 512, char>bitset_from_string<length_type::null_term, 2048, char>bitset_from_string<length_type::null_term, 16, wchar_t>bitset_from_string<length_type::null_term, 36, wchar_t>bitset_from_string<length_type::null_term, 64, wchar_t>bitset_from_string<length_type::null_term, 512, wchar_t>bitset_from_string<length_type::null_term, 2048, wchar_t>bitset_from_stream<16, char>bitset_from_stream<36, char>bitset_from_stream<64, char>bitset_from_stream<512, char>bitset_from_stream<2048, char>bitset_from_stream<16, wchar_t>bitset_from_stream<36, wchar_t>bitset_from_stream<64, wchar_t>bitset_from_stream<512, wchar_t>bitset_from_stream<2048, wchar_t>