summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>2022-07-21 14:32:15 +0800
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-07-21 10:54:25 +0300
commit8921b5221e333626884ad291881f79e0583d574a (patch)
treeff328e6b3c99b9929640339f9380140068422a60 /src
parent3494140847cb8056d017418fefa25e7bbcfaa32c (diff)
downloadlibgcrypt-8921b5221e333626884ad291881f79e0583d574a.tar.gz
Add detection for HW feature "ARMv8 SVE"
* configure.ac (svesupport, gcry_cv_gcc_inline_asm_aarch64_sve) (ENABLE_SVE_SUPPORT): New. * doc/gcrypt.texi: Add "arm-sve" to HW features list. * src/g10lib.h (HWF_ARM_SVE): New. * src/hwf-arm.c (arm_features): Add "sve". * src/hwfeatures.c (hwflist): Add "arm-sve". -- Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Diffstat (limited to 'src')
-rw-r--r--src/g10lib.h1
-rw-r--r--src/hwf-arm.c6
-rw-r--r--src/hwfeatures.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/g10lib.h b/src/g10lib.h
index a5bed002..91d53ff3 100644
--- a/src/g10lib.h
+++ b/src/g10lib.h
@@ -251,6 +251,7 @@ char **_gcry_strtokenize (const char *string, const char *delim);
#define HWF_ARM_SM3 (1 << 6)
#define HWF_ARM_SM4 (1 << 7)
#define HWF_ARM_SHA512 (1 << 8)
+#define HWF_ARM_SVE (1 << 9)
#elif defined(HAVE_CPU_ARCH_PPC)
diff --git a/src/hwf-arm.c b/src/hwf-arm.c
index a0205ee1..0bc2713b 100644
--- a/src/hwf-arm.c
+++ b/src/hwf-arm.c
@@ -153,6 +153,9 @@ static const struct feature_map_s arm_features[] =
#ifndef HWCAP_SHA512
# define HWCAP_SHA512 (1 << 21)
#endif
+#ifndef HWCAP_SVE
+# define HWCAP_SVE (1 << 22)
+#endif
static const struct feature_map_s arm_features[] =
{
@@ -169,6 +172,9 @@ static const struct feature_map_s arm_features[] =
{ HWCAP_SM4, 0, " sm4", HWF_ARM_SM4 },
{ HWCAP_SHA512, 0, " sha512", HWF_ARM_SHA512 },
#endif
+#ifdef ENABLE_SVE_SUPPORT
+ { HWCAP_SVE, 0, " sve", HWF_ARM_SVE },
+#endif
};
#endif
diff --git a/src/hwfeatures.c b/src/hwfeatures.c
index af5daf62..dec5efd3 100644
--- a/src/hwfeatures.c
+++ b/src/hwfeatures.c
@@ -74,6 +74,7 @@ static struct
{ HWF_ARM_SM3, "arm-sm3" },
{ HWF_ARM_SM4, "arm-sm4" },
{ HWF_ARM_SHA512, "arm-sha512" },
+ { HWF_ARM_SVE, "arm-sve" },
#elif defined(HAVE_CPU_ARCH_PPC)
{ HWF_PPC_VCRYPTO, "ppc-vcrypto" },
{ HWF_PPC_ARCH_3_00, "ppc-arch_3_00" },