https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78379
--- Comment #12 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- (In reply to Jerry DeLisle from comment #11) > One could consider running a reference matrix multiply of size 32 in a loop > and do timing tests to determine whether to use -mprefer-avx128. 0n this > machine from comment 8 > > mavx = 1.276 mavx mprefer-avx128 = 3.460 > > There is some margin there for a fairly good test. Or is there another way > to tell? I read some advice on the net that certain types of AMD processors have AVX, but AVX128 is better for them. What exactly is your CPU model? What does /proc/cpuinfo say? gcc determines the cpu model (see runk/libgcc/config/i386/cpuinfo.c). We should be able to query the CPU model and dispatch for AVX128 or AVX (or the other variants) based on that.