OESF Portables Forum
Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: ZDevil on January 22, 2007, 05:12:33 am
-
What are the useful cflags we can use to make an optimized package for pdaXrom?
So far I only know -O2 and -march=armv5te (and perhaps -mcpu too but doesn't seem different than -march to me), while most other flags are too complicated to a non-nerd such as me.
(... well, is the --march flag needed at all?)
Look forward to reading from the gurus and experts here.
Thanks!
-
I too would be very interested in hearing what flags to use. I haven't been using any, as I have no clue what ones to use.
-
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?
-
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\"][a href=\"index.php?act=findpost&pid=152075\"][{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
-
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] (http://index.php?act=findpost&pid=152075\")
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/ (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?
-
3) Does all this matter at all, given the not exceptionally fast processors in Zaurus?
Even more so in that case!
2) What is the common and easy way to test the performance of the build, as Meanie suggests?
I'd test whatever it is you want to optimise - mplayer for example. On the other hand you could try some benchmarking programs (though these just test single things - floating point, integer operations, etc.).
See this thread for some results from a long time back: https://www.oesf.org/forums/index.php?showtopic=3451&hl= (https://www.oesf.org/forums/index.php?showtopic=3451&hl=)
and here for some Nokia binaries (not that useful of course) plus download URLs and compilation command lines: http://people.bath.ac.uk/enpsgp/benchmarks...ling_things.txt (http://people.bath.ac.uk/enpsgp/benchmarks/compiling_things.txt)
Opie has an applet which provides some benchmarks for various things: This can be found here: http://handhelds.org/cgi-bin/cvsweb.cgi/op...ttings/sysinfo/ (http://handhelds.org/cgi-bin/cvsweb.cgi/opie/noncore/settings/sysinfo/) (benchmarkinfo*)
And those files say they were inspired by zbench, the original URL for which is gone, but some source is here: http://linuxtogo.org/~mickeyl/mirror/zbench-2.0.tar.bz2 (http://linuxtogo.org/~mickeyl/mirror/zbench-2.0.tar.bz2)
Si
-
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]
Is -march=xscale allowed?
The official doc says: "... Permissible names are: `armv2', `armv2a', `armv3', `armv3m', `armv4', `armv4t', `armv5', `armv5t', `armv5te', `armv6j', `iwmmxt', `ep9312'." No "xscale", though.
I've tried both -march=armv5te -mcpu=xscale. Make complains about conflicting architecture flags.
Also tried --mcpu=xscale --mtune=xcale when recompiling Angband. So far so good.
-
3) Does all this matter at all, given the not exceptionally fast processors in Zaurus?
Even more so in that case!
So this seems to be the way to go ...
2) What is the common and easy way to test the performance of the build, as Meanie suggests?
I'd test whatever it is you want to optimise - mplayer for example. On the other hand you could try some benchmarking programs (though these just test single things - floating point, integer operations, etc.).
See this thread for some results from a long time back: https://www.oesf.org/forums/index.php?showtopic=3451&hl= (https://www.oesf.org/forums/index.php?showtopic=3451&hl=)
and here for some Nokia binaries (not that useful of course) plus download URLs and compilation command lines: http://people.bath.ac.uk/enpsgp/benchmarks...ling_things.txt (http://people.bath.ac.uk/enpsgp/benchmarks/compiling_things.txt)
Opie has an applet which provides some benchmarks for various things: This can be found here: http://handhelds.org/cgi-bin/cvsweb.cgi/op...ttings/sysinfo/ (http://handhelds.org/cgi-bin/cvsweb.cgi/opie/noncore/settings/sysinfo/) (benchmarkinfo*)
And those files say they were inspired by zbench, the original URL for which is gone, but some source is here: http://linuxtogo.org/~mickeyl/mirror/zbench-2.0.tar.bz2 (http://linuxtogo.org/~mickeyl/mirror/zbench-2.0.tar.bz2)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152139\"][{POST_SNAPBACK}][/a][/div]
Thanks for the resources! There is so much to learn and so much fun ...
-
Is optimizing something like Stratagus likely to make it run a lot better? I know that Battle of Survival on Stratagus 2.2.1 is barely playable, and 2.2.2 just came out, so I was wondering if optimization would help enough to make it play smoothly.
Thanks, and sorry if this is a dumb question.
-
Is optimizing something like Stratagus likely to make it run a lot better? I know that Battle of Survival on Stratagus 2.2.1 is barely playable, and 2.2.2 just came out, so I was wondering if optimization would help enough to make it play smoothly.
Thanks, and sorry if this is a dumb question.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152177\"][{POST_SNAPBACK}][/a][/div]
... Maybe Battle for Wesnoth as well? Dumb X2
Let me try this on prboom and Armagetron then (after purging out all the *band jobs).
-
Is optimizing something like Stratagus likely to make it run a lot better? I know that Battle of Survival on Stratagus 2.2.1 is barely playable, and 2.2.2 just came out, so I was wondering if optimization would help enough to make it play smoothly.
Thanks, and sorry if this is a dumb question.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152177\"][{POST_SNAPBACK}][/a][/div]
... Maybe Battle for Wesnoth as well? Dumb X2
Let me try this on prboom and Armagetron then (after purging out all the *band jobs).
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152179\"][{POST_SNAPBACK}][/a][/div]
I tried compiling Wesnoth a while ago, but it swapped so much that it didn't get anything done overnight, and I ended up stopping it.
-
Sorry that I have yet to look at the tools lardman refers to. Here is just a very impressionistic report:
I've tested different builds of Angband, Hellband, Frazband and Xangband. The binaries are not too small (1~2MB). I can feel the speed-up after using -O2 -mcpu=xscale -mtune=xscale. The games launch almost instantly.
With -O2 alone it seems to take (at least) a second or two to launch.
I also feel movement is more responsive in the game.
This is especially obvious in my Angband build with SDL sound support and 32x32 BMP tileset (usually the *band games use 8x8 or 16x16, some no graphical tiles at all), the game loads obviously faster and the sound effects play properly, while I feel a tiny bit of delay sometimes in my original build without architecture optimization.
I will also go rebuild ToME and Furyband (posted before) with this setting, particularly because they take longer time to load than the *band.
-
Sorry that I have yet to look at the tools lardman refers to. Here is just a very impressionistic report:
I've tested different builds of Angband, Hellband, Frazband and Xangband. The binaries are not too small (1~2MB). I can feel the speed-up after using -O2 -mcpu=xscale -mtune=xscale. The games launch almost instantly.
With -O2 alone it seems to take (at least) a second or two to launch.
I also feel movement is more responsive in the game.
This is especially obvious in my Angband build with SDL sound support and 32x32 BMP tileset (usually the *band games use 8x8 or 16x16, some no graphical tiles at all), the game loads obviously faster and the sound effects play properly, while I feel a tiny bit of delay sometimes in my original build without architecture optimization.
I will also go rebuild ToME and Furyband (posted before) with this setting, particularly because they take longer time to load than the *band.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152222\"][{POST_SNAPBACK}][/a][/div]
YES!!! Of course, now I want my Z to be working more than ever. I'll build the new Stratagus and see hoe BoS runs!
-
what is the performance difference when you compile with -march=armv5te vs -march=xscale ?
-march=xscale optimizes for the absurdly long pipeline present in the xscales, -march=armv5te only for the v5 instruction set
btw, I use -mtune and -mcpu instead of -march
x86 and arm gcc have conflicting rules on how to mix and match those
-
When I try to compile Stratagus with any CFLAGS or CXXFLAGS it doesn't configure. It doesn't find strings.h, memory.h, etc.
My command is:
#./configure --with-opengl=no --with-x CFLAGS=-O2,-mcpu=xscale,-mtune=xscale
Any idea what the problem is? The same thing happens when I try that with CXXFLAGS or both.
If you need any or all of the output, let me know.
Any help would be appreciated.
-
Tried it the other way around? (oh, and without commas...)
CFLAGS="-O2 -mcpu=xscale -mtune=xscale" ./configure --with-opengl=no --with-x
-
Tried it the other way around? (oh, and without commas...)
CFLAGS="-O2 -mcpu=xscale -mtune=xscale" ./configure --with-opengl=no --with-x
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152330\"][{POST_SNAPBACK}][/a][/div]
I'll give it a shot.
-
Part of my build script:
(sometimes i customize it when needed)
#!/bin/sh
export CFLAGS="-O2 -mcpu=xscale -mtune=iwmmxt"
export CPPFLAGS="-O2 -mcpu=xscale -mtune=iwmmxt"
./configure --prefix=/usr --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var $@ && make && mkdir -p package/usr
-
Tried it the other way around? (oh, and without commas...)
CFLAGS="-O2 -mcpu=xscale -mtune=xscale" ./configure --with-opengl=no --with-x
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152330\"][{POST_SNAPBACK}][/a][/div]
I'll give it a shot.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=152368\"][{POST_SNAPBACK}][/a][/div]
Just as a follow-up, that works fine.
-
I'm curious about "-msoftfloat"
While trying to recompile GCC3.4.5 (to include the currently missing fortran support in g77) using GCC3.4.5, the build is currently failing on missing FPA. Any suggestions?