12 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 17 #if defined(_ARCH_PWR7) 22 extern const char PPC_POWER7_FNAME[] = __FILE__;
28 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 30 typedef void (*SigHandler)(int);
32 static jmp_buf s_jmpSIGILL;
33 static void SigIllHandler(
int)
35 longjmp(s_jmpSIGILL, 1);
38 #endif // CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 40 #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) 41 bool CPU_ProbePower7()
43 #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) 45 #elif (_ARCH_PWR7) && defined(CRYPTOPP_POWER7_AVAILABLE) 46 # if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) 50 volatile int result =
false;
52 volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
53 if (oldHandler == SIG_ERR)
56 volatile sigset_t oldMask;
57 if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
60 if (setjmp(s_jmpSIGILL))
65 byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17];
68 #if defined(__early_xlc__) || defined(__early_xlC__) 69 vec_xstw4(vec_xlw4(0, b1+3), 0, b2+1);
70 #elif defined(__xlc__) || defined(__xlC__) || defined(__clang__) 71 vec_xst(vec_xl(0, b1+3), 0, b2+1);
73 vec_vsx_st(vec_vsx_ld(0, b1+3), 0, b2+1);
76 result = (0 == std::memcmp(b1+3, b2+1, 16));
79 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
80 signal(SIGILL, oldHandler);
88 #endif // PPC32 or PPC64 Library configuration file.
Support functions for PowerPC and vector operations.
Crypto++ library namespace.