implement hardware CRC32 on ARM
Issue #330
resolved
Looks like 64-bit ARM can do hardware CRC32 and maybe hardware CRC32C: https://main.lv/writeup/arm64_assembly_crc32.md K.O.
Comments (3)
-
-
As Stefan predicted, the default build on my Pi 4B did not include CRC32 hardware support (so you get a compile-time warning that it isn’t available, but everything still compiles and runs okay).
If I force CRC support with
cmake -D CMAKE_CXX_FLAGS="-march=armv8-a+crc" ..
then hardware support is included, and the following examples report the same hashes for HW and SW versions.$ echo "hello" | bin/crc32c_sum 353dd8be $ echo "hello" | bin/crc32c_sum sw 353dd8be $ cat src/midas.cxx | bin/crc32c_sum a637074b $ cat src/midas.cxx | bin/crc32c_sum sw a637074b
-
- changed status to resolved
- Log in to comment
I implemented this now for Apple M1 Arm processor. The code might also work on the Raspberry Pi, but I haven’t tried it. Might need an extra -march flag during compilation. Once tested, this issue can be closed.