mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Remove stream CRC and optimize CRC compute CRC32C using two lanes
This commit is contained in:
parent
581ec4e156
commit
a01ec45f14
7 changed files with 196 additions and 129 deletions
|
|
@ -297,6 +297,33 @@ static void test_crc32c(void)
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
unsigned char data[8255 + 7];
|
||||
static const size_t size[] = { 4095, 4096, 4097, 5000, 8255 };
|
||||
static const unsigned offset[] = { 0, 1, 3, 7 };
|
||||
unsigned j;
|
||||
unsigned k;
|
||||
|
||||
for (i = 0; i < sizeof(data); ++i)
|
||||
data[i] = (unsigned char)(i * 29 + i / 7);
|
||||
|
||||
for (j = 0; j < sizeof(size) / sizeof(size[0]); ++j) {
|
||||
for (k = 0; k < sizeof(offset) / sizeof(offset[0]); ++k) {
|
||||
uint32_t seed = 0x12345678;
|
||||
uint32_t digest = crc32c(seed, data + offset[k], size[j]);
|
||||
uint32_t digest_gen = crc32c_gen(seed, data + offset[k], size[j]);
|
||||
|
||||
if (digest != digest_gen) {
|
||||
/* LCOV_EXCL_START */
|
||||
log_fatal(EINTERNAL, "Failed CRC32C large buffer test\n");
|
||||
exit(EXIT_FAILURE);
|
||||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void test_parity(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue