On 2017.09.14 at 14:36 +0200, Jakub Jelinek wrote: > On Thu, Sep 14, 2017 at 12:10:50PM +0000, Shalnov, Sergey wrote: > > GCC has the option "mprefer-avx128" to use 128-bit AVX registers instead > > of 256-bit AVX registers in the auto-vectorizer. > > > This patch enables the command line option "mprefer-avx256" that reduces > > 512-bit registers usage in "march=skylake-avx512" mode. This is the > > initial implementation of the option. Currently, 512-bit registers might > > appears in some cases. I have a plan to continue fix the cases where > > 512-bit registers are appear. Sergey > > What is the rationale for this? -mprefer-avx128 has been added because some > (older) AMD CPUs implement AVX by performing 256-bit ops as two 128-bit uops > and thus it is faster to emit 128-bit only code. > Is that the case for any AVX512 implementations too?
You get a huge frequency drop when you run AVX512 code. There are situations where this more than offsets the potential gains. Glibc had to disable AVX512 memcpy because of this issue. -- Markus