hey, how much speed improvment would a pure C/C++ program recieve if the processor intensive functions were inlined?? for example, PQ or PocketSNES???
arming!!!
Inlining a function doesn't always speed up the execution time of a program... It can have the opposite effect.
jadam wrote:
hey, how much speed improvment would a pure C/C++ program recieve if the processor intensive functions were inlined?? for example, PQ or PocketSNES???
inlining can be good or bad - it can change the cache performance for the worst, but it can save quite a bit if a function is called a lot. The compiler can usually make these decisions better than you can though...
Likewise, rewriting in assembler has similar effects - your best bet is still to come up with a better algorithm. Changing from, say, bubblesort to quicksort is better than inlining bubblesort or rewriting it in assembler.
would writing in asm increase performance though, for say PocketSNES or a GBA emulator??? ZSNES is written in x86 asm, and runs beautifully on a Pentuim 75. while SNES9x on that same system is slooooooooooooooow.
Having years of assembler programming experience I can assure you that assembler is faster than C. So long as you understand both the assembly language & the hardware's capabilities you would always get faster code.
At present the resources for C++ on PocketPC are much better than for assembly language. eg: Count how many books you can buy on assembler for PocketPC. It won't take you very long as there are none (If I'm wrong please post title) so using C is easier & to be honest with recent announcements of Xscale & beyond it will not bee too long before 1Ghz PocketPCs are available making the choice of asm less important.
With assembler my approach was always to find those routines which happened again and again & put all the effort into finding the fastest way to shift those bytes around. You need to know how many machine cycles the Op codes take & the best routine to achieve your ends. Thanks to all the fine chaps & ladies ( or just lady as Pam is the only name I've seen on PM ) on PocketMatrix & other boards it's easy to get help in tuning your functions.
Forgetting speed assembly language is not so easy to read so you need to comment absolutely every line but you can do what you like & you don't have to force your brain to understand the machinations of C++ which can make an easy job seem hard at times.
Happy coding
At present the resources for C++ on PocketPC are much better than for assembly language. eg: Count how many books you can buy on assembler for PocketPC. It won't take you very long as there are none (If I'm wrong please post title) so using C is easier & to be honest with recent announcements of Xscale & beyond it will not bee too long before 1Ghz PocketPCs are available making the choice of asm less important.
With assembler my approach was always to find those routines which happened again and again & put all the effort into finding the fastest way to shift those bytes around. You need to know how many machine cycles the Op codes take & the best routine to achieve your ends. Thanks to all the fine chaps & ladies ( or just lady as Pam is the only name I've seen on PM ) on PocketMatrix & other boards it's easy to get help in tuning your functions.
Forgetting speed assembly language is not so easy to read so you need to comment absolutely every line but you can do what you like & you don't have to force your brain to understand the machinations of C++ which can make an easy job seem hard at times.
Happy coding
umm, you can find tons of stuff at www.arm.com, its more generalized about the arm processors, but the asm is there. Plus if you check out the GBA dev sites, you can learn a lot of ARM. And from what ive read about the GBA it uses a sort of dual mode processor, There is (16-bit)Thumb Mode and (32-bit)Arm mode. i would assume arm asm is arm asm. Plus intel has documents on it.
And its not really programming into the PocketPC API, but coding functions, such as an emulator. emulating the opcodes would be faster in arm asm, would it not??
And its not really programming into the PocketPC API, but coding functions, such as an emulator. emulating the opcodes would be faster in arm asm, would it not??
jadam wrote:
And from what ive read about the GBA it uses a sort of dual mode processor, There is (16-bit)Thumb Mode and (32-bit)Arm mode.
Yes, it does. The SA in the iPAQs does NOT have that capability. Any ARM processor with a T in its code-name has Thumb capability (like the ARM7TDMI core in the GBA)
jadam wrote: i would assume arm asm is arm asm. Plus intel has documents on it.
Essentially, yes (apart from the Thumb/ARM distinction). The only thing to watch is that some ARM processors have a different pipeline - earlier ones are 3 deep and later ones (the SA for example) is 5 deep.
jadam wrote:And its not really programming into the PocketPC API, but coding functions, such as an emulator. emulating the opcodes would be faster in arm asm, woul
Essentially, yes (apart from the Thumb/ARM distinction). The only thing to watch is that some ARM processors have a different pipeline - earlier ones are 3 deep and later ones (the SA for example) is 5 deep.
jadam wrote:And its not really programming into the PocketPC API, but coding functions, such as an emulator. emulating the opcodes would be faster in arm asm, would it not??
Undoubtably. For a naive "interpreted" approach, a branch table would probably work quite nicely with fixed-length operators... but I don't know how many processors will encode their instructions that "nicely"
heh, so i was right!! Got to look at the Thumb documents though, and check out its specs...