mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-24 02:19:41 +00:00
Add Windows ARM NEON dtection
This commit is contained in:
parent
f0e8a2b137
commit
15900246bb
4
config.h
4
config.h
@ -518,8 +518,8 @@ NAMESPACE_END
|
||||
#endif
|
||||
|
||||
#if !defined(CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE)
|
||||
# if (defined(CRYPTOPP_BOOL_ARM32) || defined(CRYPTOPP_BOOL_ARM64)) && ((CRYPTOPP_GCC_VERSION >= 40400) || (CRYPTOPP_CLANG_VERSION >= 20800))
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
# if (defined(CRYPTOPP_BOOL_ARM32) || defined(CRYPTOPP_BOOL_ARM64)) && ((CRYPTOPP_GCC_VERSION >= 40400) || (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_MSC_VERSION >= 1700))
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON) || defined(_M_ARM)
|
||||
# define CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE 1
|
||||
# endif
|
||||
# endif
|
||||
|
@ -395,8 +395,8 @@ NAMESPACE_END
|
||||
#endif
|
||||
|
||||
#if !defined(CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE)
|
||||
# if (defined(CRYPTOPP_BOOL_ARM32) || defined(CRYPTOPP_BOOL_ARM64)) && ((CRYPTOPP_GCC_VERSION >= 40400) || (CRYPTOPP_CLANG_VERSION >= 20800))
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
# if (defined(CRYPTOPP_BOOL_ARM32) || defined(CRYPTOPP_BOOL_ARM64)) && ((CRYPTOPP_GCC_VERSION >= 40400) || (CRYPTOPP_CLANG_VERSION >= 20800) || (CRYPTOPP_MSC_VERSION >= 1700))
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON) || defined(_M_ARM)
|
||||
# define CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE 1
|
||||
# endif
|
||||
# endif
|
||||
|
11
cpu.cpp
11
cpu.cpp
@ -23,9 +23,11 @@
|
||||
#endif
|
||||
|
||||
#if CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE
|
||||
#include <sys/auxv.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <arm_neon.h>
|
||||
# if defined(__linux__)
|
||||
# include <sys/auxv.h>
|
||||
# include <asm/hwcap.h>
|
||||
# endif
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
NAMESPACE_BEGIN(CryptoPP)
|
||||
@ -258,6 +260,7 @@ void DetectX86Features()
|
||||
}
|
||||
|
||||
// http://community.arm.com/groups/android-community/blog/2014/10/10/runtime-detection-of-cpu-features-on-an-armv8-a-cpu
|
||||
// http://stackoverflow.com/questions/26701262/how-to-check-the-existence-of-neon-on-arm
|
||||
#elif defined(CRYPTOPP_BOOL_ARM32) || defined (CRYPTOPP_BOOL_ARM64)
|
||||
|
||||
bool g_ArmDetectionDone = false;
|
||||
@ -282,6 +285,8 @@ void DetectArmFeatures()
|
||||
# elif defined(__linux__)
|
||||
const long hwcaps = getauxval(AT_HWCAP);
|
||||
g_hasNEON = !!(hwcaps & HWCAP_ARM_NEON);
|
||||
# elif defined(_WIN32) && defined(_M_ARM)
|
||||
g_hasNEON = true;
|
||||
# endif
|
||||
#endif
|
||||
*((volatile bool*)&g_ArmDetectionDone) = true;
|
||||
|
Loading…
Reference in New Issue
Block a user