From 82ce9dfc045463b6467956002006d97d2357830e Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Tue, 12 Aug 2014 17:16:41 +0200 Subject: [PATCH] reactivate software-based CRC32 on x64 platforms without SSE4.2 --- Algorithms/IteratorBasedCRC32.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Algorithms/IteratorBasedCRC32.h b/Algorithms/IteratorBasedCRC32.h index 84a404a88..6c2767f0d 100644 --- a/Algorithms/IteratorBasedCRC32.h +++ b/Algorithms/IteratorBasedCRC32.h @@ -34,9 +34,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if defined(__x86_64__) && !defined(__MINGW64__) #include -#else +#endif + #include // for boost::crc_32_type +#if defined(__MINGW64__) inline void __get_cpuid(int param, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned *edx) { *ecx = 0; @@ -51,17 +53,12 @@ template class IteratorbasedCRC32 bool use_SSE42_CRC_function; -#if !defined(__x86_64__) boost::crc_optimal<32, 0x1EDC6F41, 0x0, 0x0, true, true> CRC32_processor; -#endif + unsigned SoftwareBasedCRC32(char *str, unsigned len) { -#if !defined(__x86_64__) CRC32_processor.process_bytes(str, len); return CRC32_processor.checksum(); -#else - return 0; -#endif } // adapted from http://byteworm.com/2010/10/13/crc32/