From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 15787 invoked from network); 18 Nov 1998 22:41:43 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 18 Nov 1998 22:41:43 -0000 Received: from norad.dodds.net (scorpio@westgate-190-203.res.iastate.edu [129.186.190.203]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id RAA04535 for ; Wed, 18 Nov 1998 17:41:41 -0500 Received: from localhost (scorpio@localhost) by norad.dodds.net (8.8.5/8.8.5) with SMTP id QAA28219 for ; Wed, 18 Nov 1998 16:41:41 -0600 Date: Wed, 18 Nov 1998 16:41:40 -0600 (CST) From: Bibek Sahu Reply-To: Bibek Sahu To: axp-list@redhat.com Subject: Re: Alpha's floating point performance In-Reply-To: <19981118222640.A30010@obiwan.unix.cslab.tuwien.ac.at> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII If you don't activate optimizations, it most certainly does push the arguments onto the stack. And inside the function it pushes all local variables onto the stack. But then, that's _without_ optimizations. ;-) "gcc -S" will produce the assembler source that is built from the C file. You give it foo.c, it gives you foo.s. "asm" is the command to insert direct assembly in the C source. E.g., asm( "addq $16,1,$0" ); Beyond that, I don't know much about it. - Bob On Wed, 18 Nov 1998, Mark Probst wrote: > On Wed, Nov 18, 1998 at 01:15:03PM -0800, Chris Albertson wrote: > > > It depends on the compiler but normally C pushes the arguments > > onto the stack. The called function pops them off and places the > > return value on the stack. What is placed on the stack is either > > maybe on the 80x86 architecture but surely not on a machine with > 2x32 general purpose registers! calling convention on the alpha is > to pass the first six integer arguments of a function through > registers a0-a5 ($16-$21). the integer return value is returned > through $0. a function taking one 64bit argument, adding one > and returning the result would look like this: > > --- > .globl asm_func > > .ent asm_func > asm_func: > addq $16,1,$0 > jmp $31,($26) > > .end asm_func > --- > > a little c program calling it: > > --- > #include > > long asm_func (long l); > > int > main (void) > { > printf("%ld\n", asm_func(1)); > return 0; > } > --- > > that's about it. there's really nothing much to it. > > bye > schani > > -- > Mark Probst > Student, Programmer > http://www.unix.cslab.tuwien.ac.at/~schani/ > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com >