gate sse42 implementation of checksum for x86 only
[folly.git] / folly / detail / ChecksumDetail.h
index 97ad45193feff0c22ebbec9129651f4747458383..05a6f22c8310dfbf275941e83ec20b19e9e9f4cf 100644 (file)
 
 #pragma once
 
+#include <folly/Portability.h>
+
+#if FOLLY_SSE_PREREQ(4, 2)
 #include <immintrin.h>
+#endif
+
 #include <stdint.h>
 #include <cstddef>
 
@@ -68,8 +73,10 @@ uint32_t crc32c_sw(const uint8_t* data, size_t nbytes,
 uint32_t
 crc32_hw(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U);
 
+#if FOLLY_SSE_PREREQ(4, 2)
 uint32_t
 crc32_hw_aligned(uint32_t remainder, const __m128i* p, size_t vec_count);
+#endif
 
 /**
  * Check whether a hardware-accelerated CRC-32 implementation is