From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10578 invoked from network); 18 Nov 1998 21:25:27 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 18 Nov 1998 21:25:27 -0000 Received: from obiwan.unix.cslab.tuwien.ac.at (schani@u194.cslab.tuwien.ac.at [193.170.72.194]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA32236 for ; Wed, 18 Nov 1998 16:25:25 -0500 Received: (from schani@localhost) by obiwan.unix.cslab.tuwien.ac.at (8.8.8/8.8.8) id WAA30509; Wed, 18 Nov 1998 22:26:41 GMT Message-ID: <19981118222640.A30010@obiwan.unix.cslab.tuwien.ac.at> Date: Wed, 18 Nov 1998 22:26:40 +0000 From: Mark Probst To: axp-list@redhat.com Subject: Re: Alpha's floating point performance Mail-Followup-To: axp-list@redhat.com References: <365338D7.AE1FA0DA@topdog.logicon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1 In-Reply-To: <365338D7.AE1FA0DA@topdog.logicon.com>; from Chris Albertson on Wed, Nov 18, 1998 at 01:15:03PM -0800 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/