Commit 58ba5734 by Derek Mauro Committed by Copybara-Service

Require 64-bit builds on x86 to use CRC32 hardware acceleration

32-bit builds with SSE 4.2 do exist, and these builds do not work
without this patch.

PiperOrigin-RevId: 499498979
Change-Id: I0ade09068804655652c07d0f1ef13554464a1558
parent 74d8b4d9
......@@ -25,8 +25,10 @@
// We define a translation layer for both x86 and ARM for the ease of use and
// most performance gains.
// We need CRC (part of SSE 4.2) and PCLMULQDQ instructions.
#if defined(__SSE4_2__) && defined(__PCLMUL__)
// This implementation requires 64-bit CRC instructions (part of SSE 4.2) and
// PCLMULQDQ instructions. 32-bit builds with SSE 4.2 do exist, so the
// __x86_64__ condition is necessary.
#if defined(__x86_64__) && defined(__SSE4_2__) && defined(__PCLMUL__)
#include <x86intrin.h>
#define ABSL_CRC_INTERNAL_HAVE_X86_SIMD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment