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)
|
endif (NOT BUILD_AVX512VBMI)
|
||||||
if(BUILD_SSE2_SIMDE)
|
if(BUILD_SSE2_SIMDE)
|
||||||
set (DISPATCHER_DEFINE "${DISPATCHER_DEFINE} -DVS_SIMDE_BACKEND -DVS_SIMDE_NATIVE -march=core2 -msse2")
|
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)
|
endif(BUILD_SSE2_SIMDE)
|
||||||
set_source_files_properties(src/dispatcher.c PROPERTIES
|
set_source_files_properties(src/dispatcher.c PROPERTIES
|
||||||
COMPILE_FLAGS "-Wno-unused-parameter -Wno-unused-function ${DISPATCHER_DEFINE}")
|
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;
|
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(FAT_RUNTIME)
|
||||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||||
if (!CHECK_SSE_FUNC()) {
|
if (!check_ssse3()) {
|
||||||
*db = nullptr;
|
*db = nullptr;
|
||||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
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(FAT_RUNTIME)
|
||||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||||
if (!CHECK_SSE_FUNC()) {
|
if (!check_ssse3()) {
|
||||||
*db = nullptr;
|
*db = nullptr;
|
||||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
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(FAT_RUNTIME)
|
||||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||||
if (!CHECK_SSE_FUNC()) {
|
if (!check_ssse3()) {
|
||||||
*error = generateCompileError("Unsupported architecture", -1);
|
*error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
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) {
|
hs_error_t HS_CDECL hs_free_compile_error(hs_compile_error_t *error) {
|
||||||
#if defined(FAT_RUNTIME)
|
#if defined(FAT_RUNTIME)
|
||||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||||
if (!CHECK_SSE_FUNC()) {
|
if (!check_ssse3()) {
|
||||||
return HS_ARCH_ERROR;
|
return HS_ARCH_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -210,9 +210,13 @@ int check_avx512vbmi(void) {
|
|||||||
|
|
||||||
static inline
|
static inline
|
||||||
int check_ssse3(void) {
|
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;
|
unsigned int eax, ebx, ecx, edx;
|
||||||
cpuid(1, 0, &eax, &ebx, &ecx, &edx);
|
cpuid(1, 0, &eax, &ebx, &ecx, &edx);
|
||||||
return !!(ecx & CPUID_SSSE3);
|
return !!(ecx & CPUID_SSSE3);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline
|
static inline
|
||||||
|
Loading…
x
Reference in New Issue
Block a user