Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Enabling vectorization for -O2 opts for Intel, AMD Zen
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3435
Location: Gainesville, Florida

PostPosted: Mon Jan 07, 2019 4:04 pm    Post subject: Enabling vectorization for -O2 opts for Intel, AMD Zen Reply with quote

Just saw this post on Phoronix: "Enabling vectorization for -O2 optimization for Intel, AMD Zen, and generic x86_64 CPU targets"

https://www.phoronix.com/scan.php?page=news_item&px=GCC-O2-x86_64-Vectorization

One comment says:
Quote:
Compiler autovectorization is absolutely essential these days if you intend to make your cpus work at least a bit as how they were intended to be used. Otherwise go back to 2008 era nehalem and westmere, they run just fine. But if you want to make use of avx and don't want to hand-code asm, compiler can help you. ICC for example does vectorization at -O2, so does clang. Holding it back on gcc is not helpful.

Years ago, after reading about ICC with vectorization benefits on Intel cpus, I had enabled vectorization at -O2 on several amd cpu versions (eventually including bulldozers), but lately haven't done so, even though I never ran into problems I could trace to enabling it..

Considering that GCC seems to be contemplating enabling it for default -O2 at some future date, I was wondering if this might rate a Gentoo discussion about pros/cons, and other personal experiences.

Specifically, if someone with more knowledge than me could offer a few thoughts on the meaning of the benchmark info posted on a gcc mailing list, here. I'm a long-time AMD user, so my particular interest is Zen cpus.
https://gcc.gnu.org/ml/gcc/2019-01/msg00019.html
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11


Last edited by wrc1944 on Mon Jan 07, 2019 4:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
Perfect Gentleman
Veteran
Veteran


Joined: 18 May 2014
Posts: 1249

PostPosted: Mon Jan 07, 2019 4:15 pm    Post subject: Reply with quote

Code:
CFLAGS="-march=native -mtune=native -O2 -pipe -fomit-frame-pointer -fno-stack-protector -ftree-vectorize -finline-functions -funswitch-loops -s"
CXXFLAGS=${CFLAGS}
Back to top
View user's profile Send private message
est921
n00b
n00b


Joined: 20 Dec 2015
Posts: 28

PostPosted: Tue Jan 15, 2019 11:24 am    Post subject: Reply with quote

It looks like phoronix uses
Code:
-ftree-vectorize -ftree-slp-vectorize
but as far as I understand it
Code:
-ftree-slp-vectorize
should already be enable by
Code:
-ftree-vectorize
. Does anyone know why they do that?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Tue Jan 15, 2019 11:49 am    Post subject: Reply with quote

Phoronix is notorious for not bothering to RTFM for the sake of puffing up their badly-written clickbait.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum