LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Native CFLAGS - core2duo and core i3 - compatible? (https://www.linuxquestions.org/questions/linux-software-2/native-cflags-core2duo-and-core-i3-compatible-4175523154/)

MisterBark 10-23-2014 02:09 PM

Native CFLAGS - core2duo and core i3 - compatible?
 
Hi,

If I compiled plenty of 64bit software using the following CFLAGS on a Core2 Duo E6400 :
Code:

-mtune=native -march=native -O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize
and then I put my system on a Core-i3,
  1. Will it run?
  2. Will it still be as optimized as if I recompile everything again with those CFLAGS?
  3. If not for the above 2 questions, is there any new pretty good CPU that would be totally compatible?

Thanks! :)

metaschima 10-23-2014 02:36 PM

1) It probably will.
2) Maybe, you'll have to test it. The Core2 doesn't have AVX. However, AVX is not guaranteed to improve performance.

MisterBark 10-25-2014 01:25 AM

Thank you for the answer.

probably/maybe ... hmmmm? :)

metaschima 10-25-2014 10:26 AM

1) 99 % chance of running
2) 70 % chance of it being somewhat slower that it would be with native compile, but it depends on too many factors to tell. You realize the compiler you use matters, and its version matters. Each compiler version does slightly different things when transforming C code into assembly. The more information you provide the more accurate I can be.

What exact core i3 are you looking at ?

What kind of code is this ? Graphics ? Highly vectorizable ?

I can only be as sure as the info you give me.

MisterBark 10-25-2014 10:40 AM

Ok :)

i3 4150 Haswell, versus core2 duo e8500.

The whole system will be the same: a Slackware64 14.1 with 3.14.12-rt9 kernel that I will recompile anyway.
No graphics, no X (everything will be X forwarded)

I compiled so many things that I can't really tell... including gcc which I can make again it's fine, but it's mostly audio libraries and programs that I'm concerned about.
The system is mostly focused on Ardour / Jack, so I will recompile these 2, but what about all the libraries they need?

The system will be really loaded so if I can gain a 5% performance increase w/ something I just have to do it.

Thanks.

metaschima 10-25-2014 11:08 AM

Everything should work as is, except if it is a custom kernel, in which case you want to compile it for the new architecture.

If the system is really loaded you're definitely want to recompile things. You should recompile glibc, glib, glib2, as well as all the libraries that the audio programs use and the programs themselves.

You should really test the critical slowest routines with different compile options and see which are best. Forcing gcc to vectorize is not the best idea because it can actually slow things down.

MisterBark 10-25-2014 11:11 AM

Ah ok, will do that then.
Thank you :)


All times are GMT -5. The time now is 11:16 PM.