13 #if defined(CRYPTOPP_ALTIVEC_AVAILABLE) 17 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 22 #ifndef EXCEPTION_EXECUTE_HANDLER 23 # define EXCEPTION_EXECUTE_HANDLER 1 27 extern const char PPC_SIMD_FNAME[] = __FILE__;
31 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 33 typedef void (*SigHandler)(int);
35 static jmp_buf s_jmpSIGILL;
36 static void SigIllHandler(
int)
38 longjmp(s_jmpSIGILL, 1);
41 #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 43 #if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) 44 bool CPU_ProbeAltivec()
46 #if defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) 48 #elif (_ARCH_PWR3) && (CRYPTOPP_ALTIVEC_AVAILABLE) 49 # if defined(CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY) 53 volatile int result =
true;
55 volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
56 if (oldHandler == SIG_ERR)
59 volatile sigset_t oldMask;
60 if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
63 if (setjmp(s_jmpSIGILL))
67 CRYPTOPP_ALIGN_DATA(16)
68 const byte b1[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
69 CRYPTOPP_ALIGN_DATA(16)
70 const byte b2[16] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
71 CRYPTOPP_ALIGN_DATA(16) byte b3[16];
79 result = (0 ==
std::memcmp(b2, b3, 16));
82 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
83 signal(SIGILL, oldHandler);
88 #endif // CRYPTOPP_ALTIVEC_AVAILABLE 91 # endif // CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64 Library configuration file.
Support functions for PowerPC and vector operations.
T1 VecXor(const T1 vec1, const T2 vec2)
XOR two vectors.
Crypto++ library namespace.
__vector unsigned char uint8x16_p
Vector of 8-bit elements.