12 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
17 #if defined(_ARCH_PWR9)
22 extern const char PPC_POWER9_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);
40 #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
42 bool CPU_ProbePower9()
44 #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
46 #elif defined(CRYPTOPP_POWER9_AVAILABLE)
47 # if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY)
50 volatile int result =
true;
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))
59 signal(SIGILL, oldHandler);
63 if (setjmp(s_jmpSIGILL))
69 #if CRYPTOPP_BIG_ENDIAN
70 __asm__ __volatile__ (
".byte 0x7c, 0x60, 0x05, 0xe6 \n" : : :
"r3");
72 __asm__ __volatile__ (
".byte 0xe6, 0x05, 0x60, 0x7c \n" : : :
"r3");
77 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
78 signal(SIGILL, oldHandler);
94 #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
97 # if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY)
100 volatile int result =
true;
102 volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
103 if (oldHandler == SIG_ERR)
106 volatile sigset_t oldMask;
107 if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
109 signal(SIGILL, oldHandler);
113 if (setjmp(s_jmpSIGILL))
119 #if CRYPTOPP_BIG_ENDIAN
120 __asm__ __volatile__ (
".byte 0x7c, 0x60, 0x05, 0xe6 \n" : : :
"r3");
122 __asm__ __volatile__ (
".byte 0xe6, 0x05, 0x60, 0x7c \n" : : :
"r3");
127 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
128 signal(SIGILL, oldHandler);
Library configuration file.
Crypto++ library namespace.
Support functions for PowerPC and vector operations.