Path: utzoo!attcan!uunet!mcsun!unido!rwthinf!strange!krischan From: krischan@strange.informatik.rwth-aachen.de (Christian Engel) Newsgroups: comp.os.os9 Subject: Re: Passing parameters by registers is bad use?!?!? Keywords: C compiler, parameter passing Message-ID: <3555@rwthinf.UUCP> Date: 1 Oct 90 12:27:03 GMT References: <2820@cernvax.UUCP> <3117@mcrware.UUCP> <3552@rwthinf.UUCP> <2823@cernvax.UUCP> Sender: news@rwthinf.UUCP Reply-To: krischan@strange.UUCP (Christian Engel) Organization: Informatik RWTH Aachen Lines: 27 In article <2823@cernvax.UUCP> rbt@cernvax.UUCP (roberto divia) writes: >In article <3552@rwthinf.UUCP> krischan@truth.UUCP (Christian Engel) writes: >>In article <2820@cernvax.UUCP> rbt@cernvax.UUCP (roberto divia) writes: >>>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). >>Now, that's too high for me. Why should the chance of cache miss increase >>in passing parameters via stack? > >Simply because they will HAVE to be store in the data cache (this is done >during the PUSH), removing other lines from the cache itself, lines that >will have to be reloaded in case of new references. The data cache works >normally as function of the "region" of the data used by the program. Stack >references will exit from this region, increasing the number of cache >misses...-- Again: You need the same amount of stack storage area in either models. In any case except for parameters of storage class register space in the stack frame of the called function is required for the parameters. I think it makes no difference wether the parameters are moved to the stack before entering the function or afterwards. The code executed in the meantime is only the bsr and the link instructions. If you get a cache miss in one model you will get it in the other, too, don't you? -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- krischan@informatik.rwth-aachen.de *** mcvax!unido!rwthinf!strange!krischan Christian Engel, Lehrstuhl fuer Informatik I, RWTH Aachen Ahornstr. 55, D-5100 Aachen, W. Germany