Skip to content

Improve SVE2 optimizations of classes ResizerByteArea1x1 and ResizerByteArea2x2 - #893

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-resizer-area-723e
Aug 20, 2026
Merged

Improve SVE2 optimizations of classes ResizerByteArea1x1 and ResizerByteArea2x2#893
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-resizer-area-723e

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Speed up SVE2 ResizerByteArea1x1 by loading full uint8 vectors, unpacking to int32, and multiplying by area weights, instead of svld1ub_s32 (only svcntw() bytes per iteration). Horizontal reduction for 3/4 channels uses predicated int32 accumulation and svst1b.
  • Speed up SVE2 ResizerByteArea2x2 for channels 3 and 4: pair same-channel neighbors with svtbl / svtbl2 (no svld3/svld4), sum 2x2 blocks with SVE2 svadalp, then widen and multiply. BGR uses a two-vector step (AlignLoAny(2*VL, 6)) so 128-bit SVE processes 30 source bytes instead of 12.
  • Record both classes under release 7.2.165 in docs/2026.html.

Test plan

  • Native Release ./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.6 s.
  • Cross-compiled SimdSve2ResizerArea.cpp + SimdBaseResizerArea.cpp for AArch64+SVE2 and compared Sve2 vs Base Run on 240 size/channel cases per vector length:
    • sve-max-vq=1 (16-byte VL): OK
    • sve-max-vq=2 (32-byte VL): OK
    • sve-max-vq=4 (64-byte VL): OK
Open in Web Open in Cursor 

Process full byte vectors in the 1x1 area row update instead of widening
one int32 lane at a time, and vectorize horizontal reduction for 3/4
channels. For 2x2, pair same-channel neighbors with tbl/tbl2 and SVE2
svadalp, using a two-vector BGR step so channels 3 and 4 keep high
utilization at 128-bit SVE length.

Co-authored-by: igor.ermolaev <igor.ermolaev@altezza.org>
@ermig1979
ermig1979 marked this pull request as ready for review August 20, 2026 07:19
@ermig1979
ermig1979 merged commit 29c78c0 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