CodeWarrior register usage for ColdFire

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior register usage for ColdFire

1,846 Views
flashtoo
Contributor I
I'm using CodeWarrior to develop C code for the MCF52233 ColdFire processor.  I seems that the C compiler does not take advantage of registers D1-D7 and A2-A5.  Is this seem correct?  I have not optimization turned on and the parameter passing is "standard". Does register utilization improve if optimizations are turned on?
 
When calling a assembly functions from C code, since the compliler does not use the registers, would it safe (but perhaps sloppy) code not to perserve the register values since they are not used by the compiler?
 
FlashToo
Labels (1)
0 Kudos
2 Replies

448 Views
CompilerGuru
NXP Employee
NXP Employee
I wonder why you ask. As long as you are using no optimizations,
the other registers probably wont be used much, but no one is guaranteeing that, so I would never count on such observations.

Note that the libraries are built with optimizations enabled, even if your code is not.

Another thing, there is an option not to use A6 for the frame, so this makes one register more available. Using the register calling convention (that's advanced), uses improves the register usage too.

Daniel
0 Kudos

448 Views
flashtoo
Contributor I
Optimizations are turned off just for debugging...  I plan on turning them on. I was reviewing some sample assembly routines and was going to craft my some of my own to improve performace in some areas. I noticed that some sample routines pushed/pulled used registers and others did not. Of course if you are trying to make it faster, push/pull adds time and is not desirable unless needed. I was just looking for some known rules, if they existed.
 
FlashToo
0 Kudos