12#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
17#if defined(__ALTIVEC__) || defined(_ARCH_PWR7)
22extern const char PPC_POWER7_FNAME[] = __FILE__;
24NAMESPACE_BEGIN(CryptoPP)
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)
43#if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
45#elif 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))
59 signal(SIGILL, oldHandler);
63 if (setjmp(s_jmpSIGILL))
68 byte b1[19] = {255, 255, 255, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, b2[17];
71 #if defined(_AIX) && defined(_ARCH_PWR7) && ((__xlC__ & 0xff00) == 0x0c00)
72 vec_xstw4(vec_xlw4(0, (
unsigned int*)(b1+3)), 0, (
unsigned int*)(b2+1));
73 result = (0 == std::memcmp(b1+3, b2+1, 16));
74 #elif defined(_ARCH_PWR7) && defined(__VSX__)
75 vec_xst(vec_xl(0, (
unsigned int*)(b1+3)), 0, (
unsigned int*)(b2+1));
76 result = (0 == std::memcmp(b1+3, b2+1, 16));
82 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
83 signal(SIGILL, oldHandler);
Library configuration file.
Support functions for PowerPC and vector operations.