1 // Copyright 2017 The CRC32C Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 5 #ifndef CRC32C_CRC32C_SSE42_H_ 6 #define CRC32C_CRC32C_SSE42_H_ 7 8 // X86-specific code. 9 10 #include <cstddef> 11 #include <cstdint> 12 13 #include "crc32c/crc32c_config.h" 14 15 // The hardware-accelerated implementation is only enabled for 64-bit builds, 16 // because a straightforward 32-bit implementation actually runs slower than the 17 // portable version. Most X86 machines are 64-bit nowadays, so it doesn't make 18 // much sense to spend time building an optimized hardware-accelerated 19 // implementation. 20 #if HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__)) 21 22 namespace crc32c { 23 24 // SSE4.2-accelerated implementation in crc32c_sse42.cc 25 uint32_t ExtendSse42(uint32_t crc, const uint8_t* data, size_t count); 26 27 } // namespace crc32c 28 29 #endif // HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__)) 30 31 #endif // CRC32C_CRC32C_SSE42_H_ 32