More minmax vectorization · Issue #2803 · microsoft/STL (original) (raw)
Followup issue after merging #2447.
- Vectorize
ranges::min_element
,ranges::max_element
,ranges::minmax_element
- This should be similar to vectorizing
ranges::count
, as we should be able to call the samevector_algorithms.cpp
functions after dealing with the iterator/sentinel. (Unlikeranges::find
, we don't need to worry about unbounded ranges.)
- This should be similar to vectorizing
And as @AlexGuteniev explained, we can go even further:
- Vectorize
ranges::min
,ranges::max
,ranges::minmax
- These algorithms return values instead of iterators, so they can be simpler and faster, and "will consist only of vertical max and one reduction".
- Use AVX2.
#2439 tracks extending the optimization to floating-point types.