Jump to content

What -march for phenom2 X3?


Guest ilija

Recommended Posts

Does nativa detect all kind of cpus?

It should.

And What does -O2 or -O3 exactly since i figure out for phenoms is better -O3 but my server file is 30 mb increased :S

Has nothing to do with the processor. If you use a lower O level, more debug data is put in. If you want to have better crash logs, use O2 or O1 or O0.

Link to comment
Share on other sites

Has nothing to do with the processor. If you use a lower O level, more debug data is put in. If you want to have better crash logs, use O2 or O1 or O0.

Wrong, -g tells what debug data should be put in the binary, -O flag just mangles the code to be more optimized.

Hmm still weird why the core size is increased by 30mb :S with -O3

Because it does things like loop unroll and it thus uses A LOT more memory as well, -O3 is recommended for smaller binaries / projects (like simple password cracker), advanced servers like mangos should use -O2, unless run on a server with tons of spare RAM.

Link to comment
Share on other sites

Freghar maybe you know other usefull flags, please share :)? Btw i cant find the meaning of -fno-strength-reduce -fno-strict-aliasing -frename-registers -fomit-frame-pointer, i google it , only saying performance increase ;/ but not the explanation , btw example: when you got 100 testers on the server is it still usefull to use this flag: -DFD_SETSIZE=4096

Link to comment
Share on other sites

Freghar maybe you know other usefull flags, please share :)? Btw i cant find the meaning of -fno-strength-reduce -fno-strict-aliasing -frename-registers -fomit-frame-pointer, i google it , only saying performance increase ;/ but not the explanation , btw example: when you got 100 testers on the server is it still usefull to use this flag: -DFD_SETSIZE=4096

Lynx3d already gave you a GCC documentation link, you can also use gcc manpage - http://linux.die.net/man/1/gcc .

There are not really major speed improvement flags besides -O2 / -O3 (which just enables a bunch of -fxx flags), you can use -fomit-frame-pointer, but that'd make crashdumps pretty much worthless.

Link to comment
Share on other sites

If you would just FINALLY look at the gcc documentation, we wouldn't have to do the reading for you:

http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Optimize-Options.html#Optimize-Options

-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging.
-fomit-frame-pointer

Don't keep the frame pointer in a register for functions that don't need one. This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions. It also makes debugging impossible on some machines.

On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist. The machine-description macro FRAME_POINTER_REQUIRED controls whether a target machine supports this flag. See Register Usage.

Enabled at levels -O, -O2, -O3, -Os.

Besides, -fstrength-reduce does not even exist anymore, got removed from docs with gcc 4.2. And if you actually READ some of the google hits, you'd know -fno-strength-reduce was used waaaaaaaaaaaaaaay back in gcc 2.7 era to work around a compiler bug, because -fstrength-reduce is (err was) turned on with -O2.

Note that -fno *disables* something...

Just once more, adding random options you read somewhere is nonsense, most of them are either platform specific, compiler version specific, or simply useless.

O2 includes pretty much everything that generally makes execution faster. O3 is a lot more aggressive, but may actually overtax your CPU caches, and hence even reduce performance.

-march is the only "general" optimization left for x86-64 targets, and this assumes you will be running the binary on that very CPU *only*.

Phenom would be amdfam10/barcelona but you need at least gcc 4.3 for that.

Link to comment
Share on other sites

As said, read the documentation, -m64 is the default on a 64bit system.

I'd like to add that

-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging.

And I'm closing this thread, your ability to ignore advices and inability to read documentation made it waay off topic.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use