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# if !defined(CRYPTOPP_NO_CPU_FEATURE_PROBES) && !CRYPTOPP_SSE2_ASM_AVAILABLE && CRYPTOPP_SSE2_INTRIN_AVAILABLE
28# include <emmintrin.h>
33extern const char SSE_SIMD_FNAME[] = __FILE__;
35NAMESPACE_BEGIN(CryptoPP)
37#ifdef CRYPTOPP_GNU_STYLE_INLINE_ASSEMBLY
39 typedef void (*SigHandler)(int);
44 static jmp_buf s_jmpNoSSE2;
45 static void SigIllHandler(
int)
47 longjmp(s_jmpNoSSE2, 1);
56#if CRYPTOPP_BOOL_X64 || defined(__APPLE__)
58#elif defined(CRYPTOPP_NO_CPU_FEATURE_PROBES)
60#elif defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY)
63# if CRYPTOPP_SSE2_ASM_AVAILABLE
65# elif CRYPTOPP_SSE2_INTRIN_AVAILABLE
66 __m128i x = _mm_setzero_si128();
67 return _mm_cvtsi128_si32(x) == 0;
71 __except (EXCEPTION_EXECUTE_HANDLER)
79 volatile bool result =
true;
81 volatile SigHandler oldHandler = signal(SIGILL, SigIllHandler);
82 if (oldHandler == SIG_ERR)
86 volatile sigset_t oldMask;
87 if (sigprocmask(0, NULLPTR, (sigset_t*)&oldMask))
89 signal(SIGILL, oldHandler);
94 if (setjmp(s_jmpNoSSE2))
98# if CRYPTOPP_SSE2_ASM_AVAILABLE
99 __asm __volatile (
"por %xmm0, %xmm0");
100# elif CRYPTOPP_SSE2_INTRIN_AVAILABLE
101 __m128i x = _mm_setzero_si128();
102 result = _mm_cvtsi128_si32(x) == 0;
107 sigprocmask(SIG_SETMASK, (sigset_t*)&oldMask, NULLPTR);
110 signal(SIGILL, oldHandler);
Library configuration file.
Functions for CPU features and intrinsics.