mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
should fix it for fat binaries
This commit is contained in:
parent
317f882cda
commit
5a34d8140b
@ -951,6 +951,11 @@ else ()
|
|||||||
if (NOT BUILD_AVX512VBMI)
|
if (NOT BUILD_AVX512VBMI)
|
||||||
set (DISPATCHER_DEFINE "${DISPATCHER_DEFINE} -DDISABLE_AVX512VBMI_DISPATCH")
|
set (DISPATCHER_DEFINE "${DISPATCHER_DEFINE} -DDISABLE_AVX512VBMI_DISPATCH")
|
||||||
endif (NOT BUILD_AVX512VBMI)
|
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
|
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}")
|
||||||
|
|
||||||
|
@ -78,14 +78,10 @@
|
|||||||
#define check_avx512vbmi() (0)
|
#define check_avx512vbmi() (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BUILD_SSE2_SIMDE)
|
#if defined(VS_SIMDE_BACKEND)
|
||||||
#if defined(HAVE_SSE2)
|
#define CHECK_SSE_LAST() (1)
|
||||||
#define CHECK_SSE_LAST (1)
|
|
||||||
#else
|
#else
|
||||||
#define CHECK_SSE_LAST (0)
|
#define CHECK_SSE_LAST() check_ssse3()
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define CHECK_SSE_LAST check_ssse3
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CREATE_DISPATCH(RTYPE, NAME, ...) \
|
#define CREATE_DISPATCH(RTYPE, NAME, ...) \
|
||||||
|
18
src/hs.cpp
18
src/hs.cpp
@ -198,15 +198,21 @@ 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_ssse3()) {
|
if (!CHECK_SSE_FUNC()) {
|
||||||
*db = nullptr;
|
*db = nullptr;
|
||||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
return HS_ARCH_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif // arch
|
||||||
#endif
|
#endif // FAT_RUNTIME
|
||||||
|
|
||||||
if (!checkMode(mode, comp_error)) {
|
if (!checkMode(mode, comp_error)) {
|
||||||
*db = nullptr;
|
*db = nullptr;
|
||||||
@ -324,7 +330,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_ssse3()) {
|
if (!CHECK_SSE_FUNC()) {
|
||||||
*db = nullptr;
|
*db = nullptr;
|
||||||
*comp_error = generateCompileError("Unsupported architecture", -1);
|
*comp_error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
return HS_ARCH_ERROR;
|
||||||
@ -504,7 +510,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_ssse3()) {
|
if (!CHECK_SSE_FUNC()) {
|
||||||
*error = generateCompileError("Unsupported architecture", -1);
|
*error = generateCompileError("Unsupported architecture", -1);
|
||||||
return HS_ARCH_ERROR;
|
return HS_ARCH_ERROR;
|
||||||
}
|
}
|
||||||
@ -637,7 +643,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_ssse3()) {
|
if (!CHECK_SSE_FUNC()) {
|
||||||
return HS_ARCH_ERROR;
|
return HS_ARCH_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user