opencv/cmake/checks/cpu_avx2.cpp
Alexander Alekhin 42ac089e12 build: update AVX2 check
- _mm256_bslli_epi128() works in GCC 4.9.3+ only
- Android NDK r10 doesn't support this instruction
2019-10-08 13:12:02 +03:00

12 lines
340 B
C++

#if !defined __AVX2__ // MSVC supports this flag since MSVS 2013
#error "__AVX2__ define is missing"
#endif
#include <immintrin.h>
void test()
{
int data[8] = {0,0,0,0, 0,0,0,0};
__m256i a = _mm256_loadu_si256((const __m256i *)data);
__m256i b = _mm256_bslli_epi128(a, 1); // available in GCC 4.9.3+
}
int main() { return 0; }