mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-29 03:16:59 -05:00
Use a better cpu detection
We now follow precisely the Intel documentation.
This commit is contained in:
parent
763dccaaed
commit
1c3000ae04
3 changed files with 114 additions and 63 deletions
|
|
@ -122,11 +122,10 @@ void speed(int period)
|
|||
|
||||
raid_cpu_info(vendor, &family, &model);
|
||||
|
||||
printf("CPU %s, family %u, model %u, flags%s%s%s%s%s%s%s%s\n", vendor, family, model,
|
||||
raid_cpu_has_mmx() ? " mmx" : "",
|
||||
printf("CPU %s, family %u, model %u, flags%s%s%s%s%s%s%s\n", vendor, family, model,
|
||||
raid_cpu_has_sse2() ? " sse2" : "",
|
||||
raid_cpu_has_ssse3() ? " ssse3" : "",
|
||||
raid_cpu_has_sse42() ? " sse42" : "",
|
||||
raid_cpu_has_crc32() ? " crc32" : "",
|
||||
raid_cpu_has_avx2() ? " avx2" : "",
|
||||
raid_cpu_has_slowmult() ? " slowmult" : "",
|
||||
raid_cpu_has_slowpshufb() ? " slowpshufb" : "",
|
||||
|
|
@ -191,7 +190,7 @@ void speed(int period)
|
|||
fflush(stdout);
|
||||
|
||||
#if HAVE_SSE42
|
||||
if (raid_cpu_has_sse42()) {
|
||||
if (raid_cpu_has_crc32()) {
|
||||
SPEED_START {
|
||||
for (j = 0; j < nd; ++j)
|
||||
crc32c_x86(0, v[j], size);
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ void crc32c_init(void)
|
|||
{
|
||||
crc32c = crc32c_gen;
|
||||
#if HAVE_SSE42
|
||||
if (raid_cpu_has_sse42()) {
|
||||
if (raid_cpu_has_crc32()) {
|
||||
crc_x86 = 1;
|
||||
crc32c = crc32c_x86;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue