summaryrefslogtreecommitdiff
path: root/src/hwf-s390x.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2020-12-30 17:46:01 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2020-12-30 17:46:01 +0200
commit1d13794780e3d052cd5ed6f900bf5900cf44b377 (patch)
tree622e2e8877df6820996f727c1a23663e2602207b /src/hwf-s390x.c
parent0252cc9b62dfe20c77211f093b4fda54786177d3 (diff)
downloadlibgcrypt-1d13794780e3d052cd5ed6f900bf5900cf44b377.tar.gz
hwf-s390x: add VX vector instruction set detection
* configure.ac (gcry_cv_gcc_inline_asm_s390x_vx): New check. * src/g10lib.h (HWF_S390X_VX): New. * src/hwf-s390x.c (HWCAP_S390_VXRS): New. (s390x_features) [HAVE_GCC_INLINE_ASM_S390X_VX]: Add VX feature check. * src/hwfeatures.c (hwlist): Add "s390x-vx". -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'src/hwf-s390x.c')
-rw-r--r--src/hwf-s390x.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/hwf-s390x.c b/src/hwf-s390x.c
index 991e8c4c..25121b91 100644
--- a/src/hwf-s390x.c
+++ b/src/hwf-s390x.c
@@ -41,6 +41,16 @@
# define HAVE_STFLE 1
#endif
+#ifndef AT_HWCAP
+# define AT_HWCAP 16
+#endif
+#ifndef HWCAP_S390_STFLE
+# define HWCAP_S390_STFLE 4
+#endif
+#ifndef HWCAP_S390_VXRS
+# define HWCAP_S390_VXRS 2048
+#endif
+
struct feature_map_s
{
unsigned int facilities_bit;
@@ -53,6 +63,9 @@ static const struct feature_map_s s390x_features[] =
{ 17, 0, HWF_S390X_MSA },
{ 77, 0, HWF_S390X_MSA_4 },
{ 146, 0, HWF_S390X_MSA_8 },
+#ifdef HAVE_GCC_INLINE_ASM_S390X_VX
+ { 129, HWCAP_S390_VXRS, HWF_S390X_VX },
+#endif
};
#if defined(HAVE_SYS_AUXV_H) && defined(HAVE_ELF_AUX_INFO) && \
@@ -88,13 +101,6 @@ struct facilities_s
u64 bits[3];
};
-#ifndef AT_HWCAP
-# define AT_HWCAP 16
-#endif
-#ifndef HWCAP_S390_STFLE
-# define HWCAP_S390_STFLE 4
-#endif
-
static int
get_hwcap(unsigned int *hwcap)
{