static uint32_t crc32c_words()

in lib/checksum/crc32c_sse42.cc [168:197]


static uint32_t crc32c_words(uint32_t crc, const void *buf, size_t count) {
    DEBUG_PRINTF3("  crc32c_words(crc = 0x%08x, buf = %p, count = " SIZE_T_FORMAT ")", crc, buf, count);

    const uint64_t *pq = (const uint64_t *)buf;
    size_t loops = (count + 7) / 8;
    assert(loops > 0);
    switch (count & 7) {
        case 0:
            do {
                crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 7:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 6:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 5:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 4:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 3:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 2:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
                case 1:
                    crc = (uint32_t)_mm_crc32_u64(crc, *pq++);
            } while (--loops > 0);
    }

    DEBUG_PRINTF1(" = 0x%08x\n", crc);
    return crc;
}