From: SourceForge.net <no...@so...> - 2004-06-28 07:01:04
|
Feature Requests item #979838, was opened at 2004-06-25 18:26 Message generated for change (Comment added) made by bernhardheld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=979838&group_id=599 Category: None Group: None Status: Open Priority: 5 Submitted By: Stephen (easyplan) Assigned to: Nobody/Anonymous (nobody) Summary: Register parameter passing Initial Comment: First, well done on a great product, to all those who have worked on the compiler. I have used Keil and HiTech compilers for an 8052, and both use the registers to pass parameters to functions. My project which compiles using the Keil compiler is 96 bytes short of data when compiled using SDCC because most of the parameters are passed in data space. Have you considered using the registers to pass parameters as part of the optimisation of data space? or allowing this as an option? ---------------------------------------------------------------------- >Comment By: Bernhard Held (bernhardheld) Date: 2004-06-28 09:00 Message: Logged In: YES user_id=203539 At the moment the register allocator is not clever enough to efficiently deal with parameters in registers. In general the benefit from register parameters is often overestimated. It certainly makes sense on CPUs with plenty of large registers. On a 8051 tiny functions will look much better. But in larger or complex functions you'll often find that the registers must be saved immediately after the entrance code. In many cases it's better to let the register allocator decide which variables should be kept in registers. It would be a big performance drawback, if e.g. an automatic variable used as a loop counter is located on the stack, because the parameters eat up all the register space. ---------------------------------------------------------------------- Comment By: Stephen (easyplan) Date: 2004-06-26 10:56 Message: Logged In: YES user_id=1071031 I didn't know about that option. Helps with data optimisation, but I see the libraries need to be re-compiled. Would it not make sense to use the active register bank to pass some of the parameters because often the parameters are being used in the registers. They are copied into bank 1 to be passed as parameters, and then the called function moves them back into registers to use. ---------------------------------------------------------------------- Comment By: Bernhard Held (bernhardheld) Date: 2004-06-25 18:31 Message: Logged In: YES user_id=203539 What about --parms-in-bank1? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=979838&group_id=599 |