Date: Tue, 20 Jul 1999 09:54:20 +0200 To: pgcc AT delorie DOT com Subject: Re: calling functions Message-ID: <19990720095420.K263@cerebro.laendle> Mail-Followup-To: pgcc AT delorie DOT com References: <3 DOT 0 DOT 32 DOT 19990715013633 DOT 010d9ab0 AT pop DOT xs4all DOT nl> <14221 DOT 16161 DOT 37716 DOT 619890 AT lrz DOT de> <378DD81A DOT D4B1586D AT informatik DOT hu-berlin DOT de> <37911716 DOT 7A691225 AT netplus DOT net> <3 DOT 0 DOT 32 DOT 19990715013633 DOT 010d9ab0 AT pop DOT xs4all DOT nl> <378DD816 DOT F8986B77 AT informatik DOT hu-berlin DOT de> <3 DOT 0 DOT 32 DOT 19990715013633 DOT 010d9ab0 AT pop DOT xs4all DOT nl> <14221 DOT 16161 DOT 37716 DOT 619890 AT lrz DOT de> <3 DOT 0 DOT 32 DOT 19990715013633 DOT 010d9ab0 AT pop DOT xs4all DOT nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <3.0.32.19990715013633.010d9ab0@pop.xs4all.nl>; from Vincent Diepeveen on Thu, Jul 15, 1999 at 01:36:35AM +0100 X-Operating-System: Linux version 2.2.10 (root AT cerebro) (gcc driver version egcs-2.91.66 19990314 (egcs-1.1.2 release) executing gcc version 2.7.2.3) From: Marc Lehmann Reply-To: pgcc AT delorie DOT com X-Mailing-List: pgcc AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, Jul 15, 1999 at 01:36:35AM +0100, Vincent Diepeveen wrote: > Good morning, > > What is currently the overhad of a function call at the > PII, that this needs heavy optimization? push, memory acesses, ... > How many clocks for a typical call does pgcc need if we > have 2 integer parameters for it? I measured about 40 cycles on the first call and 8 cycles on subsequent ones for a simple function adding two integers. About 2-3 cacles less with register parameters. On Wed, Jul 14, 1999 at 06:56:11PM -0700, Eugene Leitl wrote: > The downside of having many registers is of course the need to save a > lot of state when the need to switch context arises. one context switch every hundred million function calls is, I think, not a concern at all ;) However, I expect the register stack to be much larger than the 128 visible registers, and there doubtlessly is special hardware support to swap the stack easily. On Thu, Jul 15, 1999 at 12:46:18PM +0000, Jens-Uwe Rumstich wrote: > routines) it wants to have access to. These number of registers is > reserved for this function and only them can be accessed Yes. > and only them have to be saved during a context switch and the rest gets lost? ;) -- -----==- | ----==-- _ | ---==---(_)__ __ ____ __ Marc Lehmann +-- --==---/ / _ \/ // /\ \/ / pcg AT goof DOT com |e| -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE --+ The choice of a GNU generation | |