Skip to content

Improve SVE2 optimizations of class ResizerByteBilinear - #894

Merged
ermig1979 merged 2 commits into
devfrom
cursor/improve-sve2-resizer-bilinear-d4a6
Aug 20, 2026
Merged

Improve SVE2 optimizations of class ResizerByteBilinear#894
ermig1979 merged 2 commits into
devfrom
cursor/improve-sve2-resizer-bilinear-d4a6

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Speed up SVE2 ResizerByteBilinear by replacing svuzp deinterleave in X interpolation with SVE2 svmlalb/svmlalt (adjacent unsigned 8-bit madd, same as SSE maddubs).
  • Reorder 2/4-channel paired pixels with svtbl (no structured ld2/ld4). Gray load and X interpolation are merged via svtbl + madd. 3-channel gather writes samples in pair layout, then uses the same madd kernel.
  • Y interpolation uses svrshr + svst1b instead of packing through svuzp. 1/2/4-channel gather uses NEON-style 2-pixel copies.
  • Record the improvement under release 7.2.165 in docs/2026.html.

Test plan

  • Cross-compiled SimdSve2ResizerBilinear.cpp + SimdBaseResizerBilinear.cpp for AArch64+SVE2 and compared Sve2 vs Base Run (104 size cases, channels 1–4):
    • sve-max-vq=1 (16-byte VL): passed=104 failed=0
    • sve-max-vq=2 (32-byte VL): passed=104 failed=0
    • sve-max-vq=4 (64-byte VL): passed=104 failed=0
  • Native Release ./Test "-r=.." -fi=Resizer -tt=1 -ts=1 — ALL TESTS ARE FINISHED SUCCESSFULLY (x86 AVX-512 host vs Base), elapsed 89.4 s.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 20, 2026 07:31
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
ermig1979 marked this pull request as ready for review August 20, 2026 08:36
@ermig1979
ermig1979 merged commit 3ad9309 into dev Aug 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants