Skip to content

Improve SVE2 optimizations of SimdSobelDy - #891

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-sobel-dy-46c3
Aug 20, 2026
Merged

Improve SVE2 optimizations of SimdSobelDy#891
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-sobel-dy-46c3

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Rewrite the ARM SVE2 implementation of SimdSobelDy so it is no longer slower than the NEON path.

The previous SVE2 version loaded half-width 16-bit lanes (svld1ub_s16) and processed only svcnth() pixels per iteration. The new path:

  • loads full 8-bit SVE vectors
  • uses SVE2 widening 1-2-1 horizontals (svaddlb / svaddlt / svmlalb / svmlalt)
  • reorders even/odd 16-bit results with svzip1 / svzip2 and scalar stores (no structured svst2)
  • reuses per-row horizontal sums across 2 and 4 output rows
  • unrolls two vectors in the inner loop
  • keeps first/last columns as scalar edge cases

docs/2026.html release 7.2.165 Improving section is updated. Test::SobelDyAutoTest extra SVE2 sizes now use svcntb().

Testing

  • Native Test -fi=SobelDy (Base / SSE4.1 / AVX2 / AVX-512BW): passed
  • Cross-compiled SVE2 vs Base under QEMU: 4758 cases at VL=16, 7638 at VL=32, 13398 at VL=64, and 4758 on neoverse-n2: all passed
Open in Web Open in Cursor 

Rewrite the ARM SVE2 path to load full 8-bit vectors, use SVE2
widening 1-2-1 horizontals, and reuse per-row sums across 2/4 output
rows so it is no longer slower than NEON.

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