mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
renamed matcher functions, added new ones for Vermicelli
This commit is contained in:
committed by
Konstantinos Margaritis
parent
16e5e2ae64
commit
5eabceddcf
@@ -63,7 +63,7 @@ static really_inline
|
||||
const u8 *fwdBlock(SuperVector<S> mask_lo, SuperVector<S> mask_hi, SuperVector<S> chars, const u8 *buf) {
|
||||
SuperVector<S> v = blockSingleMask(mask_lo, mask_hi, chars);
|
||||
|
||||
return firstMatch<S>(buf, v);
|
||||
return first_zero_match_inverted<S>(buf, v);
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
@@ -71,7 +71,7 @@ static really_inline
|
||||
const u8 *revBlock(SuperVector<S> mask_lo, SuperVector<S> mask_hi, SuperVector<S> chars, const u8 *buf) {
|
||||
SuperVector<S> v = blockSingleMask(mask_lo, mask_hi, chars);
|
||||
|
||||
return lastMatch<S>(buf, v);
|
||||
return last_zero_match_inverted<S>(buf, v);
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
@@ -80,7 +80,7 @@ const u8 *fwdBlockDouble(SuperVector<S> mask1_lo, SuperVector<S> mask1_hi, Super
|
||||
|
||||
SuperVector<S> mask = blockDoubleMask(mask1_lo, mask1_hi, mask2_lo, mask2_hi, chars);
|
||||
|
||||
return firstMatch<S>(buf, mask);
|
||||
return first_zero_match_inverted<S>(buf, mask);
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
|
@@ -56,7 +56,7 @@ static really_inline
|
||||
const u8 *fwdBlock(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_mask_lo_highset, SuperVector<S> chars, const u8 *buf) {
|
||||
SuperVector<S> res = blockSingleMask(shuf_mask_lo_highclear, shuf_mask_lo_highset, chars);
|
||||
|
||||
return firstMatch<S>(buf, res);
|
||||
return first_zero_match_inverted<S>(buf, res);
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
@@ -120,7 +120,7 @@ static really_inline
|
||||
const u8 *revBlock(SuperVector<S> shuf_mask_lo_highclear, SuperVector<S> shuf_mask_lo_highset, SuperVector<S> v,
|
||||
const u8 *buf) {
|
||||
SuperVector<S> res = blockSingleMask(shuf_mask_lo_highclear, shuf_mask_lo_highset, v);
|
||||
return lastMatch<S>(buf, res);
|
||||
return last_zero_match_inverted<S>(buf, res);
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
|
@@ -31,12 +31,6 @@
|
||||
* \brief Shufti: character class acceleration.
|
||||
*/
|
||||
|
||||
#ifndef SHUFTI_SIMD_X86_HPP
|
||||
#define SHUFTI_SIMD_X86_HPP
|
||||
|
||||
#include "util/supervector/supervector.hpp"
|
||||
#include "util/match.hpp"
|
||||
|
||||
template <uint16_t S>
|
||||
static really_inline
|
||||
const SuperVector<S> blockSingleMask(SuperVector<S> mask_lo, SuperVector<S> mask_hi, SuperVector<S> chars) {
|
||||
@@ -44,12 +38,10 @@ const SuperVector<S> blockSingleMask(SuperVector<S> mask_lo, SuperVector<S> mask
|
||||
|
||||
SuperVector<S> c_lo = chars & low4bits;
|
||||
SuperVector<S> c_hi = chars.template vshr_64_imm<4>() & low4bits;
|
||||
c_lo = mask_lo.template pshufb(c_lo);
|
||||
c_hi = mask_hi.template pshufb(c_hi);
|
||||
c_lo = mask_lo.pshufb(c_lo);
|
||||
c_hi = mask_hi.pshufb(c_hi);
|
||||
|
||||
SuperVector c = c_lo & c_hi;
|
||||
|
||||
return c.eq(SuperVector<S>::Zeroes());
|
||||
return (c_lo & c_hi).eq(SuperVector<S>::Zeroes());
|
||||
}
|
||||
|
||||
template <uint16_t S>
|
||||
@@ -80,5 +72,3 @@ SuperVector<S> blockDoubleMask(SuperVector<S> mask1_lo, SuperVector<S> mask1_hi,
|
||||
|
||||
return c.eq(SuperVector<S>::Ones());
|
||||
}
|
||||
|
||||
#endif // SHUFTI_SIMD_X86_HPP
|
||||
|
Reference in New Issue
Block a user