Skip to content

simd: convert rshift64 macros to functions and fix simd_utils bugs#376

Merged
markos merged 1 commit intoVectorCamp:developfrom
AhnLab-OSSG:simd-utils-fix
Apr 6, 2026
Merged

simd: convert rshift64 macros to functions and fix simd_utils bugs#376
markos merged 1 commit intoVectorCamp:developfrom
AhnLab-OSSG:simd-utils-fix

Conversation

@byeonguk-jeong
Copy link
Copy Markdown

Convert rshift64_m128/m256/m512 macros to inline functions that support runtime (non-constant) shift amounts on x86, matching the existing lshift64 function implementations.

Also fix:

  • lshift64_m256/rshift64_m256 parameter type from int to unsigned in the non-256-bit fallback path (common/simd_utils.h)
  • isnonzero512: remove redundant self-OR operations
  • load512: fix alignment assertion to check m512 instead of m256

Fixes: 3f0f9e6 ("move x86 implementations of simd_utils.h to util/arch/x86/")
Fixes: 6ff4752 ("add scalar versions of the vectorized functions for architectures that don't support 256-bit/512-bit SIMD vectors such as ARM")
Fixes: 75aadb7 ("split arch-agnostic simd_utils.h functions into the common file")

@AhnLab-OSS @AhnLab-OSSG

Convert rshift64_m128/m256/m512 macros to inline functions that
support runtime (non-constant) shift amounts on x86, matching the
existing lshift64 function implementations.

Also fix:
- lshift64_m256/rshift64_m256 parameter type from int to unsigned in
  the non-256-bit fallback path (common/simd_utils.h)
- isnonzero512: remove redundant self-OR operations
- load512: fix alignment assertion to check m512 instead of m256

Fixes: 3f0f9e6 ("move x86 implementations of simd_utils.h to util/arch/x86/")
Fixes: 6ff4752 ("add scalar versions of the vectorized functions for architectures that don't support 256-bit/512-bit SIMD vectors such as ARM")
Fixes: 75aadb7 ("split arch-agnostic simd_utils.h functions into the common file")

Signed-off-by: Byeonguk Jeong <jungbu2855@gmail.com>
Copy link
Copy Markdown

@markos markos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, the remaining tests are because of SSE2 related issues on SIMDe emulated port. Thanks again for the contribution!

@markos markos merged commit 3076ffb into VectorCamp:develop Apr 6, 2026
85 of 87 checks passed
@byeonguk-jeong byeonguk-jeong deleted the simd-utils-fix branch April 8, 2026 00:11
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