mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 06:56:28 -05:00
Add AArch32 (ARM32) NEON SIMD support for parity generation and recovery
This commit is contained in:
parent
e5ca862a37
commit
5c24968e6d
13 changed files with 1396 additions and 23 deletions
179
cmdline/speed.c
179
cmdline/speed.c
|
|
@ -207,6 +207,9 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
#ifdef CONFIG_NEON
|
||||
printf("%8s", "neon");
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
printf("%8s", "neon32");
|
||||
#endif
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
printf("%8s", "sse2");
|
||||
|
|
@ -266,6 +269,14 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
raid_gen1_neon32(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -370,6 +381,20 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
if (mode == RAID_MODE_CAUCHY_AES) {
|
||||
SPEED_START {
|
||||
raid_gen2_neon32_aes(nd, size, v);
|
||||
} SPEED_STOP
|
||||
} else {
|
||||
SPEED_START {
|
||||
raid_gen2_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
}
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -510,6 +535,20 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
if (mode == RAID_MODE_CAUCHY_AES) {
|
||||
SPEED_START {
|
||||
raid_gen3_neon32_aes(nd, size, v);
|
||||
} SPEED_STOP
|
||||
} else {
|
||||
SPEED_START {
|
||||
raid_gen3_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
}
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -639,6 +678,20 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
if (mode == RAID_MODE_CAUCHY_AES) {
|
||||
SPEED_START {
|
||||
raid_gen4_neon32_aes(nd, size, v);
|
||||
} SPEED_STOP
|
||||
} else {
|
||||
SPEED_START {
|
||||
raid_gen4_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
}
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -768,6 +821,20 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
if (mode == RAID_MODE_CAUCHY_AES) {
|
||||
SPEED_START {
|
||||
raid_gen5_neon32_aes(nd, size, v);
|
||||
} SPEED_STOP
|
||||
} else {
|
||||
SPEED_START {
|
||||
raid_gen5_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
}
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -894,6 +961,20 @@ void speed_gen(int nd, void** v, int size, int delta, int period, const char* ms
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
if (mode == RAID_MODE_CAUCHY_AES) {
|
||||
SPEED_START {
|
||||
raid_gen6_neon32_aes(nd, size, v);
|
||||
} SPEED_STOP
|
||||
} else {
|
||||
SPEED_START {
|
||||
raid_gen6_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
}
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -1012,6 +1093,9 @@ void speed_genz(int nd, void** v, int size, int delta, int period)
|
|||
#ifdef CONFIG_NEON
|
||||
printf("%8s", "neon");
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
printf("%8s", "neon32");
|
||||
#endif
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
printf("%8s", "sse2");
|
||||
|
|
@ -1063,6 +1147,14 @@ void speed_genz(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
raid_genz_neon32_raid(nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_sse2()) {
|
||||
|
|
@ -1130,6 +1222,9 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
#ifdef CONFIG_NEON
|
||||
printf("%8s", "neon");
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
printf("%8s", "neon32");
|
||||
#endif
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3())
|
||||
printf("%8s", "ssse3");
|
||||
|
|
@ -1170,6 +1265,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(1, raid_gen1_neon32);
|
||||
raid_rec1_neon32(1, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1253,6 +1358,17 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(1, raid_gen1_neon32);
|
||||
/* +1 to avoid GEN1 optimized case */
|
||||
raid_rec1_neon32(1, id, ip + 1, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1339,6 +1455,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(2, raid_gen2_neon32_raid);
|
||||
raid_rec2_neon32(2, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1430,6 +1556,17 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(2, raid_gen2_neon32_raid);
|
||||
/* +1 to avoid GEN2 optimized case */
|
||||
raid_rec2_neon32(2, id, ip + 1, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1523,6 +1660,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(3, raid_gen3_neon32_raid);
|
||||
raid_recX_neon32(3, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1612,6 +1759,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(4, raid_gen4_neon32_raid);
|
||||
raid_recX_neon32(4, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1702,6 +1859,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(5, raid_gen5_neon32_raid);
|
||||
raid_recX_neon32(5, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -1791,6 +1958,16 @@ void speed_rec(int nd, void** v, int size, int delta, int period)
|
|||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
#ifdef CONFIG_NEON32
|
||||
SPEED_START {
|
||||
/* ensure to use same hardware in the delta step */
|
||||
raid_gen_force(6, raid_gen6_neon32_raid);
|
||||
raid_recX_neon32(6, id, ip, nd, size, v);
|
||||
} SPEED_STOP
|
||||
|
||||
printf("%8" PRIu64, ds / dt);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
if (raid_cpu_has_ssse3()) {
|
||||
|
|
@ -2045,7 +2222,7 @@ void speed(int period, int nd, int size)
|
|||
printf("CPU 64-bit ARM (AArch64)\n");
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
#if defined(CONFIG_NEON)
|
||||
#if defined(CONFIG_NEON32)
|
||||
printf("CPU 32-bit ARM, flags neon\n");
|
||||
#else
|
||||
printf("CPU 32-bit ARM\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue