#define STTNI_MASK SIDD_CMP_EQUAL_ANY | SIDD_UWORD_OPS | SIDD_LEAST_SIGNIFICANT
unsigned short * rules = curr_trie->getRules();
unsigned short * input = static_cast<unsigned short*>(static_cast<void*>(const_cast<char*>(string + position)));
unsigned short * pt = rules;
int index = 8, len = next_size;
#if defined(_STTNI)
if (usingSTTNI) {
const __m128i ahead = _mm_loadu_si128((__m128i*)input);
while (len > 0 && (index = _mm_cmpestri(ahead, actlen, _mm_loadu_si128((__m128i*)pt), len, STTNI_MASK)) == 8) {
pt += 8; len -= 8;
}
}
else
#endif
{
while (len > 0 && (index = pcompstri_eqany(input, (actlen > 8? 8 : actlen), pt, (len > 8? 8 : len))) == 8) {
pt += 8; len -= 8;
}
}
if (index == 8) return NULL;
index += (pt - rules);