mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Add support for AVX2 GFNI
This commit is contained in:
parent
994c208315
commit
c4f9869f98
9 changed files with 1074 additions and 28 deletions
142
cmdline/speed.c
142
cmdline/speed.c
|
|
@ -286,9 +286,16 @@ void speed(int period, int nd, int size)
|
|||
printf("%8s", "avx2");
|
||||
#ifdef CONFIG_X86_64
|
||||
printf("%8s", "avx2e");
|
||||
#ifdef CONFIG_AVX512BW
|
||||
printf("%8s", "avx512");
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
printf("%8s", "gfni");
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
printf("%8s", "gfni512");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
|
|
@ -427,6 +434,16 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
raid_gen2_avx2gfni(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -572,6 +589,16 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
raid_gen3_avx2gfni(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -657,6 +684,16 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
raid_gen4_avx2gfni(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -742,6 +779,16 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
raid_gen5_avx2gfni(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -827,6 +874,16 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
raid_gen6_avx2gfni(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -851,9 +908,16 @@ void speed(int period, int nd, int size)
|
|||
printf("%8s", "ssse3");
|
||||
printf("%8s", "avx2");
|
||||
#ifdef CONFIG_X86_64
|
||||
#ifdef CONFIG_AVX512BW
|
||||
printf("%8s", "avx512");
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
printf("%8s", "gfni");
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
printf("%8s", "gfni512");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
printf("\n");
|
||||
|
||||
|
|
@ -911,6 +975,19 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(1, raid_gen1_avx2);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_rec1_avx2gfni(1, id, ip + 1, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -985,6 +1062,19 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(2, raid_gen2_avx2gfni);
|
||||
/* +1 to avoid GEN2 optimized case */
|
||||
raid_rec2_avx2gfni(2, id, ip + 1, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
|
|
@ -1060,12 +1150,23 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(3, raid_gen3_avx2gfni);
|
||||
raid_recX_avx2gfni(3, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(3, raid_gen3_avx512gfni);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_recX_avx512gfni(3, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
|
|
@ -1136,12 +1237,23 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(4, raid_gen4_avx2gfni);
|
||||
raid_recX_avx2gfni(4, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(4, raid_gen4_avx512gfni);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_recX_avx512gfni(4, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
|
|
@ -1211,12 +1323,23 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(5, raid_gen5_avx2gfni);
|
||||
raid_recX_avx2gfni(5, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(5, raid_gen5_avx512gfni);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_recX_avx512gfni(5, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
|
|
@ -1286,12 +1409,23 @@ void speed(int period, int nd, int size)
|
|||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX2GFNI
|
||||
if (raid_cpu_has_avx2gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(6, raid_gen6_avx2gfni);
|
||||
raid_recX_avx2gfni(6, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_AVX512GFNI
|
||||
if (raid_cpu_has_avx512gfni()) {
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(6, raid_gen6_avx512gfni);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_recX_avx512gfni(6, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue