13#if defined(CRYPTOPP_ALTIVEC_AVAILABLE)
17#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
22#ifndef EXCEPTION_EXECUTE_HANDLER
23# define EXCEPTION_EXECUTE_HANDLER 1
27extern 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);
43#if (CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
44bool 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))
62 signal(SIGILL, oldHandler);
66 if (setjmp(s_jmpSIGILL))
70 CRYPTOPP_ALIGN_DATA(16)
71 const
byte b1[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
72 CRYPTOPP_ALIGN_DATA(16)
73 const
byte b2[16] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
74 CRYPTOPP_ALIGN_DATA(16)
byte b3[16];
82 result = (0 == std::memcmp(b2, b3, 16));
85 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
86 signal(SIGILL, oldHandler);
Library configuration file.
unsigned char byte
8-bit unsigned datatype
Crypto++ library namespace.
Support functions for PowerPC and vector operations.
__vector unsigned char uint8x16_p
Vector of 8-bit elements.
T1 VecXor(const T1 vec1, const T2 vec2)
XOR two vectors.