transparent option in GNU

With the GCC compiler, the option -ftree-vectorizeenables auto-integration, and this flag is automatically set when used -O3. What level is it vectorized to? Ie, will I get SSE2, SSE4.2, AVX or AVX2 instructions? I know about the existence of flags mavx, mavx2etc., but I want to know what the compiler does without these specific flags in order to force a particular type of vectorization.

+4
source share
1 answer

All x86 64-bit processors have at least SSE2. By default, the GCC compiler will use the SSE2 code in 64-bit mode unless you tell it to use other hardware parameters.

32- GCC x87, SIMD, SSE -mfpmath=sse -msse2.

SIMD, ( ) .

, . , ICC MSVC -. ICC ( AMD). MSVC AVX AVX2 64- (, SSE2). , , SSE4.1 MSVC. - SSE4.1 ( AVX) . GCC SSE4.1, , , -msse4.1 - , -mavx.

+1

Source: https://habr.com/ru/post/1614765/


All Articles