Warning about hardware accelerated CRC32C
On my new MacBook Pro M1 (Apple Silicon), midas compiles very well (actually 6x faster!), but I get the annoying error
#warning Hardware accelerated CRC32C is not available.
Now I understand that the M1 does not support hardware accelerated CRC32C, but do I have to see this waring hundreds of times a day? May I propose not to remove the warning, but disable it for the M1? We can test for M1 with the “__arm__” flag, but that seems to me a bit too general, like
#ifdef HAVE_HWCRC32C
...
#else
#ifdef __arm__
// do nothing
#else
#warning Hardware accelerated CRC32C is not available.
#endif
#endif
Since the world is going towards Apple Silicon, we should find a good solution for that, since we will soon have many complaints about that (once people realise how good the M1 and M2 are).
Now dumping all preprocesor defines with
gcc -E -dM < /dev/null)
I see these define:
#define __ARM_FEATURE_CRC32 1
so I believe the M1 does have HW acceleration.
Any idea how I can use it?
Comments (7)
-
reporter -
this is dupe of bug 330. K.O.
-
reporter So will you have a look or do you want me to implement some arm code?
-
I will not have time to work on midas until late next week. Luckily midas-2022-a and midas-2022-b seem to be trouble-free so far.
-
if you want to try it implementing it yourself, note the difference between “CRC32” and “CRC32C” (the “C” version is newer and better). Also note the crc test program in progs/crc32c_sum.cxx. It computes CRC32C checksum of stdin. Ultimately, it should compute the same result on 32-bit x86, 64-bit x86, 32-bit ARM and 64-bit ARM. K.O.
-
reporter -
assigned issue to
-
assigned issue to
-
reporter - changed status to resolved
Implemented HW CRC32 for Arm procesor
- Log in to comment
On
https://developer.arm.com/documentation/101028/0012/8--Data-processing-intrinsics
it’s described that we have a
to perform a CRC32 checksum on bytes. Is that the one to use?