mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-19 02:30:35 +03:00
Move SVE functions into their own files.
Change-Id: I995ba4b7d2b558ee403693ee45d747d414d3b177
This commit is contained in:
committed by
Konstantinos Margaritis
parent
e1f0f6baf7
commit
3bdd48fd61
114
src/nfa/lbr.c
114
src/nfa/lbr.c
@@ -362,56 +362,6 @@ char lbrRevScanNVerm(const struct NFA *nfa, const u8 *buf,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SVE2
|
||||
|
||||
static really_inline
|
||||
char lbrRevScanVerm16(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end, size_t *loc) {
|
||||
assert(begin <= end);
|
||||
assert(nfa->type == LBR_NFA_VERM16);
|
||||
const struct lbr_verm16 *l = getImplNfa(nfa);
|
||||
|
||||
if (begin == end) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const u8 *ptr = rvermicelli16Exec(l->mask, buf + begin, buf + end);
|
||||
if (ptr == buf + begin - 1) {
|
||||
DEBUG_PRINTF("no escape found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(loc);
|
||||
*loc = ptr - buf;
|
||||
DEBUG_PRINTF("escape found at offset %zu\n", *loc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static really_inline
|
||||
char lbrRevScanNVerm16(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end, size_t *loc) {
|
||||
assert(begin <= end);
|
||||
assert(nfa->type == LBR_NFA_NVERM16);
|
||||
const struct lbr_verm16 *l = getImplNfa(nfa);
|
||||
|
||||
if (begin == end) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const u8 *ptr = rnvermicelli16Exec(l->mask, buf + begin, buf + end);
|
||||
if (ptr == buf + begin - 1) {
|
||||
DEBUG_PRINTF("no escape found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(loc);
|
||||
*loc = ptr - buf;
|
||||
DEBUG_PRINTF("escape found at offset %zu\n", *loc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // HAVE_SVE2
|
||||
|
||||
static really_inline
|
||||
char lbrRevScanShuf(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end,
|
||||
@@ -518,56 +468,6 @@ char lbrFwdScanNVerm(const struct NFA *nfa, const u8 *buf,
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SVE2
|
||||
|
||||
static really_inline
|
||||
char lbrFwdScanVerm16(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end, size_t *loc) {
|
||||
assert(begin <= end);
|
||||
assert(nfa->type == LBR_NFA_VERM16);
|
||||
const struct lbr_verm16 *l = getImplNfa(nfa);
|
||||
|
||||
if (begin == end) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const u8 *ptr = vermicelli16Exec(l->mask, buf + begin, buf + end);
|
||||
if (ptr == buf + end) {
|
||||
DEBUG_PRINTF("no escape found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(loc);
|
||||
*loc = ptr - buf;
|
||||
DEBUG_PRINTF("escape found at offset %zu\n", *loc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static really_inline
|
||||
char lbrFwdScanNVerm16(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end, size_t *loc) {
|
||||
assert(begin <= end);
|
||||
assert(nfa->type == LBR_NFA_NVERM16);
|
||||
const struct lbr_verm16 *l = getImplNfa(nfa);
|
||||
|
||||
if (begin == end) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const u8 *ptr = nvermicelli16Exec(l->mask, buf + begin, buf + end);
|
||||
if (ptr == buf + end) {
|
||||
DEBUG_PRINTF("no escape found\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(loc);
|
||||
*loc = ptr - buf;
|
||||
DEBUG_PRINTF("escape found at offset %zu\n", *loc);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif // HAVE_SVE2
|
||||
|
||||
static really_inline
|
||||
char lbrFwdScanShuf(const struct NFA *nfa, const u8 *buf,
|
||||
size_t begin, size_t end,
|
||||
@@ -625,18 +525,12 @@ char lbrFwdScanTruf(const struct NFA *nfa, const u8 *buf,
|
||||
#define ENGINE_ROOT_NAME NVerm
|
||||
#include "lbr_common_impl.h"
|
||||
|
||||
#ifdef HAVE_SVE2
|
||||
|
||||
#define ENGINE_ROOT_NAME Verm16
|
||||
#include "lbr_common_impl.h"
|
||||
|
||||
#define ENGINE_ROOT_NAME NVerm16
|
||||
#include "lbr_common_impl.h"
|
||||
|
||||
#endif // HAVE_SVE2
|
||||
|
||||
#define ENGINE_ROOT_NAME Shuf
|
||||
#include "lbr_common_impl.h"
|
||||
|
||||
#define ENGINE_ROOT_NAME Truf
|
||||
#include "lbr_common_impl.h"
|
||||
|
||||
#ifdef HAVE_SVE2
|
||||
#include "lbr_sve.h"
|
||||
#endif
|
||||
Reference in New Issue
Block a user