Skip to content

Refactor SSE4.1 AddFeatureDifference to unaligned loads and stores - #1015

Merged
ermig1979 merged 1 commit into
devfrom
cursor/sse41-add-feature-difference-unaligned-26f9
Sep 25, 2026
Merged

ermig1979 merged 1 commit into
devfrom
cursor/sse41-add-feature-difference-unaligned-26f9

Conversation

@ermig1979

@ermig1979 ermig1979 commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Refactors Sse41::AddFeatureDifference in src/Simd/SimdSse41AddFeatureDifference.cpp to match the recent SSE4.1 unaligned-access style:

  • Removes pointer and stride alignment checks and the aligned/unaligned dispatch.
  • Loads and stores with _mm_loadu_si128 and _mm_storeu_si128 directly, instead of Load<align>() / Store<align>().
  • Keeps the existing feature-difference and weighted-square helpers. No new calculation macros.

Test plan

  • Configure and build with g++ (SIMD_SHARED=ON, AVX-512 and AMX disabled, SSE4.1 and AVX2 enabled).
  • Run ./Test "-r=.." -fi=AddFeatureDifference -tt=1 -ts=1 from build/. All tests finished successfully. Base, SSE4.1, and AVX2 results matched.
Open in Web Open in Cursor 

Remove alignment checks and use unaligned SSE4.1 load and store intrinsics directly.

Co-authored-by: Ihar Yermalayeu <ermig1979@gmail.com>
@ermig1979
ermig1979 marked this pull request as ready for review September 25, 2026 07:34
@ermig1979
ermig1979 merged commit d456ee3 into dev Sep 25, 2026
2 checks 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