diff --git a/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp b/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp index 0f86b0d4c3e..6427ae08e45 100644 --- a/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp +++ b/Userland/Libraries/LibCrypto/Checksum/CRC32.cpp @@ -10,10 +10,13 @@ #include #include +#ifdef __ARM_ACLE +# include +#endif + namespace Crypto::Checksum { -#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) - +#if __ARM_ARCH >= 8 && defined(__ARM_FEATURE_CRC32) && defined(__ARM_ACLE) void CRC32::update(ReadonlyBytes span) { // FIXME: Does this require runtime checking on rpi? @@ -23,21 +26,21 @@ void CRC32::update(ReadonlyBytes span) size_t size = span.size(); while (size > 0 && (reinterpret_cast(data) & 7) != 0) { - m_state = __builtin_arm_crc32b(m_state, *data); + m_state = __crc32b(m_state, *data); ++data; --size; } auto* data64 = reinterpret_cast(data); while (size >= 8) { - m_state = __builtin_arm_crc32d(m_state, *data64); + m_state = __crc32d(m_state, *data64); ++data64; size -= 8; } data = reinterpret_cast(data64); while (size > 0) { - m_state = __builtin_arm_crc32b(m_state, *data); + m_state = __crc32b(m_state, *data); ++data; --size; }