Improve SVE2 optimizations of class ResizerByteArea2x2 - #892
Merged
Conversation
Rewrite the Area 2x2 row update to load full SVE vectors, pair same-channel neighbors with svtbl, and horizontally add with svaddlb instead of four small tbl gathers per output vector. Also vectorize the area result store. Record the change in release notes for 7.2.165. Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
ermig1979
marked this pull request as ready for review
August 20, 2026 06:52
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ResizerByteArea2x2so the 2x2 area row update no longer gathers with four smallsvtblloads per output vector.svtbl(svext+identity for gray), adds 2x2 blocks with SVE2svaddlb, widens to int32, and multiplies by the area weight. BGR uses a 6-byte-aligned step so pairs stay complete at any SVE length.ResizerByteAreaResultwith predicated int32 accumulation andsvst1b. Record the change indocs/2026.htmlfor release 7.2.165.Test plan
./Test "-r=.." -fi=Resizer -tt=1 -ts=1— passed (x86 AVX-512 host vs Base), including Area (ArS) and AreaFast (ArF) for 1–4 channels. Elapsed 88.5 s.addlbvsBase::ResizerByteArea2x2RowUpdate: 4776 cases OK.SimdSve2ResizerArea.cppfor AArch64+SVE2.sve-max-vq=1(16-byte VL): 1800 cases OKsve-max-vq=2(32-byte VL): 1800 cases OKsve-max-vq=4(64-byte VL): 1800 cases OK