Improve SVE2 optimizations of class ResizerByteBilinear - #894
Merged
Conversation
Replace slow uzp deinterleave in X/Y interpolation with SVE2 mlalb/mlalt (maddubs), tbl/tbl2 shuffles, and narrowing stores. Use NEON-style paired pixel copies and merge gray load with horizontal interpolation. Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
Keep BGR samples in maddubs pair layout during the gather copy so horizontal interpolation can use mlalb/mlalt without a tbl2 window that dropped a channel at the 30-byte step. Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
ermig1979
marked this pull request as ready for review
August 20, 2026 08:36
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
ResizerByteBilinearby replacingsvuzpdeinterleave in X interpolation with SVE2svmlalb/svmlalt(adjacent unsigned 8-bit madd, same as SSEmaddubs).svtbl(no structuredld2/ld4). Gray load and X interpolation are merged viasvtbl+ madd. 3-channel gather writes samples in pair layout, then uses the same madd kernel.svrshr+svst1binstead of packing throughsvuzp. 1/2/4-channel gather uses NEON-style 2-pixel copies.docs/2026.html.Test plan
SimdSve2ResizerBilinear.cpp+SimdBaseResizerBilinear.cppfor AArch64+SVE2 and compared Sve2 vs BaseRun(104 size cases, channels 1–4):sve-max-vq=1(16-byte VL): passed=104 failed=0sve-max-vq=2(32-byte VL): passed=104 failed=0sve-max-vq=4(64-byte VL): passed=104 failed=0./Test "-r=.." -fi=Resizer -tt=1 -ts=1— ALL TESTS ARE FINISHED SUCCESSFULLY (x86 AVX-512 host vs Base), elapsed 89.4 s.