[Beowulf] Sempron compile optimization
Robert G. Brown
rgb at phy.duke.edu
Wed Nov 23 06:52:11 PST 2005
On Wed, 23 Nov 2005, Alan Ward wrote:
> Hello everybody.
> Since 64-bit CPU architecture is cheap these days in a Semperon (3000+ version), I've been trying to optimize some of my C code. As for compile switches on the gcc, do
> -march=x86-64 -mfpmath=sse -m3dnow
> look reasonable? Any reason why the -m64 switch does not work for me?
Sorry, to be more explicit, I think that MOST people probably don't want
to use -m features, whether or not they work. The compiler will usually
"do the right thing" without them, unless you are cross-compiling. I
think they are there mostly for cross-compilers.
However, I'd love to be corrected if I'm wrong. Over the years when
I've tried them, though, I've seen zero impact on microbenchmark code,
leading me to doubt that they do much by way of tuning relative to
baseline. I haven't tried them, I admit, on x86_64 at all, or gcc 4.x
at all. So PLEASE correct me if I'm wrong, especially if you have
benchmarks that back up what you say. The man page for gcc has ALWAYS
had a lot more features than I think any human being ever actually uses,
and I'd bet there are quite a few of them that have NEVER been used
except by the developers. At least, I've never seen a Makefile that
uses more than a tiny fraction of them, usually -f options, and frankly
a lot of those have less impact on performance than one might think.
> Best regards,
> Alan Ward
Robert G. Brown http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567 Fax: 919-660-2525 email:rgb at phy.duke.edu
More information about the Beowulf