From e0e532823f1568ef72b3ebc108c38c2cfa44e5aa Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 12 Apr 2016 00:09:47 +0200 Subject: PPC assebmly pack: initial POWER9 support tidbits. Reviewed-by: Richard Levitte --- crypto/ppccap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crypto/ppccap.c') 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); } -- cgit v1.2.1