CodeWarrior register usage for ColdFire

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CodeWarrior register usage for ColdFire

2,479件の閲覧回数
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
ラベル(1)
タグ(1)
0 件の賞賛
返信
2 返答(返信)

1,081件の閲覧回数
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 件の賞賛
返信

1,081件の閲覧回数
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 件の賞賛
返信