LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 April 27 2016

hussam
Member

cflags and processor specific features

Hi. What kind of real life benefit would I get from using -mtune=native instead of mtune=generic?
native means it checks for features my processor has and enables stuff like sse3.
What kind of benefit is there? What kind of applications benefit from this?

Offline

#2 April 27 2016

scorz
Member

Re: cflags and processor specific features

Warning: Not a GCC guru!

I once used native flags, binary didn't run on another machine - just for fun, i was learning and trying ever gcc parameters/flags/whatever)
Compiled on a 64 bits cpu, tested on 32 bits  (with m32 of course) when I removed the -mtune it worked ok.

But to be honest, I don't know any real life benefit.. Maybe binary will be slightly faster since you are specifying which cpu you're using?

Offline

#3 April 27 2016

hussam
Member

Re: cflags and processor specific features

scorz wrote:

Maybe binary will be slightly faster since you are specifying which cpu you're using?

Perhaps :) I did run a test to see what mtune=generic enables and what mtune=native does. generic enabled nothing. native enabled everything my core2duo supports up to sse3 (with breaks compatibility with older processors).
Now I just wonder what enabling sse3 adds to the table :)

Offline

#4 April 28 2016

Joe
Member

Re: cflags and processor specific features

I don't have the answer, but it would be interesting to run benchmarks against popular applications compiled with both flags and compare.

Offline

Board footer