How to generate AVX512 instructions now (just to look at them).

Tim Prince n8tm@aol.com
Fri Jan 3 18:05:00 GMT 2014


On 1/3/2014 11:04 AM, Toon Moene wrote:
> I am trying to figure out how the top-consuming routines in our 
> weather models will be compiled when using AVX512 instructions (and 
> their 32 512 bit registers).
>
> I thought an up-to-date trunk version of gcc, using the command line:
>
> <...>/gfortran -Ofast -S -mavx2 -mavx512f <source code>
>
> would do that.
>
> Unfortunately, I do not see any use of the new zmm.. registers, which 
> might mean that AVX512 isn't used yet.
>
> This is how the nightly build job builds the trunk gfortran compiler:
>
> configure --prefix=/home/toon/compilers/install --with-gnu-as 
> --with-gnu-ld --enable-languages=fortran<,other-language> 
> --disable-multilib --disable-nls --with-arch=core-avx2 
> --with-tune=core-avx2
gfortran -O3  -funroll-loops --param max-unroll-times=2 -ffast-math 
-mavx512f -fopenmp -S
is giving me extremely limited zmm register usage in my build of 
gfortran trunk.  It appears to be using zmm only to enable use of 
vpternlogd instructions.  Immediately following the first such usage, it 
is failing to vectorize a dot_product with stride 1 operands.  There are 
still AVX2 scalar instructions and AVX-256 vectorized loops, but none 
with reduction or fma.
For gcc, I have to add -march=native in order for it to accept fma 
intrinsics (even though that one is expanded to AVX without fma).
Sorry, my only AVX2 CPU is a Windows 8.1 installation (!).

Target: x86_64-unknown-cygwin
Configured with: ../configure --prefix=/usr/local/gcc4.9/ 
--enable-languages='c
c++ fortran' --enable-libgomp --enable-threads=posix 
--disable-libmudflap --disa
ble-__cxa_atexit --with-dwarf2 --without-libiconv-prefix 
--without-libintl-prefi
x --with-system-zlib

-- 
Tim Prince



More information about the Gcc mailing list