I feel that the build runs faster with both -O2 and -march=armv5te CFLAGS, after playing with different compile settings of the roguelikes and *band ports (usually the binaries alone are around 1~2MB), at least by the launch/loading time. Or is it my delusion again?
[div align=\"right\"][{POST_SNAPBACK}][/a][/div]
what is the performance difference when you compile with -march=armv5te vs -march=xscale ?
btw, I use -mtune and -mcpu instead of -march
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152096\"][{POST_SNAPBACK}][/a][/div]
Thanks. So, for those who are curious, according to the official GCC documentation [a href=\"http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/ARM-Options.html#ARM-Options]http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gc...tml#ARM-Options[/url],
-mcpu=name This specifies the name of the target ARM processor. GCC uses this name to determine what kind of instructions it can emit when generating assembly code. Permissible names are: ... `arm1136jfs' ,
`xscale', `iwmmxt', `ep9312'.
-mtune=name This option is very similar to the -mcpu= option, except that instead of specifying the actual target processor type, and hence restricting which instructions can be used, it specifies that GCC should tune the performance of the code as if the target were of the type specified in this option, but still choosing the instructions that it will generate based on the cpu specified by a -mcpu= option. For some ARM implementations better performance can be obtained by using this option.
-march=name This specifies the name of the target ARM architecture. GCC uses this name to determine what kind of instructions it can emit when generating assembly code. This option can be used in conjunction with or instead of the -mcpu= option. Permissible names are: ... `armv4t', `armv5', `armv5t',
`armv5te', `armv6j', ...
and there's a simpler guide (for newbies)
http://linuxreviews.org/howtos/compiling/ :
The most important flags are -mcpu and -march.
`-mcpu=pentium3` means the code will be optimized to run on Pentium3, but will also run on i386. (<-- Does this mean -march is more specific than -mcpu?)
`-march=pentium3` means the code will only run on a Pentium3.
when -march=arch is set, -mcpu=arch is honored. (<-- Well, what does this mean?)
`-O[n]` (the letter O, and a number) Various levels of optimization. -O1 , -O2 and -O3, where -O3 is highest.
And perhaps
`-fomit-fame-pointer` as well?
`-fomit-fame-pointer` makes programs faster at runtime, but makes debugging impossible. -O turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging. x86 processors need the frame pointer for debugging, so -fomit-frame-pointer is not turned on by default.
A few more questions:
1) My impression is that many Makefiles have -O2 and`-fomit-fame-pointer` CFLAGS preset, usually architecture-specific options are not (which makes sense). But then which combination would do the best? -march and/or -cpu and/or -mtune? Chances are that some source codes don't like some of them. I've come across make errors because of the -O flag and the -march/-mcpu flag(s).
2) What is the common and easy way to test the performance of the build, as Meanie suggests?
3) Does all this matter at all, given the not exceptionally fast processors in Zaurus?