https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57952
--- Comment #5 from mmokrejs at gmail dot com --- (In reply to Jakub Jelinek from comment #4) > As for #c2/#c3, GCC 4.9 is not supported anymore and the dumps are too large > to find out what exactly you mean by efficient and not efficient, both the > ICC and GCC generated assemblies use both %ymm and %xmm registers depending > on what exactly the need. "gcc -march=native" or "g++ march=native" do not insert a single instructing using ymm registers unless -O3 is used. $ gcc -O3 -march=native -mavx2 stream.c ; objdump -d a.out | grep ymm | wc -l 63 $ gcc -O2 -march=native -mavx2 stream.c ; objdump -d a.out | grep ymm | wc -l 0 $ gcc -O2 -march=native stream.c ; objdump -d a.out | grep ymm | wc -l 0 $ gcc -O3 -march=native stream.c ; objdump -d a.out | grep ymm | wc -l 63 $ I am on Gentoo Linux where 5.4.0 is still in testing only, same for 6.3 and 7.1. The 4.9 series is the last which is generally usable.
