ARM NEON Salsa20/12 in build and selftest. Almost 2X speedup on a Raspberry Pi.

This commit is contained in:
Adam Ierymenko 2017-04-19 23:49:26 +00:00
parent 8e1ac9fb0c
commit a376bcc654
3 changed files with 42 additions and 2 deletions

View file

@ -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