Wednesday, 18 September 2013

Preventing GCC from automatically using AVX and FMA instructions when compiled with -mavx and -mfma

Preventing GCC from automatically using AVX and FMA instructions when
compiled with -mavx and -mfma

How can I disable auto-vectorization with AVX and FMA instructions? I
would still prefer the compiler to employ SSE and SSE2 automatically, but
not FMA and AVX.
My code that uses AVX checks for its availability, but GCC doesn't do it
when auto-vectorizing. So if I compile with -mfma and run the code on any
CPU prior to Haswell I get SIGILL. How to solve thi issue?

No comments:

Post a Comment