Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Skylake CFLAGS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Sat Jan 16, 2016 12:22 pm    Post subject: Skylake CFLAGS Reply with quote

Hey there,
What CFLAGS have you guys been using for Skylake? I just got mine and I couldn't find info about it anywhere. Is march=core2 fine or will I be missing out a lot?
This is what I got previously (though I have no idea where I got it from...)
Code:
ABI_X86="32 64"
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=core2"
CFLAGS="${CFLAGS} -msse4"
CFLAGS="${CFLAGS} -mcx16"
CFLAGS="${CFLAGS} -msahf"
CFLAGS="${CFLAGS} -O2"
CFLAGS="${CFLAGS} -pipe"
CXXFLAGS="${CFLAGS}"
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"

_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3086
Location: Illinois, USA

PostPosted: Sat Jan 16, 2016 2:35 pm    Post subject: Reply with quote

See my thread here: https://forums.gentoo.org/viewtopic.php?p=7867046#7867046

I would emerge the source with the experimental flag and choose the "Native optimizations autodetected by GCC " option.

In my case I took the specific Phenom II choice, but my CPU is five years old. I've been thinking of updating to a Skylake and would definitely do as I said.

Please let us know how it works. You might also try the "Core i7" option that is also uncovered by the experimental use flag.
Back to top
View user's profile Send private message
Mr_Maniac
Guru
Guru


Joined: 10 Jun 2004
Posts: 538

PostPosted: Sat Jan 16, 2016 3:02 pm    Post subject: Reply with quote

Code:
-march=native -O2 -pipe

Should suffice. GCC will automatically use options suitable for your CPU. You can, of course, also use -O3 if you want.[/code]
_________________
Intel Core i7 6700
ASUS Z170 PRO GAMING
32 GB DDR4 RAM
GeForce GTX 1070
Gentoo Linux (most recent stable kernel - amd64)
Windows 10 x64
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Sat Jan 16, 2016 3:27 pm    Post subject: Reply with quote

Tony0945 wrote:
See my thread here: https://forums.gentoo.org/viewtopic.php?p=7867046#7867046

I would emerge the source with the experimental flag and choose the "Native optimizations autodetected by GCC " option.

In my case I took the specific Phenom II choice, but my CPU is five years old. I've been thinking of updating to a Skylake and would definitely do as I said.

Please let us know how it works. You might also try the "Core i7" option that is also uncovered by the experimental use flag.

Mr_Maniac wrote:
Code:
-march=native -O2 -pipe

Should suffice. GCC will automatically use options suitable for your CPU. You can, of course, also use -O3 if you want.[/code]


Thanks, I will check the experimental sources later. Right now I am having trouble with a kernel panic, so I want to fix that first. Also, I loved this comment:
NeddySeagoon wrote:
As usual, if it breaks, you can keep all the pieces.

_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43209
Location: 56N 3W

PostPosted: Sat Jan 16, 2016 3:31 pm    Post subject: Reply with quote

Holysword,

Thats not original, it was inspired by
man chat:
COPYRIGHT
       The  chat  program  is  in  public  domain.  This is not the GNU public
       license. If it breaks then you get to keep both pieces.


Using -O3 system wide is a very bad idea. It enables options that can produce incorrect results in some circumstances.
It also enables options that make the binary bigger in an attempt to get faster execution. The bigger binaries are faster can be true ... up to point. When the bigger binary no longer fits into the CPU cache, it suddenly gets much slower, due to "cache thrashing".

"Cache thrashing" also occurs between concurrent tasks, when one pushes the other out of the CPU cache.
In short, use -O3 only on a package by package basis, where its known to produce correct results and you really need the speed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


Last edited by NeddySeagoon on Sat Jan 16, 2016 3:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Holysword
l33t
l33t


Joined: 19 Nov 2006
Posts: 946
Location: Greece

PostPosted: Sat Jan 16, 2016 3:34 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Holysword,

Thats not original, it was inspired by
man chat:
COPYRIGHT
       The  chat  program  is  in  public  domain.  This is not the GNU public
       license. If it breaks then you get to keep both pieces.

Living and learning, thanks for sharing! :P
_________________
"Nolite arbitrari quia venerim mittere pacem in terram non veni pacem mittere sed gladium" (Yeshua Ha Mashiach)
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Tue Jan 19, 2016 11:13 am    Post subject: Reply with quote

NeddySeagoon wrote:
In short, use -O3 only on a package by package basis, where its known to produce correct results and you really need the speed.

I have been using -O3 or -Ofast for several packages like multimedia libraries or app-arch, but I have read in few pleases that -O3 might be usefull for others speeding up python or sqlite, but I never found any benchmarks to confirm it. Have You found that true or perhaps know other packages that might have use of that higher CFLAGS?
_________________
Sky is not the limit...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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