Skip to content

Improve SVE2 optimizations of SimdSegmentationChangeIndex - #895

Merged
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-segmentation-change-index-d909
Aug 20, 2026
Merged

Improve SVE2 optimizations of SimdSegmentationChangeIndex#895
ermig1979 merged 1 commit into
devfrom
cursor/improve-sve2-segmentation-change-index-d909

Conversation

@ermig1979

@ermig1979 ermig1979 commented Aug 20, 2026

Copy link
Copy Markdown
Owner

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

The previous SVE2 version rebuilt a svwhilelt predicate on every inner-loop iteration. The new path:

  • uses a hoisted svptrue_b8() predicate for the main body
  • unrolls four full SVE vectors per inner iteration (ChangeIndex4)
  • finishes remaining full vectors, then a single tail predicate
  • avoids macros

docs/2026.html release 7.2.165 Improving section is updated. Test::SegmentationChangeIndexAutoTest adds extra SVE2 sizes for tails and width < svcntb().

Testing

  • Native Test -fi=SegmentationChangeIndex (Base / SSE4.1 / AVX2 / AVX-512BW): passed
  • Cross-compiled SVE2 vs Base/NEON under QEMU: passed at VL=16 (neoverse-n2 and max,sve128), VL=64 (max), including extra sizes A+1, A+3, and 3x4
Open in Web Open in Cursor 

Replace the per-iteration WHILELT loop with a ptrue 4-vector body,
a residual full-vector pass, and a single tail predicate so the ARM
SVE2 path 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 09:02
@ermig1979
ermig1979 merged commit 9957339 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