Update Vectorized STL algorithm documentation to reflect the current state#5937
Conversation
…stae Since the last update: * ARM64 and ARM64EC vectorization was added. Mention of x64 and x86 is removed, as vectorization is now supported on any target, except deprecated `/clr:pure` and `/clr:safe` modes. * `includes` is now manually vectorized too * `replace_copy` is now manually vectorized too Also moved `find_end` to `search` / `search_n` group, where it fits better.
|
@AlexGuteniev : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
|
Can you review the proposed changes? IMPORTANT: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
TylerMSFT
left a comment
There was a problem hiding this comment.
Thank you for the updates!
|
#sign-off |
There was a problem hiding this comment.
Pull request overview
This PR updates the MSVC STL vectorized-algorithms documentation to reflect which algorithms are manually vectorized and reorganizes part of the algorithm list to better match conceptual groupings.
Changes:
- Updates the “Manual vectorization” description to be target-agnostic.
- Re-groups
find_endunder thesearch/search_nset. - Expands the manually vectorized algorithm list to include
includesandreplace_copy.
Comments suppressed due to low confidence (1)
docs/standard-library/vectorized-stl-algorithms.md:31
- This section still mentions x64/x86 defaults and doesn’t mention the
/clr:pureand/clr:safeexception described in the PR metadata. That makes the updated platform-agnostic wording in this paragraph inconsistent with the rest of the topic and with the PR’s stated intent.
Certain algorithms include manual vectorization. This implementation is separately compiled and relies on runtime CPU dispatch, so it applies only to suitable CPUs.
Manually vectorized algorithms use template metaprogramming to detect if the element type is suitable for vectorization. As a result, they're only vectorized for simple types such as standard integer types.
Programs either benefit in performance from manual vectorization or remain unaffected by it. Disable manual vectorization by defining `_USE_STD_VECTOR_ALGORITHMS=0` in your project. Manually vectorized algorithms are enabled by default on x64 and x86 because `_USE_STD_VECTOR_ALGORITHMS` defaults to 1 on those platforms.
Since the last update:
/clr:pureand/clr:safemodes.includesis now manually vectorized tooreplace_copyis now manually vectorized tooAlso moved
find_endtosearch/search_ngroup, where it fits better.