summaryrefslogtreecommitdiff
path: root/crypto/ppccap.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-04-12 00:09:47 +0200
committerAndy Polyakov <appro@openssl.org>2016-04-13 12:09:46 +0200
commite0e532823f1568ef72b3ebc108c38c2cfa44e5aa (patch)
treeb3fd741fbd25a1e00eec4a944a62c9381f1873d0 /crypto/ppccap.c
parentb9077d85b0042d3d5d877d5cf7f06a8a8c035673 (diff)
downloadopenssl-new-e0e532823f1568ef72b3ebc108c38c2cfa44e5aa.tar.gz
PPC assebmly pack: initial POWER9 support tidbits.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r--crypto/ppccap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/ppccap.c b/crypto/ppccap.c
index 76cfdbde8b..2c98daf5b4 100644
--- a/crypto/ppccap.c
+++ b/crypto/ppccap.c
@@ -151,6 +151,7 @@ static unsigned long (*getauxval) (unsigned long) = NULL;
#define HWCAP2 26 /* AT_HWCAP2 */
#define HWCAP_VEC_CRYPTO (1U << 25)
+#define HWCAP_ARCH_3_00 (1U << 23)
# if defined(__GNUC__) && __GNUC__>=2
__attribute__ ((constructor))
@@ -208,6 +209,9 @@ void OPENSSL_cpuid_setup(void)
if (__power_set(0xffffffffU<<16)) /* POWER8 and later */
OPENSSL_ppccap_P |= PPC_CRYPTO207;
+ if (__power_set(0xffffffffU<<17)) /* POWER9 and later */
+ OPENSSL_ppccap_P |= PPC_MADD300;
+
return;
# endif
#endif
@@ -236,6 +240,10 @@ void OPENSSL_cpuid_setup(void)
OPENSSL_ppccap_P |= PPC_CRYPTO207;
}
+ if (hwcap & HWCAP_ARCH_3_00) {
+ OPENSSL_ppccap_P |= PPC_MADD300;
+ }
+
return;
}
@@ -285,6 +293,11 @@ void OPENSSL_cpuid_setup(void)
}
}
+ if (sigsetjmp(ill_jmp, 1) == 0) {
+ OPENSSL_madd300_probe();
+ OPENSSL_ppccap_P |= PPC_MADD300;
+ }
+
sigaction(SIGILL, &ill_oact, NULL);
sigprocmask(SIG_SETMASK, &oset, NULL);
}