Introduce simd_any()/simd_eq_all(), optimize simd_hmax*() for Armv8 Neon #998
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.
Most of manually vectorized operations in StripedSmithWaterman.cpp are elementwise, and in such cases there is a single instruction emitted for both SSE/AVX and Neon, providing maximum performance on all the platforms.
But there are few places where in SSE/AVX case we need few instructions, and some of them don't have direct Neon equialent.
As a result, on Arm platform we have a long chain of Neon instructions exactly replicating what SSE/AVX instructions do, but what algorithm actually needs can be implemented with just a single Neon instruction.
A good example is existing simd_hmax8_sse() which returns maximum across vector.
For SSE it has 5 instructions:
Performant Neon implementation is just a single instruction:
Proposal is to introduce additional simd_any()/simd_eq_all() functions similar to existing simd_hmax*() functions, which cover those non-elementwise operations.
And then, for simd_any()/simd_eq_all()/simd_hmax*(), have separate SSE/AVX and Neon implementations providing best performance on each platform.