remove unneeded shifts

This commit is contained in:
Konstantinos Margaritis 2023-12-18 20:46:36 +02:00 committed by Konstantinos Margaritis
parent 0e2f6c1540
commit 5814d3298f
2 changed files with 2 additions and 14 deletions

View File

@ -37,7 +37,7 @@ static really_really_inline
hwlm_error_t single_zscan(const struct noodTable *n,const u8 *d, const u8 *buf,
typename SuperVector<S>::comparemask_type z, size_t len, const struct cb_info *cbi) {
while (unlikely(z)) {
typename SuperVector<S>::comparemask_type pos = SuperVector<S>::findLSB(z) >> Z_POSSHIFT;
typename SuperVector<S>::comparemask_type pos = SuperVector<S>::findLSB(z);
size_t matchPos = d - buf + pos;
DEBUG_PRINTF("match pos %zu\n", matchPos);
hwlmcb_rv_t rv = final(n, buf, len, n->msk_len != 1, cbi, matchPos);
@ -51,7 +51,7 @@ static really_really_inline
hwlm_error_t double_zscan(const struct noodTable *n,const u8 *d, const u8 *buf,
typename SuperVector<S>::comparemask_type z, size_t len, const struct cb_info *cbi) {
while (unlikely(z)) {
typename SuperVector<S>::comparemask_type pos = SuperVector<S>::findLSB(z) >> Z_POSSHIFT;
typename SuperVector<S>::comparemask_type pos = SuperVector<S>::findLSB(z);
size_t matchPos = d - buf + pos - 1;
DEBUG_PRINTF("match pos %zu\n", matchPos);
hwlmcb_rv_t rv = final(n, buf, len, true, cbi, matchPos);

View File

@ -48,18 +48,6 @@
#include <util/bitutils.h>
#if defined(HAVE_SIMD_512_BITS)
#define Z_POSSHIFT 0
#elif defined(HAVE_SIMD_256_BITS)
#define Z_POSSHIFT 0
#elif defined(HAVE_SIMD_128_BITS)
#if !defined(VS_SIMDE_BACKEND) && (defined(ARCH_ARM32) || defined(ARCH_AARCH64))
#define Z_POSSHIFT 2
#else
#define Z_POSSHIFT 0
#endif
#endif
// Define a common assume_aligned using an appropriate compiler built-in, if
// it's available. Note that we need to handle C or C++ compilation.
#ifdef __cplusplus