in lib/checksum/crc32c_sse42.cc [199:228]
static uint32_t crc32c_bytes(uint32_t crc, const void *buf, size_t count) {
DEBUG_PRINTF3(" crc32c_bytes(crc = 0x%08x, buf = %p, count = " SIZE_T_FORMAT ")", crc, buf, count);
const uint8_t *pc = (const uint8_t *)buf;
size_t loops = (count + 7) / 8;
assert(loops > 0);
switch (count & 7) {
case 0:
do {
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 7:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 6:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 5:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 4:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 3:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 2:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
case 1:
crc = (uint32_t)_mm_crc32_u8(crc, *pc++);
} while (--loops > 0);
}
DEBUG_PRINTF1(" = 0x%08x\n", crc);
return crc;
}