mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-15 17:02:14 +03:00
fix SIMDe emulation builds on Arm, add native translation from x86 for comparison
This commit is contained in:
committed by
Konstantinos Margaritis
parent
b0d9c7f879
commit
1fb601f3a9
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017, Intel Corporation
|
||||
* Copyright (c) 2020-2023, VectorCamp PC
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -29,28 +30,30 @@
|
||||
#include "config.h"
|
||||
#include "hs_common.h"
|
||||
#include "ue2common.h"
|
||||
#if !defined(VS_SIMDE_BACKEND)
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
#include "util/arch/x86/cpuid_inline.h"
|
||||
#elif defined(ARCH_AARCH64)
|
||||
#include "util/arch/arm/cpuid_inline.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
HS_PUBLIC_API
|
||||
hs_error_t HS_CDECL hs_valid_platform(void) {
|
||||
/* Hyperscan requires SSSE3, anything else is a bonus */
|
||||
#if defined(ARCH_IA32) || defined(ARCH_X86_64)
|
||||
#if !defined(VS_SIMDE_BACKEND) && (defined(ARCH_IA32) || defined(ARCH_X86_64))
|
||||
if (check_ssse3()) {
|
||||
return HS_SUCCESS;
|
||||
} else {
|
||||
return HS_ARCH_ERROR;
|
||||
}
|
||||
#elif defined(ARCH_ARM32) || defined(ARCH_AARCH64)
|
||||
#elif !defined(VS_SIMDE_BACKEND) && (defined(ARCH_ARM32) || defined(ARCH_AARCH64))
|
||||
if (check_neon()) {
|
||||
return HS_SUCCESS;
|
||||
} else {
|
||||
return HS_ARCH_ERROR;
|
||||
}
|
||||
#elif defined(ARCH_PPC64EL) || defined(SIMDE_BACKEND)
|
||||
#elif defined(ARCH_PPC64EL) || defined(VS_SIMDE_BACKEND)
|
||||
return HS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user