diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-08-31 12:48:30 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-08-31 12:48:30 +0300 |
commit | 9c95be105f518d18407115c2c06893857c24b116 (patch) | |
tree | 7c554e2f270dbd8b870766045bfd2a06333181fa /src/g10lib.h | |
parent | 7b0ebe69fe35f2ee13e1e1beb2766a1eaadb7f0c (diff) | |
download | libgcrypt-9c95be105f518d18407115c2c06893857c24b116.tar.gz |
Add ARM HW feature detection module and add NEON detection
* configure.ac: Add option --disable-neon-support.
(HAVE_GCC_INLINE_ASM_NEON): New.
(ENABLE_NEON_SUPPORT): New.
[arm]: Add 'hwf-arm.lo' as HW feature module.
* src/Makefile.am: Add 'hwf-arm.c'.
* src/g10lib.h (HWF_ARM_NEON): New macro.
* src/global.c (hwflist): Add HWF_ARM_NEON entry.
* src/hwf-arm.c: New file.
* src/hwf-common.h (_gcry_hwf_detect_arm): New prototype.
* src/hwfeatures.c (_gcry_detect_hw_features) [HAVE_CPU_ARCH_ARM]: Add
call to _gcry_hwf_detect_arm.
--
Add HW detection module for detecting ARM NEON instruction set. ARM does not
have cpuid instruction so we have to rely on OS to pass feature set information
to user-space. For linux, NEON support can be detected by parsing
'/proc/self/auxv' for hardware capabilities information. For other OSes, NEON
can be detected by checking if platform/compiler only supports NEON capable
CPUs (by check if __ARM_NEON__ macro is defined).
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'src/g10lib.h')
-rw-r--r-- | src/g10lib.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/g10lib.h b/src/g10lib.h index 198ab386..31131a54 100644 --- a/src/g10lib.h +++ b/src/g10lib.h @@ -155,6 +155,8 @@ int _gcry_log_verbosity( int level ); #define HWF_INTEL_AVX 1024 #define HWF_INTEL_AVX2 2048 +#define HWF_ARM_NEON 4096 + unsigned int _gcry_get_hw_features (void); void _gcry_detect_hw_features (unsigned int); |