Fix AVX2 feature test under Clang 3.3

Clang 3.3 appears to support some of AVX2, but it is missing _mm256_broadcastsi128_si256.
This commit is contained in:
Jeffrey Walton 2019-07-21 00:27:23 -04:00
parent 22a55bbbc5
commit 5957b19fb8
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

View File

@ -1,7 +1,9 @@
#include <immintrin.h>
int main(int argc, char* argv[])
{
__m256i x = _mm256_setzero_si256();
x=_mm256_add_epi64 (x,x);
// _mm256_broadcastsi128_si256 due to Clang
__m128i x = _mm_setzero_si128 ();
__m256i y = _mm256_broadcastsi128_si256 (x);
y = _mm256_add_epi64 (y,y);
return 0;
}