#157077 - TwentySeven - Mon May 19, 2008 12:58 am
My current project has an intensive bit of C code that I'd like to speed up.
Before I start thinking about ASM'ing chunks of it off, I was hoping I could get some informaton on what I should be wary of with the arm 9?
I have done some forum searching, and the following things I'd like some clarification on if anyone knows much about it..
I mean I'm not completely uninformed about how to optimize for the ds cache, but I'd like to hear the state of the art on this.
Also, The arm 9 is faster in certain modes (arm vs thumb?) and executing code from certain banks of ram. Can anyone give specific info on this and why this is, and how to best use it?
#157081 - thegamefreak0134 - Mon May 19, 2008 2:15 am
There are twenty three different ways that you could optimize this code, and all of them may or may not be effective depending on a number of factors. The important ones are of course what the code needs to do, what kind of math is involved, and where the code is going to be executing from.
I don't know the specifics on arm vs thumb, but I know that C(++) code only compiles into one of the modes if I'm not mistaken, which means you have to jump into assembly if you want to use the other mode. (forum members, this is old knowledge, correct me if I'm mistaken on this.)
It would be most beneficial for you to post the code, as we can better judge the things that may or may not be useful to know when looking to optimize it. Of course, the usual mathematics operations (namely accounting for the lack of an FPU and making sure to use the hardware divide functions rather than the c language one, etc) should go without saying.
This seems to be an assembly vs C thing, so the folks in the ASM forum might be able to help a bit more on the matter.
-gamefreak
_________________
What if the hokey-pokey really is what it's all about?
[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]
#157083 - Dwedit - Mon May 19, 2008 2:20 am
Use GCC with the -S option to see the ASM code your compiler produces.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#157084 - TwentySeven - Mon May 19, 2008 2:21 am
I probably posted a bit prematurely, I'm actually getting fairly far just by continuing my own research.
#157104 - simonjhall - Mon May 19, 2008 9:42 am
Yeah there are lots of things that you can do, but it really depends on what exactly it is that the code does. Anyway - the very first thing you need to do is to profile the code. Premature optimisation is a bad thing to do!
_________________
Big thanks to everyone who donated for Quake2