mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
should fix the last failing test in non-fat
This commit is contained in:
parent
5a34d8140b
commit
0711123f12
@ -953,8 +953,6 @@ else ()
|
||||
endif (NOT BUILD_AVX512VBMI)
|
||||
if(BUILD_SSE2_SIMDE)
|
||||
set (DISPATCHER_DEFINE "${DISPATCHER_DEFINE} -DVS_SIMDE_BACKEND -DVS_SIMDE_NATIVE -march=core2 -msse2")
|
||||
set_source_files_properties(src/hs.cpp PROPERTIES
|
||||
COMPILE_FLAGS "-DVS_SIMDE_BACKEND -DVS_SIMDE_NATIVE -march=core2 -msse2")
|
||||
endif(BUILD_SSE2_SIMDE)
|
||||
set_source_files_properties(src/dispatcher.c PROPERTIES
|
||||
COMPILE_FLAGS "-Wno-unused-parameter -Wno-unused-function ${DISPATCHER_DEFINE}")
|
||||
|
14
src/hs.cpp
14
src/hs.cpp
@ -198,15 +198,9 @@ hs_compile_multi_int(const char *const *expressions, const unsigned *flags,
|
||||
return HS_COMPILER_ERROR;
|
||||
}
|
||||
|
||||
#if defined(VS_SIMDE_NATIVE) && (defined(ARCH_IA32) || defined(ARCH_X86_64))
|
||||
#define CHECK_SSE_FUNC() (1)
|
||||
#else
|
||||
#define CHECK_SSE_FUNC() check_ssse3()
|
||||
#endif
|
||||
|
||||
#if defined(FAT_RUNTIME)
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
if (!CHECK_SSE_FUNC()) {
|
||||
if (!check_ssse3()) {
|
||||
*db = nullptr;
|
||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||
return HS_ARCH_ERROR;
|
||||
@ -330,7 +324,7 @@ hs_compile_lit_multi_int(const char *const *expressions, const unsigned *flags,
|
||||
}
|
||||
#if defined(FAT_RUNTIME)
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
if (!CHECK_SSE_FUNC()) {
|
||||
if (!check_ssse3()) {
|
||||
*db = nullptr;
|
||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||
return HS_ARCH_ERROR;
|
||||
@ -510,7 +504,7 @@ hs_error_t hs_expression_info_int(const char *expression, unsigned int flags,
|
||||
|
||||
#if defined(FAT_RUNTIME)
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
if (!CHECK_SSE_FUNC()) {
|
||||
if (!check_ssse3()) {
|
||||
*error = generateCompileError("Unsupported architecture", -1);
|
||||
return HS_ARCH_ERROR;
|
||||
}
|
||||
@ -643,7 +637,7 @@ extern "C" HS_PUBLIC_API
|
||||
hs_error_t HS_CDECL hs_free_compile_error(hs_compile_error_t *error) {
|
||||
#if defined(FAT_RUNTIME)
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
if (!CHECK_SSE_FUNC()) {
|
||||
if (!check_ssse3()) {
|
||||
return HS_ARCH_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
@ -210,9 +210,13 @@ int check_avx512vbmi(void) {
|
||||
|
||||
static inline
|
||||
int check_ssse3(void) {
|
||||
#if defined(VS_SIMDE_NATIVE) && (defined(ARCH_IA32) || defined(ARCH_X86_64))
|
||||
return 1;
|
||||
#else
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
cpuid(1, 0, &eax, &ebx, &ecx, &edx);
|
||||
return !!(ecx & CPUID_SSSE3);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline
|
||||
|
Loading…
x
Reference in New Issue
Block a user