Lines 16-21
Link Here
|
16 |
|
16 |
|
17 |
#if HAVE_ARM64_CRC32C |
17 |
#if HAVE_ARM64_CRC32C |
18 |
|
18 |
|
|
|
19 |
#if defined(__FreeBSD__) |
20 |
#include <machine/armreg.h> |
21 |
#include <sys/types.h> |
22 |
namespace crc32c { |
23 |
|
24 |
inline bool CanUseArm64Linux() { |
25 |
uint64_t id_aa64isar0; |
26 |
|
27 |
id_aa64isar0 = READ_SPECIALREG(ID_AA64ISAR0_EL1); |
28 |
if ((ID_AA64ISAR0_AES(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL) && \ |
29 |
(ID_AA64ISAR0_CRC32(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE)) |
30 |
return true; |
31 |
return false; |
32 |
} |
33 |
|
34 |
} // namespace crc32c |
35 |
|
36 |
#elif defined(__linux__) |
19 |
#if HAVE_STRONG_GETAUXVAL |
37 |
#if HAVE_STRONG_GETAUXVAL |
20 |
#include <sys/auxv.h> |
38 |
#include <sys/auxv.h> |
21 |
#elif HAVE_WEAK_GETAUXVAL |
39 |
#elif HAVE_WEAK_GETAUXVAL |
Lines 43-48
inline bool CanUseArm64Linux() {
Link Here
|
43 |
|
61 |
|
44 |
} // namespace crc32c |
62 |
} // namespace crc32c |
45 |
|
63 |
|
|
|
64 |
#endif |
46 |
#endif // HAVE_ARM64_CRC32C |
65 |
#endif // HAVE_ARM64_CRC32C |
47 |
|
66 |
|
48 |
#endif // CRC32C_CRC32C_ARM_LINUX_CHECK_H_ |
67 |
#endif // CRC32C_CRC32C_ARM_LINUX_CHECK_H_ |