-
Notifications
You must be signed in to change notification settings - Fork 1.6k
mismatch vectorization
#4495
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
Merged
Stephan T. Lavavej (StephanTLavavej)
merged 37 commits into
microsoft:main
from
AlexGuteniev:mismatch
Mar 28, 2024
Merged
mismatch vectorization
#4495
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
9c4e4c2
mismatch vectorization
AlexGuteniev 4c008fd
format
AlexGuteniev b69c04c
more format
AlexGuteniev 38633a0
wrong step
AlexGuteniev ac2786d
ADL
AlexGuteniev 2d0cff9
types
AlexGuteniev f45dbbd
constant
AlexGuteniev b0d6ece
let's have sized functions as usual
AlexGuteniev 4fd7b43
format
AlexGuteniev fef5885
inline, see #4496
AlexGuteniev 2bd29b0
transition
AlexGuteniev 5b1dc1b
format
AlexGuteniev abc7e96
better format
AlexGuteniev 8a897d7
Merge branch 'main' into mismatch
StephanTLavavej 9c92384
`_Mismatch` => `__std_mismatch_impl` for consistency.
StephanTLavavej 57d8aee
ASan provocation!
AlexGuteniev d253100
format
AlexGuteniev fac4796
two
AlexGuteniev 1e6b258
really different
AlexGuteniev a0b05c8
expand comment on overrun
AlexGuteniev 5253b71
off by one
AlexGuteniev b9e8065
Whole range
AlexGuteniev 3b01b63
Fix preprocessor comments.
StephanTLavavej 4771515
Style: `inline` before return type.
StephanTLavavej 69ccaae
Drop unnecessary `_STD move()` calls.
StephanTLavavej 929fcfc
Store `size_t _Pos`, cast to each difference type.
StephanTLavavej bdd374e
Bugfix: Guard with `_Traits::_Sse_available()`.
StephanTLavavej 1284aa5
Style: `alignas` before `static constexpr`.
StephanTLavavej b0fbdca
Add an empty line, then clang-format suppression can be removed.
StephanTLavavej afa152d
Save 200 bytes by using a sliding window.
StephanTLavavej d0a7ce1
Mark `_Avx2_tail_mask_32` as `noexcept`.
StephanTLavavej 0d0e423
Add `const`.
StephanTLavavej 90e5f37
Drop unnecessary `std::`.
StephanTLavavej 82c651b
Include more headers.
StephanTLavavej d69c3d3
`PadsSizes` => `PadSizes`
StephanTLavavej eab5917
Comment cleanups.
StephanTLavavej f52e2d9
Move the definition of `test_mismatch_containers()`, no other changes.
StephanTLavavej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| #include <algorithm> | ||
| #include <benchmark/benchmark.h> | ||
| #include <cstddef> | ||
| #include <cstdint> | ||
| #include <ranges> | ||
| #include <vector> | ||
|
|
||
| using namespace std; | ||
|
|
||
| constexpr int64_t no_pos = -1; | ||
|
|
||
| template <class T> | ||
| void bm(benchmark::State& state) { | ||
| vector<T> a(static_cast<size_t>(state.range(0)), T{'.'}); | ||
| vector<T> b(static_cast<size_t>(state.range(0)), T{'.'}); | ||
|
|
||
| if (state.range(1) != no_pos) { | ||
| b.at(static_cast<size_t>(state.range(1))) = 'x'; | ||
| } | ||
|
|
||
| for (auto _ : state) { | ||
| benchmark::DoNotOptimize(ranges::mismatch(a, b)); | ||
| } | ||
| } | ||
|
|
||
| #define COMMON_ARGS Args({8, 3})->Args({24, 22})->Args({105, -1})->Args({4021, 3056}) | ||
|
|
||
| BENCHMARK(bm<uint8_t>)->COMMON_ARGS; | ||
| BENCHMARK(bm<uint16_t>)->COMMON_ARGS; | ||
| BENCHMARK(bm<uint32_t>)->COMMON_ARGS; | ||
| BENCHMARK(bm<uint64_t>)->COMMON_ARGS; | ||
|
|
||
| BENCHMARK_MAIN(); |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.