31 #define SINDEX_INTERNAL(y, x, log_mult, width) ((1 << log_mult) * (x & ((1 << width) - 1)))
33 #define SLOAD(x) *(STYPE *restrict)(x)
34 #define FUNC_NAME SCACTileSearchSmall256
35 #define SINDEX(y, x) SINDEX_INTERNAL(y, x, 8, 15)
51 uint8_t mpm_bitarray[
ctx->mpm_bitarray_size];
52 memset(mpm_bitarray, 0,
ctx->mpm_bitarray_size);
54 const uint8_t* restrict xlate =
ctx->translate_table;
57 int c = xlate[buf[0]];
59 if (buflen >= (4 +
EXTRA) && ((uintptr_t)buf & 0x3) == 0) {
64 while ((i +
EXTRA) < (buflen & ~0x3)) {
66 index =
SINDEX(index, state);
67 state =
SLOAD(state_table + index + c);
68 c = xlate[
BYTE1(data)];
70 matches = CheckMatch(
ctx, pmq, buf, buflen, state, i, matches, mpm_bitarray);
73 index =
SINDEX(index, state);
74 state =
SLOAD(state_table + index + c);
75 c = xlate[
BYTE2(data)];
77 matches = CheckMatch(
ctx, pmq, buf, buflen, state, i, matches, mpm_bitarray);
80 index =
SINDEX(index, state);
81 state =
SLOAD(state_table + index + c);
82 c = xlate[
BYTE3(data)];
84 matches = CheckMatch(
ctx, pmq, buf, buflen, state, i, matches, mpm_bitarray);
88 index =
SINDEX(index, state);
89 state =
SLOAD(state_table + index + c);
90 c = xlate[
BYTE0(data)];
92 matches = CheckMatch(
ctx, pmq, buf, buflen, state, i, matches, mpm_bitarray);
98 for (; i < buflen; i++) {
100 index =
SINDEX(index, state);
101 state =
SLOAD(state_table + index + c);
105 matches = CheckMatch(
ctx, pmq, buf, buflen, state, i, matches, mpm_bitarray);