A compiler *can* still optimize this out

This commit is contained in:
Frank Denis 2016-08-04 20:59:43 +02:00
parent a3b68738db
commit 68564326e1

View File

@ -399,8 +399,6 @@ AS_IF([test "x$EMSCRIPTEN" = "x" -a "$host_os" != "pnacl"], [
#pragma GCC target("avx2") #pragma GCC target("avx2")
#include <immintrin.h> #include <immintrin.h>
]], [[ ]], [[
// the code below is intentionally crafted to make sure the compiler
// can't optimize the AVX2 instructions away.
__m256 x = _mm256_set1_ps(3.14); __m256 x = _mm256_set1_ps(3.14);
__m256 y = _mm256_permutevar8x32_ps(x, _mm256_set1_epi32(42)); __m256 y = _mm256_permutevar8x32_ps(x, _mm256_set1_epi32(42));
return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ)); return _mm256_movemask_ps(_mm256_cmp_ps(x, y, _CMP_NEQ_OQ));