mirror of
https://github.com/aaru-dps/Aaru.Checksums.Native.git
synced 2025-12-16 19:24:29 +00:00
Lower ARM architecture requirement for CRC32 instructions.
The changes ensure compatibility with compilers targeting ARMv7. 32-bit processors of architecture 8 and higher, or 64-bit processors running in 32-bit mode can have the CRC32 instructions. With this change we will query the processor instead of the compiler architecture.
This commit is contained in:
6
simd.c
6
simd.c
@@ -198,6 +198,12 @@ int have_arm_crc32(void)
|
||||
#elif defined(__APPLE__)
|
||||
return have_crc32_apple();
|
||||
#else
|
||||
|
||||
// Not defined in ARMv7 compilers, even if the CPU has the capability
|
||||
#ifndef HWCAP2_CRC32
|
||||
#define HWCAP2_CRC32 (1 << 4)
|
||||
#endif
|
||||
|
||||
return getauxval(AT_HWCAP2) & HWCAP2_CRC32;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user