Use intrinsics for crc32 instruction
commit00fbd6ca80de809cdef1bf961d6fadda65e3ab10
authorMatthias Braun <matthiasb@fb.com>
Thu, 3 Mar 2022 15:39:18 +0000 (3 07:39 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 3 Mar 2022 15:39:18 +0000 (3 07:39 -0800)
tree7c5d04330fe96d501e7fd51cbae39f67bb3f198b
parentabe5fc1be39cd5025f9667648fb424311084f00c
Use intrinsics for crc32 instruction

Summary:
Use the `_mm_crc32_u64` intrinsic as specified in the Intel Intrinsic guide to produce the crc32 instruction.

* Intrinsics are preferable over inline assembly as the compiler provides types and operand constraints. The code is slightly simpler.
* In the current implementation of clang inline assembly, the decision between using a register or a memory operand is performed relatively early in the backend; I occasionally see code like unnecessarily using a memory operand like `movq %rbx, -392(%rbp) ; crc32q  -392(%rbp), %rcx`.

Reviewed By: ricklavoie

Differential Revision: D34588415

fbshipit-source-id: 264c21b8031b63e4f537034c5ce037167bcc8cb1
hphp/util/hash.h