Improve include logic for <arm_acle.h> under GCC

This commit is contained in:
Jeffrey Walton 2016-05-06 06:56:08 -04:00
parent 13789c82bf
commit 19ac7b0be8

5
cpu.h
View File

@ -20,7 +20,7 @@
# if CRYPTOPP_BOOL_NEON_INTRINSICS_AVAILABLE
# include <arm_neon.h>
# endif
# if (__ARM_ACLE >= 200)
# if defined(__ARM_FEATURE_CRC32) || (__ARM_ACLE >= 200)
# include <arm_acle.h>
# endif
#endif // ARM-32 or ARM-64
@ -242,6 +242,7 @@ void CRYPTOPP_API DetectArmFeatures();
//! \brief Determine if an ARM processor has Advanced SIMD available
//! \returns true if the hardware is capable of Advanced SIMD at runtime, false otherwise.
//! \details Runtime support requires compile time support.
inline bool HasNEON()
{
if (!g_ArmDetectionDone)
@ -251,6 +252,8 @@ inline bool HasNEON()
//! \brief Determine if an ARM processor has CRC32 available
//! \returns true if the hardware is capable of CRC32 at runtime, false otherwise.
//! \details Runtime support requires compile time support. When compiling with GCC, you may
//! need to compile with <tt>-march=armv8-a+crc</tt>.
inline bool HasCRC32()
{
if (!g_ArmDetectionDone)