Skip to content

Improve SVE2 optimizations of class ResizerByteArea2x2 - #892

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-resizer-area-2x2-6b7d
Aug 20, 2026
Merged

Improve SVE2 optimizations of class ResizerByteArea2x2#892
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-resizer-area-2x2-6b7d

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rework SVE2 ResizerByteArea2x2 so the 2x2 area row update no longer gathers with four small svtbl loads per output vector.
  • Main path loads one source vector per row, pairs same-channel neighbors with svtbl (svext+identity for gray), adds 2x2 blocks with SVE2 svaddlb, widens to int32, and multiplies by the area weight. BGR uses a 6-byte-aligned step so pairs stay complete at any SVE length.
  • Vectorize ResizerByteAreaResult with predicated int32 accumulation and svst1b. Record the change in docs/2026.html for release 7.2.165.

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.5 s.
  • Portable simulation of shuffle + addlb vs Base::ResizerByteArea2x2RowUpdate: 4776 cases OK.
  • Cross-compiled SimdSve2ResizerArea.cpp for AArch64+SVE2.
  • Cross-compiled SVE2 kernels vs Base under QEMU:
    • sve-max-vq=1 (16-byte VL): 1800 cases OK
    • sve-max-vq=2 (32-byte VL): 1800 cases OK
    • sve-max-vq=4 (64-byte VL): 1800 cases OK
Open in Web Open in Cursor 

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
ermig1979 marked this pull request as ready for review August 20, 2026 06:52
@ermig1979
ermig1979 merged commit 635cd82 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