Coldfire: Parameter passing

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

Coldfire: Parameter passing

2,171 Views
mjbcswitzerland
Specialist V

Hi All

 

I would like to know more about the parameter passing method (Standard / Compact / Register) in the ColdFire processor setup (CW 6.3).

 

Using compact a reference code is 59k in size.
Using Register it is about 53k in size.

 

However the code doesn't run reliably when register passing is activated. (Eg. FTP server becomes unreliable - transfers often hang, which never happens with compact].

 

Any ideas what could make a program less reliable? Where can the user of register passing possibly cause problems?

 

Best regards

 

Mark Butcher
www.mjbc.ch / www.uTasker.com

Message Edited by CrasyCat on 2007-04-13 11:33 AM

Labels (1)
0 Kudos
3 Replies

334 Views
CrasyCat
Specialist III
Hello
 
I am not anm expert in Coldfire code generation, but I will try to find more info on the different parameter passing schemes.
 
Around what can make the system unstable after you select register parameter passing rules, I can think about the following:
     1- Did you link your code with the appropriate library files? If you use register parameter passing scheme, you should link against library files build with the same scheme.
Please refer to the ColdFire_Build_Tools_Reference.pdf chapter "ColdFire Runtime Libraries", section "Runtime Libraries" for more info about which library to take.
 
     2- Which registers are you saving/restoring in interrupt functions?  Compiler should save registers used within the function itself, but if you are calling functions within interrupt you may get into trouble.
 
I come back to you as soon as I get info on the different parameter passing scheme.
 
CrasyCat
0 Kudos

334 Views
mjbcswitzerland
Specialist V

Hi CrasyCat

Thanks for the tips, which we will look into in detail.
It will be good if we can find a way to successfull yuse this option because it allows around 10% code size reduction and possibly/probably useful speed improvement to go with it.

The code size of ColdFire programs is rather larger that ARM in thumb mode and this would be a useful improvement to close the gap.

Regards

Mark Butcher
www.mjbc.ch / www.uTasker.com

0 Kudos

334 Views
CrasyCat
Specialist III
Hello
Only description I found about that is the one from the Targeting manual:
 
Compact:  Passes on even-sized boundary for parameters smaller  than int (2 for short and char).
Standard:  Like compact, but always padded to 4 bytes.
Register:   Passes in scratch registers D0-D2 for integers, A0-A1 for pointers and fp0-fp1
                  when FPU codegen is selected; this can speed up programs that have many small functions.
 
CrasyCat
0 Kudos