summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-19 23:49:26 +0000
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-19 23:49:26 +0000
commita376bcc654edc5ad2fb19e3d86be18a23c882437 (patch)
tree9040bb4548e4d2e4cc4e30bda7b890a14ed7b7c3 /ext
parent8e1ac9fb0cd3c8c60370e5cc47154edf13bdd814 (diff)
downloadinfinitytier-a376bcc654edc5ad2fb19e3d86be18a23c882437.tar.gz
infinitytier-a376bcc654edc5ad2fb19e3d86be18a23c882437.zip
ARM NEON Salsa20/12 in build and selftest. Almost 2X speedup on a Raspberry Pi.
Diffstat (limited to 'ext')
-rw-r--r--ext/arm32-neon-salsa2012-asm/salsa2012.h8
1 files changed, 8 insertions, 0 deletions
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 <sys/auxv.h>
+#include <asm/hwcap.h>
+#define zt_arm_has_neon() (getauxval(AT_HWCAP) & HWCAP_NEON)
+#else
+#define zt_arm_has_neon() (true)
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif