8/31/2005
Stupidity in CFLAGS
Ok people (that means Gentoo users and some of your developers out there… you know who you are), quit being retarded about CFLAGS.
Example one:
CFLAGS="-march=pentium4 -mtune=pentium4 -O3 -mmmx -msse -msse2 -pipe -ffast-math"
Is equivalent to the following:
CFLAGS="-march=pentium4 -O3 -pipe -ffast-math"
Why?
Let me explain a few things. march stands for set minimum architecture to X so you’re setting the minimum architecture to produce code for to a Pentium 4. Well guess what, GCC knows that Pentium 4s have MMX, SSE, and SSE2 which means it will automatically use those technologies. Then lastly mtune stands for use whatever set minimum architecture but add in optimized code paths for this architecture. Well then if all your code is going to come out optimized for Pentium 4, what’s the point in asking GCC to provide code branches that are optimized for a Pentium 4!? The only purpose that does if you compile with the following CFLAGS.
CFLAGS="-march=i386 -mtune=pentium2 -pipe"
So now you’re code will support ALL x86 based processors but will take advantage of the power CMOV instruction available to the Pentium and higher. This CFLAG will actually make a difference.
So please, quit with the redundant CFLAGS. They’re stupid and pointless.
Filed under: General, Linux
12 Comments


