How to access hardware-accelerated CRC32C?

4 views
Skip to first unread message

Jens Alfke

unread,
Sep 25, 2015, 3:31:59 PM9/25/15
to perfoptimi...@lists.apple.com
Current Intel CPUs have hardware instructions for performing the basic cycle of a CRC32C checksum. I’m porting a library that uses CRC32C and I’d like to use the fastest implementation possible. However, I haven’t found a public system API that provides any form of CRC32 (not even veclib) and the implementations I’ve found online are pure software (no assembly, just C.)

Is there a system API I overlooked? It’d be nice to call a built-in one instead of trying to do it myself, because of course I’d need to check what CPU type the code is running on, and then compare agains the exact set of Intel CPUs that support the opcode … yuck.

—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list (PerfOptimi...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/perfoptimization-dev/perfoptimization-dev-garchive-8409%40googlegroups.com

This email sent to perfoptimization-...@googlegroups.com

Jens Ayton

unread,
Sep 28, 2015, 2:45:37 AM9/28/15
to perfoptimi...@lists.apple.com
On 25 Sep 2015, at 21:31, Jens Alfke <je...@mooseyard.com> wrote:
>
> …because of course I’d need to check what CPU type the code is running on, and then compare agains the exact set of Intel CPUs that support the opcode … yuck.

According to the Fine Manual (http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html Vol. 1 5-5), "Processor support of CRC32 is enumerated by CPUID.01:ECX[SSE4.2] = 1".

--
Jens Ayton

Reply all
Reply to author
Forward
0 new messages