SHENG32: 32-state 1-byte shuffle based DFA.

This commit is contained in:
Chang, Harry
2018-11-01 16:33:58 +08:00
committed by Konstantinos Margaritis
parent 6f8bfa1854
commit 2cde84c96d
13 changed files with 1676 additions and 45 deletions

View File

@@ -72,6 +72,7 @@ enum NFAEngineType {
TAMARAMA_NFA, /**< magic nfa container */
MCSHENG_NFA_8, /**< magic pseudo nfa */
MCSHENG_NFA_16, /**< magic pseudo nfa */
SHENG_NFA_32, /**< magic pseudo nfa */
/** \brief bogus NFA - not used */
INVALID_NFA
};
@@ -157,10 +158,26 @@ static really_inline int isGoughType(u8 t) {
}
/** \brief True if the given type (from NFA::type) is a Sheng DFA. */
static really_inline int isShengType(u8 t) {
static really_inline int isSheng16Type(u8 t) {
return t == SHENG_NFA;
}
#if defined(HAVE_AVX512VBMI)
/** \brief True if the given type (from NFA::type) is a Sheng32 DFA. */
static really_inline int isSheng32Type(u8 t) {
return t == SHENG_NFA_32;
}
#endif
/** \brief True if the given type (from NFA::type) is a Sheng/Sheng32 DFA. */
static really_inline int isShengType(u8 t) {
#if defined(HAVE_AVX512VBMI)
return t == SHENG_NFA || t == SHENG_NFA_32;
#else
return t == SHENG_NFA;
#endif
}
/**
* \brief True if the given type (from NFA::type) is a McClellan, Gough or
* Sheng DFA.