From a376bcc654edc5ad2fb19e3d86be18a23c882437 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 19 Apr 2017 23:49:26 +0000 Subject: ARM NEON Salsa20/12 in build and selftest. Almost 2X speedup on a Raspberry Pi. --- ext/arm32-neon-salsa2012-asm/salsa2012.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext') diff --git a/ext/arm32-neon-salsa2012-asm/salsa2012.h b/ext/arm32-neon-salsa2012-asm/salsa2012.h index 7820a2e6..719b2e0c 100644 --- a/ext/arm32-neon-salsa2012-asm/salsa2012.h +++ b/ext/arm32-neon-salsa2012-asm/salsa2012.h @@ -1,6 +1,14 @@ #ifndef ZT_SALSA2012_ARM32NEON_ASM #define ZT_SALSA2012_ARM32NEON_ASM +#if defined(__linux__) || defined(linux) || defined(__LINUX__) || defined(__linux) +#include +#include +#define zt_arm_has_neon() (getauxval(AT_HWCAP) & HWCAP_NEON) +#else +#define zt_arm_has_neon() (true) +#endif + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3