16 #ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY 21 #ifndef EXCEPTION_EXECUTE_HANDLER 22 # define EXCEPTION_EXECUTE_HANDLER 1 26 #if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64) 27 # include <emmintrin.h> 32 #ifndef CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 34 typedef void (*SigHandler)(int);
39 static jmp_buf s_jmpNoSSE2;
40 static void SigIllHandlerSSE2(
int)
42 longjmp(s_jmpNoSSE2, 1);
45 #endif // Not CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY 51 #if CRYPTOPP_BOOL_X64 || defined(__APPLE__) 53 #elif defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) 55 #elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) 58 # if CRYPTOPP_SSE2_ASM_AVAILABLE 60 # elif CRYPTOPP_SSE2_INTRIN_AVAILABLE 61 __m128i x = _mm_setzero_si128();
62 return _mm_cvtsi128_si32(x) == 0;
66 __except (EXCEPTION_EXECUTE_HANDLER)
74 volatile bool result =
true;
76 volatile SigHandler oldHandler = signal(SIGILL, SigIllHandlerSSE2);
77 if (oldHandler == SIG_ERR)
81 volatile sigset_t oldMask;
82 if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
86 if (setjmp(s_jmpNoSSE2))
90 # if CRYPTOPP_SSE2_ASM_AVAILABLE 91 __asm __volatile (
"por %xmm0, %xmm0");
92 # elif CRYPTOPP_SSE2_INTRIN_AVAILABLE 93 __m128i x = _mm_setzero_si128();
94 result = _mm_cvtsi128_si32(x) == 0;
99 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
102 signal(SIGILL, oldHandler);
Library configuration file.
Functions for CPU features and intrinsics.
Crypto++ library namespace.