mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
remove unneeded shifts
This commit is contained in:
parent
0e2f6c1540
commit
5814d3298f
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user