View Full Version : Efficiency of OS5 compilers
ThomasK
03-21-2003, 02:52 AM
Hi everybody,
I work in programming, not only but also for Palm applications. For the work I use Metrowerks CodeWarrior C/C++ version 5 (applications for Palm OS4). Now I will program for Palm OS5, I saw CodeWarrior arrived at version 9. But I konw from different other C/C++ compilers (i.e. GreenHills) that the code generation for ARM processors is not efficient.
Anybody has experiences at Palm OS5?
ayasin
03-21-2003, 03:04 PM
What do you mean by "not efficent"? Are you talking about asm generation or are you talking about optimization?
ThomasK
03-24-2003, 03:10 AM
Sorry for the late answer, office time is Mo-Fr ;) .
I mean the code generation itself by using the registers or better the resources of the ARM processor. This applies to both, the asm generation and the optimization.
I have seen development tools that were only adapted from other processors (i.e. INTEL) that have much lower registers than the ARM. So the company that provides the tool saves time, but the code generation is not efficient in many purposes. Optimization means using of the many general purpose registers of the ARM and this process results in the generation of asm code.
CliePet
03-24-2003, 01:05 PM
My experience/disclaimer:
I've only written a few small/simple Armlets, so efficient register allocation efficiency isn't really important.
----
There are two different ARM compilers available to you.
The one that comes with CodeWarrior Version 9 (not free) and the one that comes with the Palm SDK V5 (GNU, free)
I have had past experience with the GNU compiler which is pretty good [it is a generalized compiler with retargettable code generation].
I don't know about the code quality of the Metrowerks compiler, but the IDE integration makes it worth a look.
ayasin
03-26-2003, 10:47 PM
I don't really know how agressive a generic ARM compiler can be in register allocation. There are several registers that PalmOS requires to be left alone. In addition to that there may be registers that AMX uses. I think that loading the code in the code cache and the data in the data cache efficently and minimizing pipeline stalls would be much more useful and generally applicable. Its probably not likely that someone will hyper-optimize something like register allocation, but it is likely that someone would optimize the data and code so that cache lines are loaded optimally. In the same way, I'd be concerned if a compiler, given the code "for (i=10;i>0;i--) {}" generated:
MOV R0, #10
loop:
SUB R0, R0, 1
CMP R0, #0
BNE loop
rather than the more efficent
MOV R0, #10
loop:
SUBS R0, R0, 1
BNE loop
but I don't know that I would blame the compiler if the code was written "for (i=0;i<10;i++). As CliePet mentioned, the GNU compiler is a pretty good compiler, and if your _that_ concerned about speed in certain routines, you should probably consider coding them in an asm block.
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.