]> git.ipfire.org Git - thirdparty/vectorscan.git/commit
Right Shift in rshift64_m128 fallback path (ARM NEON) (#396) develop
authorByeonguk Jeong <jungbu2855@gmail.com>
Fri, 24 Apr 2026 08:48:05 +0000 (17:48 +0900)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2026 08:48:05 +0000 (11:48 +0300)
commit5b9c4e5678fb4e5669ec7f436ff84e5e88b4e84b
tree0bc19545b8f1b694d8276fd54ecca75e6d73c24e
parent87413ed5b5ae3e1aa605ac82613338772e426db0
Right Shift in rshift64_m128 fallback path (ARM NEON) (#396)

* Added testcase for issue #326, verified to work on Linux

* Fix cppcheck warnings

* Add comment pointing to the github issue

* simd: use unsigned shift intrinsics in ARM NEON rshift fallback paths

The fallback paths (when HAVE__BUILTIN_CONSTANT_P is not defined, i.e.
clang) in rshift_m128 and rshift64_m128 used vshlq_s32/vshlq_s64
(signed shift), which performs arithmetic right shift with sign
extension. This caused incorrect nibble extraction in shufti validation
when input bytes >= 0x80 landed at byte positions 7 or 15 within a
128-bit register.

Change all four shift helpers (lshift_m128, rshift_m128, lshift64_m128,
rshift64_m128) to use unsigned shifts.

Fixes: 4b41c5fe254e311d193b350a827c81885a30157a ("[NEON] simplify/optimize shift/align primitives")
Reported-by: Alexey Pismensky (#326)
Signed-off-by: Byeonguk Jeong <jungbu2855@gmail.com>
---------

Signed-off-by: Byeonguk Jeong <jungbu2855@gmail.com>
Co-authored-by: Konstantinos Margaritis <konstantinos@vectorcamp.gr>
src/util/arch/arm/simd_utils.h
unit/hyperscan/regressions.cpp