Introduce a 64-bit LimEx model.

On 64-bit platforms, the Limex 64 model is implemented in normal GPRs.
On 32-bit platforms, however, 128-bit SSE registers are used for the
runtime implementation.
This commit is contained in:
Alex Coyte
2016-08-26 14:17:41 +10:00
committed by Matthew Barr
parent 3cf4199879
commit a08e1dd690
28 changed files with 441 additions and 351 deletions

View File

@@ -30,8 +30,8 @@
\brief Limex Execution Engine Or:
How I Learned To Stop Worrying And Love The Preprocessor
This file includes utility functions which do not depend on the state size or
shift masks directly.
This file includes utility functions which do not depend on the size of the
state or shift masks directly.
*/
#ifndef LIMEX_RUNTIME_H
@@ -72,41 +72,6 @@ struct proto_cache {
const ReportID *reports;
};
// Shift macros for Limited NFAs. Defined in terms of uniform ops.
// LimExNFAxxx ptr in 'limex' and the current state in 's'
#define NFA_EXEC_LIM_SHIFT(nels_type, nels_i) \
(JOIN(lshift_, nels_type)( \
JOIN(and_, nels_type)(s, \
JOIN(load_, nels_type)(&limex->shift[nels_i])), \
limex->shiftAmount[nels_i]))
// Calculate the (limited model) successors for a number of variable shifts.
// Assumes current state in 's' and successors in 'succ'.
#define NFA_EXEC_GET_LIM_SUCC(gls_type) \
do { \
succ = NFA_EXEC_LIM_SHIFT(gls_type, 0); \
switch (limex->shiftCount) { \
case 8: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 7)); \
case 7: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 6)); \
case 6: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 5)); \
case 5: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 4)); \
case 4: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 3)); \
case 3: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 2)); \
case 2: \
succ = JOIN(or_, gls_type)(succ, NFA_EXEC_LIM_SHIFT(gls_type, 1)); \
case 1: \
case 0: \
; \
} \
} while (0)
#define PE_RV_HALT 1
#ifdef STATE_ON_STACK
@@ -170,6 +135,7 @@ int limexRunReports(const ReportID *reports, NfaCallback callback,
}
MAKE_GET_NFA_REPEAT_INFO(32)
MAKE_GET_NFA_REPEAT_INFO(64)
MAKE_GET_NFA_REPEAT_INFO(128)
MAKE_GET_NFA_REPEAT_INFO(256)
MAKE_GET_NFA_REPEAT_INFO(384)