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 this issue?
-msse2
into one object file and-mfma
into another then create a dispatcher which asks CPUID which hardware is available and set your function pointers to point to either the SSE2 or AVX/FMA versions stackoverflow.com/questions/23676426/… – Z boson