summaryrefslogtreecommitdiffstats
path: root/crypto/ppccap.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-02-01 21:51:51 +0100
committerAndy Polyakov <appro@openssl.org>2014-02-01 21:51:51 +0100
commit7e569022c59a72dd8ebf83701f53093a4db6d392 (patch)
treec16ff698b550a379cd858731e78ccf59e06c7434 /crypto/ppccap.c
parent50f1b47c7f30bb1cd6d91b0e43a6087014b30abe (diff)
PPC assembly pack: ppc64-mont update from master.
Diffstat (limited to 'crypto/ppccap.c')
-rw-r--r--crypto/ppccap.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/crypto/ppccap.c b/crypto/ppccap.c
index 531f1b3be8..d78bfbcdbb 100644
--- a/crypto/ppccap.c
+++ b/crypto/ppccap.c
@@ -4,7 +4,7 @@
#include <setjmp.h>
#include <signal.h>
#include <unistd.h>
-#ifdef __linux
+#if defined(__linux) || defined(_AIX)
#include <sys/utsname.h>
#endif
#include <crypto.h>
@@ -13,7 +13,7 @@
#define PPC_FPU64 (1<<0)
#define PPC_ALTIVEC (1<<1)
-static int OPENSSL_ppccap_P = 0;
+unsigned int OPENSSL_ppccap_P = 0;
static sigset_t all_masked;
@@ -25,7 +25,7 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_U
if (sizeof(size_t)==4)
{
-#if (defined(__APPLE__) && defined(__MACH__))
+#if 1 || (defined(__APPLE__) && defined(__MACH__))
if (num>=8 && (num&3)==0 && (OPENSSL_ppccap_P&PPC_FPU64))
return bn_mul_mont_fpu64(rp,ap,bp,np,n0,num);
#else
@@ -88,12 +88,14 @@ void OPENSSL_cpuid_setup(void)
OPENSSL_ppccap_P = 0;
#if defined(_AIX)
- if (sizeof(size_t)==4
+ if (sizeof(size_t)==4)
+ {
+ struct utsname uts;
# if defined(_SC_AIX_KERNEL_BITMODE)
- && sysconf(_SC_AIX_KERNEL_BITMODE)!=64
+ if (sysconf(_SC_AIX_KERNEL_BITMODE)!=64) return;
# endif
- )
- return;
+ if (uname(&uts)!=0 || atoi(uts.version)<6) return;
+ }
#endif
memset(&ill_act,0,sizeof(ill_act));