log/config/x86-ext/avx2.cpp
Andrey Semashev 3e6fee4751 Counter compiler optimizations when checking for SSSE3 and AVX2.
The compiler is able to optimize away most of the instructions that we test,
which results in checking only the compiler support for intrinsics, and not
the assembler capability to translate SSSE3 and AVX2 instructions from assembler
into the actual binary code. This commit forces the compiler to actually emit
instructions in the assembler, which then tests binutils capability to translate
those into binary code.
2019-01-08 00:56:24 +03:00

21 lines
499 B
C++

/*
* Copyright Andrey Semashev 2007 - 2015.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#include <immintrin.h>
void pretend_used(__m256i*);
int main(int, char*[])
{
__m256i mm = _mm256_setzero_si256();
pretend_used(&mm);
mm = _mm256_shuffle_epi8(_mm256_alignr_epi8(mm, mm, 10), mm);
pretend_used(&mm);
_mm256_zeroupper();
return 0;
}