Path: utzoo!attcan!uunet!mcsun!cernvax!rbt From: rbt@cernvax.UUCP (roberto divia) Newsgroups: comp.os.os9 Subject: Re: Passing parameters by registers is bad use?!?!? Keywords: C compiler, parameter passing Message-ID: <2820@cernvax.UUCP> Date: 27 Sep 90 06:19:14 GMT References: <3537@rwthinf.UUCP> Organization: CERN, European Laboratory for Particle Physics Lines: 18 Sorry, I tend to disagree. It is true that allocating two registers for parameter passing means some overload to the executable code but on the other hand it is *MUCH* faster to do things this way. I did some tests with a MC68030 and the same routine called with parameters in registers was 10-15% faster then the equivalent called with parameters on the stack. This comes for two main reasons: 1) the stack push/pop/stackPointerRearrangement takes time; 2) bigger is the data area used by the code is and easier is to have a cache miss (this in case of processors with data caches). The Microware convention of "caller saves" reduces the overhead of registers swapping/saving to the minimum necessary, so... -- | Roberto Divia` | Love at first sight is one of the greatest | | ============= | labor-saving devices the world has ever seen | | CERN : European Laboratory for Particle Physics, 1211 Geneva 23 | | Switzerland (CH) |