Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE2 & AVX2 std::find & std::count #2434

Merged
merged 94 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
d1c1d82
nested exception
AlexGuteniev Sep 27, 2021
b51d730
regex compare
AlexGuteniev Sep 27, 2021
b3095c4
polymorphic_allocator
AlexGuteniev Sep 27, 2021
56ff1ba
can use `_v` in polymorphic allocator
AlexGuteniev Sep 27, 2021
8169883
untag _Uses_allocator_piecewise more
AlexGuteniev Sep 27, 2021
96dc2d4
_Al
AlexGuteniev Sep 27, 2021
6d12638
ret type
AlexGuteniev Sep 27, 2021
0ccc226
Update stl/inc/regex
AlexGuteniev Sep 28, 2021
9ccdad1
Merge commit '6e669f092311fea66c6358efc1557c454a684fcc' into tag_disp…
AlexGuteniev Oct 20, 2021
d57e79e
Merge remote-tracking branch 'upstream/main' into tag_dispatch_2
AlexGuteniev Oct 20, 2021
d603670
_Within_limits
AlexGuteniev Oct 20, 2021
fb25b4a
@miscco review
AlexGuteniev Oct 20, 2021
4097134
sample
AlexGuteniev Oct 20, 2021
3554787
sample fix
AlexGuteniev Oct 20, 2021
c2b73bc
Pre is checked
AlexGuteniev Oct 20, 2021
00ead28
constexpr
AlexGuteniev Oct 20, 2021
104a592
is_permutation
AlexGuteniev Oct 28, 2021
7c83374
wrap everything
AlexGuteniev Oct 28, 2021
fdfa552
clang format
AlexGuteniev Oct 28, 2021
a62398d
_Find_unchecked
AlexGuteniev Dec 5, 2021
b6118b0
restore _Memchr_in_find_is_safe
AlexGuteniev Dec 5, 2021
9a9cc4b
restore _Memchr_in_find_is_safe missing param
AlexGuteniev Dec 5, 2021
d4c4d29
Merge branch 'tag_dispatch_2' into untag_dispatch_find
AlexGuteniev Dec 5, 2021
606f69f
Move comment.
StephanTLavavej Dec 10, 2021
ef3196c
Update stl/inc/xutility
AlexGuteniev Dec 10, 2021
31ae1ba
Merge remote-tracking branch 'upstream/main' into untag_dispatch_find
AlexGuteniev Dec 17, 2021
1e6fd4c
Document `_Within_limits` precondition right on the tin
CaseyCarter Dec 18, 2021
0a740fc
SSE2 and AVX2 std::find
AlexGuteniev Dec 18, 2021
a36c0d3
vectorcall, comment, expand test
AlexGuteniev Dec 18, 2021
7ff0a89
Deadvance stop
AlexGuteniev Dec 18, 2021
376bf28
fix test pass
AlexGuteniev Dec 18, 2021
941786c
proper sizing
AlexGuteniev Dec 18, 2021
7ad9fd6
fix zero padding corner case
AlexGuteniev Dec 18, 2021
97b2e53
correct size
AlexGuteniev Dec 18, 2021
95c1bd6
unvectorcall x86
AlexGuteniev Dec 18, 2021
04c950f
__stdcall
AlexGuteniev Dec 18, 2021
8beff10
fuse SSE and AVX
AlexGuteniev Dec 18, 2021
269eeb8
disable memchr for non-sized ranges
AlexGuteniev Dec 18, 2021
c3ee1ce
save a bit perf
AlexGuteniev Dec 18, 2021
a640b2d
min/max avoid branching
AlexGuteniev Dec 19, 2021
7957952
More perf improvement
AlexGuteniev Dec 19, 2021
dbbd766
Can't recreate CI failure; try old implementation
AlexGuteniev Dec 19, 2021
ab6228e
Revert "Can't recreate CI failure; try old implementation"
AlexGuteniev Dec 19, 2021
6b80f73
const correctness
AlexGuteniev Dec 19, 2021
0fee6d0
unroll
AlexGuteniev Dec 19, 2021
099f55f
+coverage
AlexGuteniev Dec 19, 2021
92bfa39
can't really unroll as it is the fallback
AlexGuteniev Dec 19, 2021
e4a3902
count #2384
AlexGuteniev Dec 19, 2021
78d815a
bytes multiplier
AlexGuteniev Dec 19, 2021
2ee261b
it is not harmful to capture comparand
AlexGuteniev Dec 20, 2021
cbc57e0
tail size
AlexGuteniev Dec 20, 2021
3080b4d
unnecessary includes
AlexGuteniev Dec 20, 2021
5d360d7
pointers
AlexGuteniev Dec 21, 2021
c2f443a
_STD
AlexGuteniev Dec 21, 2021
a53b8d8
param
AlexGuteniev Dec 22, 2021
5259074
cast
AlexGuteniev Dec 22, 2021
5736791
cast
AlexGuteniev Dec 22, 2021
bea94f9
Non-vector
AlexGuteniev Dec 22, 2021
36cbcfa
fallback
AlexGuteniev Dec 22, 2021
6de6dbc
-newline
AlexGuteniev Dec 22, 2021
d5e4e2a
New coverage
AlexGuteniev Dec 22, 2021
94a7778
avoid signed/unsigned warning
AlexGuteniev Dec 22, 2021
c84a851
clang on ARM fix
AlexGuteniev Dec 23, 2021
dd5d453
expand test coverage
AlexGuteniev Dec 23, 2021
d3eafa6
simplify
AlexGuteniev Dec 23, 2021
8f84a69
warnings
AlexGuteniev Dec 23, 2021
ee4e711
use pointer ranges
AlexGuteniev Dec 24, 2021
d3b19ff
reduce copypasta using templates
AlexGuteniev Dec 28, 2021
3e7efa8
mask missing+cleanup+BSF is expensive on AMD
AlexGuteniev Dec 28, 2021
33d35ee
Also hide BSF here
AlexGuteniev Dec 28, 2021
678f9a0
some const
AlexGuteniev Dec 28, 2021
d0200c3
this doesn't have to be guarded with is_constant_evaluated()
AlexGuteniev Dec 28, 2021
aa2c763
-newline
AlexGuteniev Jan 2, 2022
de18507
optimization tuning for release only
AlexGuteniev Jan 3, 2022
7d98347
+newline
AlexGuteniev Jan 3, 2022
c2c6d54
Merge remote-tracking branch 'upstream/main' into vector_find
AlexGuteniev Jan 6, 2022
ba267fb
unnecessary change
AlexGuteniev Jan 6, 2022
c7dee40
unnecessary typedef
AlexGuteniev Jan 6, 2022
1f7d908
Merge remote-tracking branch 'upstream/main' into vector_find
AlexGuteniev Jan 20, 2022
f3d765b
review comments
AlexGuteniev Mar 26, 2022
24f3e85
Merge remote-tracking branch 'upstream/main' into vector_find
AlexGuteniev Mar 26, 2022
69e160b
missed SSE 4.2
AlexGuteniev Mar 26, 2022
d8385b2
fix tests
AlexGuteniev Mar 26, 2022
2b129f3
revert _Vector_alg_in_find_is_safe fix
AlexGuteniev Mar 26, 2022
aa82de3
right sentinel query
AlexGuteniev Mar 26, 2022
6da5307
typedef
AlexGuteniev Mar 26, 2022
90c48c9
check optimization
AlexGuteniev Mar 29, 2022
6a79d67
Merge remote-tracking branch 'upstream/main' into vector_find
AlexGuteniev Mar 29, 2022
deec36d
fluffy
AlexGuteniev Mar 29, 2022
54db345
clang-format
AlexGuteniev Mar 29, 2022
01002ed
clang-format
AlexGuteniev Mar 29, 2022
b86b39d
pointers
AlexGuteniev Mar 30, 2022
dec20b0
Code review feedback.
StephanTLavavej Apr 1, 2022
ebb230d
Disable vector algorithms for ARM64EC.
StephanTLavavej Apr 2, 2022
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
1 change: 1 addition & 0 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ set(IMPLIB_SOURCES
set(DLL_SOURCES
${CMAKE_CURRENT_LIST_DIR}/src/dllmain.cpp
${CMAKE_CURRENT_LIST_DIR}/src/instances.cpp
${CMAKE_CURRENT_LIST_DIR}/src/vector_algorithms.cpp
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
)

# Sources that must not be compiled with /GL, since they contain CRT initializers.
Expand Down
13 changes: 13 additions & 0 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,19 @@ namespace ranges {
_STL_INTERNAL_STATIC_ASSERT(sentinel_for<_Se, _It>);
_STL_INTERNAL_STATIC_ASSERT(indirect_binary_predicate<ranges::equal_to, projected<_It, _Pj>, const _Ty*>);

#if _USE_STD_VECTOR_ALGORITHMS
if (!_STD is_constant_evaluated()) {
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
if constexpr (is_same_v<_Pj, identity> && _Vector_alg_in_find_is_safe<_It, _Ty>) {
if (!_Within_limits(_First, _Val)) {
return 0;
}

return static_cast<iter_difference_t<_It>>(
__std_count_trivial(_To_address(_First), _To_address(_Last), _Val));
AlexGuteniev marked this conversation as resolved.
Show resolved Hide resolved
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
}
}
#endif // _USE_STD_VECTOR_ALGORITHMS

iter_difference_t<_It> _Count = 0;
for (; _First != _Last; ++_First) {
if (_STD invoke(_Proj, *_First) == _Val) {
Expand Down
319 changes: 215 additions & 104 deletions stl/inc/xutility

Large diffs are not rendered by default.

Loading