mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
PR #1794: Update cpu_detect.cc
fix hw crc32 and AES capability check, fix undefined Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1794 Source and explanation https://github.com/JuliaLang/julia/issues/26458 https://github.com/memcached/memcached/pull/744 For build for aarch64 on v22_clang-16.0.6-centos7 ` abseil-cpp/absl/crc/internal/cpu_detect.cc:273:20: error: use of undeclared identifier 'HWCAP_CRC32' return (hwcaps & HWCAP_CRC32) && (hwcaps & HWCAP_PMULL); ^ abseil-cpp/absl/crc/internal/cpu_detect.cc:273:46: error: use of undeclared identifier 'HWCAP_PMULL' return (hwcaps & HWCAP_CRC32) && (hwcaps & HWCAP_PMULL); ` Merge3ee325b7a4into940e0ec36aMerging this change closes #1794 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1794 from Dertosh:patch-13ee325b7a4PiperOrigin-RevId: 705936372 Change-Id: Ifebd6d1a854e17acf6cc00bab92053bc0d4c2349
This commit is contained in:
committed by
Copybara-Service
parent
940e0ec36a
commit
fffac1157d
@@ -269,8 +269,12 @@ CpuType GetCpuType() {
|
||||
}
|
||||
|
||||
bool SupportsArmCRC32PMULL() {
|
||||
#if defined(HWCAP_CRC32) && defined(HWCAP_PMULL)
|
||||
uint64_t hwcaps = getauxval(AT_HWCAP);
|
||||
return (hwcaps & HWCAP_CRC32) && (hwcaps & HWCAP_PMULL);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user