21 #if defined(__x86_64__) || defined(__i386__) || defined(_WIN32) 22 #if !defined(ANDROID_BUILD) 24 #endif // !ANDROID_BUILD 27 #if defined(X86_BUILD) 38 bool SIMDDetect::avx_available_;
39 bool SIMDDetect::avx2_available_;
40 bool SIMDDetect::avx512F_available_;
41 bool SIMDDetect::avx512BW_available_;
43 bool SIMDDetect::sse_available_;
50 SIMDDetect::SIMDDetect() {
51 #if defined(X86_BUILD) 53 unsigned int eax, ebx, ecx, edx;
54 if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) != 0) {
57 sse_available_ = (ecx & 0x00080000) != 0;
58 avx_available_ = (ecx & 0x10000000) != 0;
63 __cpuid_count(7, 0, eax, ebx, ecx, edx);
64 avx2_available_ = (ebx & 0x00000020) != 0;
65 avx512F_available_ = (ebx & 0x00010000) != 0;
66 avx512BW_available_ = (ebx & 0x40000000) != 0;
72 if (cpuInfo[0] >= 1) {
74 sse_available_ = (cpuInfo[2] & 0x00080000) != 0;
75 avx_available_ = (cpuInfo[2] & 0x10000000) != 0;
78 #error "I don't know how to test for SIMD with this compiler"