Merge pull request #929 from warrenfalk/fix32

fix a compile error on 32-bit (fixes #634)
main
Igor Canadi 9 years ago
commit 48a8667c30
  1. 9
      util/crc32c.cc

@ -292,10 +292,12 @@ static inline uint32_t LE_LOAD32(const uint8_t *p) {
}
#ifdef __SSE4_2__
#ifdef __LP64__
static inline uint64_t LE_LOAD64(const uint8_t *p) {
return DecodeFixed64(reinterpret_cast<const char*>(p));
}
#endif
#endif
static inline void Slow_CRC32(uint64_t* l, uint8_t const **p) {
uint32_t c = static_cast<uint32_t>(*l ^ LE_LOAD32(*p));
@ -315,8 +317,15 @@ static inline void Slow_CRC32(uint64_t* l, uint8_t const **p) {
static inline void Fast_CRC32(uint64_t* l, uint8_t const **p) {
#ifdef __SSE4_2__
#ifdef __LP64__
*l = _mm_crc32_u64(*l, LE_LOAD64(*p));
*p += 8;
#else
*l = _mm_crc32_u32(static_cast<unsigned int>(*l), LE_LOAD32(*p));
*p += 4;
*l = _mm_crc32_u32(static_cast<unsigned int>(*l), LE_LOAD32(*p));
*p += 4;
#endif
#else
Slow_CRC32(l, p);
#endif

Loading…
Cancel
Save